Update terraform version transfer and README.md#15
Merged
Conversation
arunim2405
approved these changes
Jun 19, 2026
There was a problem hiding this comment.
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.terraformVersionvalues withTERRAFORM-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 on lines
+89
to
+91
| ```shell | ||
| ./convert_hcl_to_json.sh export/sg-payload.json | ||
| ``` |
| - Go to profile at the bottom left. Click on the email or the username. | ||
| - Click API key and click on view. | ||
|
|
||
| ```shell |
| - 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. |
| @@ -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* | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
TerraformConfig.terraformVersiontoTERRAFORM-1.1.6TERRAFORM-terraform.tfvars.exampletoterraform.tfvarsconvert_hcl_to_json.shsg-cliRisks & Edge Cases:
TERRAFORM-prefix may need regeneration before importjqandhcl2jsonat runtime, so network access is requiredDeployment Notes:
sg-payload.jsonusing the updated conversion flow before importing workflows