Skip to content

Update terraform version transfer and README.md#15

Merged
hllvc merged 2 commits into
masterfrom
fix/terraform-version-transfer
Jun 19, 2026
Merged

Update terraform version transfer and README.md#15
hllvc merged 2 commits into
masterfrom
fix/terraform-version-transfer

Conversation

@hllvc

@hllvc hllvc commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary:

This PR updates the Terraform version transfer flow to preserve the Terraform Cloud version in the StackGuardian payload using the expected TERRAFORM- prefix. It also tightens the documentation for exporting, converting, and bulk importing workflows.

Motivation & Context:

The migration logic needed to align with StackGuardian’s Terraform version format so imported workflows carry the correct version metadata. This change improves the reliability of Terraform version transfers during bulk workflow migration.

Changes Made:

  • Updated the payload schema example to set TerraformConfig.terraformVersion to TERRAFORM-1.1.6
  • Changed the Terraform Cloud conversion logic to prefix exported workspace versions with TERRAFORM-
  • Refined README migration steps for exporting Terraform definitions and state
  • Clarified how to copy terraform.tfvars.example to terraform.tfvars
  • Added guidance for converting HCL string variables to JSON with convert_hcl_to_json.sh
  • Simplified and corrected bulk import instructions for sg-cli
  • Fixed wording and formatting issues throughout the migration documentation

Risks & Edge Cases:

  • Existing payloads without the TERRAFORM- prefix may need regeneration before import
  • The conversion script downloads jq and hcl2json at runtime, so network access is required

Deployment Notes:

  • No code deployment or database migration is required
  • Regenerate sg-payload.json using the updated conversion flow before importing workflows

@hllvc hllvc self-assigned this Jun 19, 2026
@hllvc hllvc requested review from arunim2405 and taherkk and removed request for arunim2405 and taherkk June 19, 2026 13:57
@arunim2405 arunim2405 requested review from arunim2405 and Copilot June 19, 2026 14:12
@hllvc hllvc changed the title Update README.md. Update terraform version transfer and README.md Jun 19, 2026
@hllvc hllvc merged commit 778e8fe into master Jun 19, 2026
1 check passed
@hllvc hllvc deleted the fix/terraform-version-transfer branch June 19, 2026 14:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Terraform Cloud → StackGuardian migration flow so exported workflow payloads preserve Terraform versions in the StackGuardian-expected TERRAFORM-<version> format, and tightens the README migration instructions (export/convert/import).

Changes:

  • Prefixed exported TerraformConfig.terraformVersion values with TERRAFORM- in the Terraform Cloud transformer.
  • Updated the example payload schema to show terraformVersion: "TERRAFORM-1.1.6".
  • Refined README steps for HCL→JSON conversion and bulk importing workflows via sg-cli.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
transformer/terraform-cloud/locals.tf Prefixes Terraform Cloud workspace versions with TERRAFORM- in generated workflow payloads.
transformer/terraform-cloud/example_payload.jsonc Updates the payload example to reflect the TERRAFORM- version format.
README.md Improves migration instructions, adds HCL→JSON conversion guidance, and adjusts bulk import usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md
Comment on lines +89 to +91
```shell
./convert_hcl_to_json.sh export/sg-payload.json
```
Comment thread README.md
- Go to profile at the bottom left. Click on the email or the username.
- Click API key and click on view.

```shell
Comment thread README.md
- Run the following commands and pass the `sg-payload.json` as payload (represented below)
- `--workflow-group` is required even though `wfgrpName` is set in the payload. Pass the workflow group ID (e.g. `prj-ThpsFFz59kqFaVr4`).
- Get your SG API Key here:
- Login to Stackguardian.
Comment thread README.md
@@ -95,20 +106,11 @@ cd ../../export
export SG_API_TOKEN=<YOUR_SG_API_TOKEN>
wget -q "$(wget -qO- "https://api.github.com/repos/stackguardian/sg-cli/releases/latest" | jq -r '.tarball_url')" -O sg-cli.tar.gz && tar -xf sg-cli.tar.gz && rm -f sg-cli.tar.gz && /bin/cp -rf StackGuardian-sg-cli*/shell/sg-cli . && rm -rfd StackGuardian-sg-cli*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants