Skip to content

Conversation

@rixhieloomis
Copy link
Contributor

No description provided.

@Akshat0694 Akshat0694 changed the title cloudformation init Cloudformation bulk import onto SG Platform Jan 8, 2024
@notion-workspace
Copy link

@Akshat0694
Copy link
Member

Akshat0694 commented Jan 8, 2024

@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
Copy link
Member

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
Copy link
Member

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 {
Copy link
Member

Choose a reason for hiding this comment

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

Run terraform fmt

@@ -0,0 +1,5 @@
provider "aws" {
region = "eu-central-1" # Change to your desired AWS region
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
- 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.
Copy link
Member

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
- 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.
Copy link
Member

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

## Supported platforms for migration

- Terraform Cloud
Copy link
Member

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

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