-
Notifications
You must be signed in to change notification settings - Fork 1
Cloudformation bulk import onto SG Platform #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
@rixhieloomis Please create a README for the users. Also edit main README.md to add this new transformer. Currently the main docs are only about Terraform Cloud, fix it to include the Cloudformation as well. |
|
||
- An organization on [StackGuardian Platform](https://app.stackguardian.io) | ||
- Optionally, pre-configure VCS, cloud integrations or private runners to use when importing into StackGuardian Platform. | ||
- Terraform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add "AWS account with adequate access where CloudFormation stacks are maintained."
```shell | ||
cd transformer/terraform-cloud | ||
terraform init | ||
terraform apply -target=null_resource.get_stack_names |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment what this and the next command does
@@ -0,0 +1,92 @@ | |||
locals { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run terraform fmt
transformer/cloudformation/main.tf
Outdated
@@ -0,0 +1,5 @@ | |||
provider "aws" { | |||
region = "eu-central-1" # Change to your desired AWS region |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to your desired AWS region, where Cloudformation stacks are maintained.
resource "null_resource" "get_stack_names" { | ||
provisioner "local-exec" { | ||
command = <<-EOT | ||
aws cloudformation describe-stacks --query 'Stacks[*].{Name:StackName}' --output json > stack_names.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you cleaning up this file after successful or failed execution?
|
||
bucket = var.s3Bucket | ||
key = "${var.s3_path}/${each.key}.yaml" | ||
content = each.value.template_body |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User might want to pass encryption info as well. Please create a task for working on it later.
README.md
Outdated
|
||
### Export the resource definitions and Terraform state | ||
|
||
- Choose the transformer and locate the example of `terraform.tfvars.example` and rename it to `terraform.tfvars`. | ||
- Edit terraform.tfvars with appropriate variables. | ||
- Run the following commands: | ||
- Run the following commands mentioned in the README.md file in the transformer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run the commands mentioned in the README.md file in the transformer.
README.md
Outdated
|
||
### Export the resource definitions and Terraform state | ||
|
||
- Choose the transformer and locate the example of `terraform.tfvars.example` and rename it to `terraform.tfvars`. | ||
- Edit terraform.tfvars with appropriate variables. | ||
- Run the following commands: | ||
- Run the following commands mentioned in the README.md file in the transformer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a link to each provider docs
README.md
Outdated
@@ -5,6 +5,7 @@ Migrate workloads from other platforms to [StackGuardian Platform](https://app.s | |||
## Supported platforms for migration | |||
|
|||
- Terraform Cloud |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add link to the readmes of each providers
No description provided.