Skip to content

Commit

Permalink
Added migration to new test account (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
goruha authored Sep 12, 2024
1 parent ffe3d96 commit b772f72
Show file tree
Hide file tree
Showing 16 changed files with 357 additions and 3 deletions.
13 changes: 13 additions & 0 deletions migrate/migrations/20240905/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## what
- Update `.github/settings.yml`
- Update `.github/chatops.yml` files

## why
- Re-apply `.github/settings.yml` from org level to get `terratest` environment
- Migrate to new `test` account

## References
* DEV-388 Automate clean up of test account in new organization
* DEV-387 Update terratest to work on a shared workflow instead of a dispatch action
* DEV-386 Update terratest to use new testing account with GitHub OIDC

16 changes: 16 additions & 0 deletions migrate/migrations/20240905/repos-00
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cloudposse/terraform-module-test
cloudposse/terraform-aws-ecs-web-app
cloudposse/terraform-aws-sns-lambda-notify-slack
cloudposse/terraform-aws-ecs-cloudwatch-sns-alarms
cloudposse/terraform-aws-dms
cloudposse/terraform-aws-backup
cloudposse/terraform-kubernetes-tfc-cloud-agent
cloudposse/terraform-aws-github-action-token-rotator
cloudposse/terraform-aws-memorydb
cloudposse/terraform-aws-vpn-connection
cloudposse/terraform-aws-lambda-function
cloudposse/terraform-aws-s3-log-storage
cloudposse/terraform-aws-service-control-policies
cloudposse/terraform-aws-step-functions
cloudposse/terraform-aws-ecs-spot-fleet
cloudposse/terraform-aws-lambda-cloudwatch-sns-alarms
16 changes: 16 additions & 0 deletions migrate/migrations/20240905/repos-01
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cloudposse/terraform-datadog-platform
cloudposse/terraform-aws-efs
cloudposse/terraform-external-module-artifact
cloudposse/terraform-aws-kv-store
cloudposse/terraform-aws-waf
cloudposse/terraform-aws-security-group
cloudposse/terraform-aws-organization-access-role
cloudposse/terraform-aws-ssm-parameter-chamber-reader
cloudposse/terraform-aws-cicd
cloudposse/terraform-aws-elastic-beanstalk-environment
cloudposse/terraform-aws-datadog-integration
cloudposse/terraform-aws-helm-release
cloudposse/terraform-aws-iam-system-user
cloudposse/terraform-aws-eks-iam-role
cloudposse/terraform-aws-config-storage
cloudposse/terraform-aws-sso
16 changes: 16 additions & 0 deletions migrate/migrations/20240905/repos-02
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cloudposse/terraform-aws-cloudwatch-flow-logs
cloudposse/terraform-aws-rds-cluster-instance-group
cloudposse/terraform-aws-efs-cloudwatch-sns-alarms
cloudposse/terraform-aws-kinesis-stream
cloudposse/terraform-aws-acm-request-certificate
cloudposse/terraform-aws-multi-az-subnets
cloudposse/terraform-aws-vpc
cloudposse/terraform-aws-iam-account-settings
cloudposse/terraform-aws-athena
cloudposse/terraform-aws-cloudtrail-s3-bucket
cloudposse/terraform-aws-ssm-parameter-store
cloudposse/terraform-aws-s3-website
cloudposse/terraform-aws-security-hub
cloudposse/terraform-aws-ec2-client-vpn
cloudposse/terraform-aws-network-firewall
cloudposse/terraform-aws-ssm-tls-ssh-key-pair
16 changes: 16 additions & 0 deletions migrate/migrations/20240905/repos-03
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cloudposse/terraform-terraform-label
cloudposse/terraform-null-label
cloudposse/terraform-aws-sns-topic
cloudposse/terraform-aws-route53-resolver-dns-firewall
cloudposse/terraform-aws-key-pair
cloudposse/terraform-cloudflare-waf-rulesets
cloudposse/terraform-aws-route53-alias
cloudposse/terraform-aws-managed-grafana
cloudposse/terraform-aws-emr-cluster
cloudposse/terraform-aws-ecs-container-definition
cloudposse/terraform-aws-alb-target-group-cloudwatch-sns-alarms
cloudposse/terraform-aws-efs-backup
cloudposse/terraform-aws-rds
cloudposse/terraform-aws-iam-s3-user
cloudposse/terraform-aws-mwaa
cloudposse/terraform-aws-alb-ingress
16 changes: 16 additions & 0 deletions migrate/migrations/20240905/repos-04
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cloudposse/terraform-aws-rds-replica
cloudposse/terraform-aws-ssm-iam-role
cloudposse/terraform-aws-budgets
cloudposse/terraform-aws-iam-assumed-roles
cloudposse/terraform-aws-iam-role
cloudposse/terraform-aws-rds-db-proxy
cloudposse/terraform-aws-sns-cloudwatch-sns-alarms
cloudposse/terraform-github-repository-webhooks
cloudposse/terraform-aws-route53-cluster-zone
cloudposse/terraform-aws-organization-access-group
cloudposse/terraform-aws-ec2-instance-group
cloudposse/terraform-aws-lb-s3-bucket
cloudposse/terraform-aws-ecs-codepipeline
cloudposse/terraform-aws-nlb
cloudposse/terraform-aws-elasticsearch
cloudposse/terraform-aws-elasticache-redis
16 changes: 16 additions & 0 deletions migrate/migrations/20240905/repos-05
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cloudposse/terraform-aws-vpc-peering-multi-account
cloudposse/terraform-aws-elasticache-memcached
cloudposse/terraform-aws-eks-workers
cloudposse/terraform-aws-ssm-patch-manager
cloudposse/terraform-aws-s3-bucket
cloudposse/terraform-aws-firewall-manager
cloudposse/terraform-aws-utils
cloudposse/terraform-aws-datadog-lambda-forwarder
cloudposse/terraform-aws-ecr
cloudposse/terraform-aws-ecs-alb-service-task
cloudposse/terraform-aws-config
cloudposse/terraform-aws-alb
cloudposse/terraform-aws-ec2-instance
cloudposse/terraform-yaml-stack-config
cloudposse/terraform-spacelift-cloud-infrastructure-automation
cloudposse/terraform-aws-cloudfront-s3-cdn
16 changes: 16 additions & 0 deletions migrate/migrations/20240905/repos-06
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cloudposse/terraform-aws-documentdb-cluster
cloudposse/terraform-aws-rds-cluster
cloudposse/terraform-cloudflare-zone
cloudposse/terraform-aws-eks-node-group
cloudposse/terraform-aws-eks-fargate-profile
cloudposse/terraform-aws-eks-cluster
cloudposse/terraform-aws-mq-broker
cloudposse/terraform-aws-ec2-autoscale-group
cloudposse/terraform-example-module
cloudposse/terraform-yaml-config
cloudposse/terraform-aws-cloudfront-cdn
cloudposse/terraform-aws-amplify-app
cloudposse/terraform-opsgenie-incident-management
cloudposse/terraform-aws-ec2-bastion-server
cloudposse/terraform-null-ansible
cloudposse/terraform-aws-tfstate-backend
16 changes: 16 additions & 0 deletions migrate/migrations/20240905/repos-07
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cloudposse/terraform-aws-eks-spotinst-ocean-nodepool
cloudposse/terraform-aws-transfer-sftp
cloudposse/terraform-aws-cloudtrail
cloudposse/terraform-aws-dynamodb-autoscaler
cloudposse/terraform-aws-dynamodb
cloudposse/terraform-aws-cloudwatch-events
cloudposse/terraform-aws-guardduty
cloudposse/terraform-aws-vpc-flow-logs-s3-bucket
cloudposse/terraform-aws-ecs-cluster
cloudposse/terraform-aws-codebuild
cloudposse/terraform-aws-iam-chamber-s3-role
cloudposse/terraform-aws-managed-prometheus
cloudposse/terraform-aws-rds-cloudwatch-sns-alarms
cloudposse/terraform-tls-ssh-key-pair
cloudposse/terraform-aws-lambda-elasticsearch-cleanup
cloudposse/terraform-aws-transit-gateway
16 changes: 16 additions & 0 deletions migrate/migrations/20240905/repos-08
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cloudposse/terraform-aws-ses-lambda-forwarder
cloudposse/terraform-aws-global-accelerator
cloudposse/terraform-aws-ses
cloudposse/terraform-aws-macie
cloudposse/terraform-aws-health-events
cloudposse/terraform-aws-ecs-cloudwatch-autoscaling
cloudposse/terraform-aws-cloudtrail-cloudwatch-alarms
cloudposse/terraform-aws-ssm-tls-self-signed-cert
cloudposse/terraform-aws-kms-key
cloudposse/terraform-aws-cloudwatch-logs
cloudposse/terraform-aws-cloudformation-stack
cloudposse/terraform-aws-iam-user
cloudposse/terraform-aws-service-quotas
cloudposse/terraform-aws-ec2-ami-backup
cloudposse/terraform-aws-elastic-beanstalk-application
cloudposse/terraform-null-smtp-mail
16 changes: 16 additions & 0 deletions migrate/migrations/20240905/repos-09
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cloudposse/terraform-aws-redshift-cluster
cloudposse/terraform-aws-ec2-admin-server
cloudposse/terraform-aws-dynamic-subnets
cloudposse/terraform-aws-lakeformation
cloudposse/terraform-aws-msk-apache-kafka-cluster
cloudposse/terraform-aws-refarch-utils
cloudposse/terraform-aws-ssm-parameter-store-policy-documents
cloudposse/terraform-aws-glue
cloudposse/terraform-aws-vpc-peering
cloudposse/terraform-aws-named-subnets
cloudposse/terraform-aws-route53-cluster-hostname
cloudposse/terraform-aws-api-gateway
cloudposse/terraform-aws-inspector
cloudposse/terraform-aws-ec2-ami-snapshot
cloudposse/terraform-aws-ecr-public
cloudposse/terraform-aws-cloudformation-stack-set
4 changes: 4 additions & 0 deletions migrate/migrations/20240905/repos-10
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cloudposse/terraform-aws-code-deploy
cloudposse/terraform-aws-iam-policy
cloudposse/terraform-artifactory-kv-store
cloudposse/terraform-aws-batch
5 changes: 5 additions & 0 deletions migrate/migrations/20240905/repos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
gh repo list cloudposse --limit 500 --json name,owner \
--jq '.[] | select(.name | test("^terraform")) | select(.name | test("^terraform-provider") | not) | select(.name | test("^terraform-aws-components") | not) | .owner.login + "/" + .name' > repos.txt

split -d -l 16 repos.txt repos-
164 changes: 164 additions & 0 deletions migrate/migrations/20240905/repos.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
cloudposse/terraform-module-test
cloudposse/terraform-aws-ecs-web-app
cloudposse/terraform-aws-sns-lambda-notify-slack
cloudposse/terraform-aws-ecs-cloudwatch-sns-alarms
cloudposse/terraform-aws-dms
cloudposse/terraform-aws-backup
cloudposse/terraform-kubernetes-tfc-cloud-agent
cloudposse/terraform-aws-github-action-token-rotator
cloudposse/terraform-aws-memorydb
cloudposse/terraform-aws-vpn-connection
cloudposse/terraform-aws-lambda-function
cloudposse/terraform-aws-s3-log-storage
cloudposse/terraform-aws-service-control-policies
cloudposse/terraform-aws-step-functions
cloudposse/terraform-aws-ecs-spot-fleet
cloudposse/terraform-aws-lambda-cloudwatch-sns-alarms
cloudposse/terraform-datadog-platform
cloudposse/terraform-aws-efs
cloudposse/terraform-external-module-artifact
cloudposse/terraform-aws-kv-store
cloudposse/terraform-aws-waf
cloudposse/terraform-aws-security-group
cloudposse/terraform-aws-organization-access-role
cloudposse/terraform-aws-ssm-parameter-chamber-reader
cloudposse/terraform-aws-cicd
cloudposse/terraform-aws-elastic-beanstalk-environment
cloudposse/terraform-aws-datadog-integration
cloudposse/terraform-aws-helm-release
cloudposse/terraform-aws-iam-system-user
cloudposse/terraform-aws-eks-iam-role
cloudposse/terraform-aws-config-storage
cloudposse/terraform-aws-sso
cloudposse/terraform-aws-cloudwatch-flow-logs
cloudposse/terraform-aws-rds-cluster-instance-group
cloudposse/terraform-aws-efs-cloudwatch-sns-alarms
cloudposse/terraform-aws-kinesis-stream
cloudposse/terraform-aws-acm-request-certificate
cloudposse/terraform-aws-multi-az-subnets
cloudposse/terraform-aws-vpc
cloudposse/terraform-aws-iam-account-settings
cloudposse/terraform-aws-athena
cloudposse/terraform-aws-cloudtrail-s3-bucket
cloudposse/terraform-aws-ssm-parameter-store
cloudposse/terraform-aws-s3-website
cloudposse/terraform-aws-security-hub
cloudposse/terraform-aws-ec2-client-vpn
cloudposse/terraform-aws-network-firewall
cloudposse/terraform-aws-ssm-tls-ssh-key-pair
cloudposse/terraform-terraform-label
cloudposse/terraform-null-label
cloudposse/terraform-aws-sns-topic
cloudposse/terraform-aws-route53-resolver-dns-firewall
cloudposse/terraform-aws-key-pair
cloudposse/terraform-cloudflare-waf-rulesets
cloudposse/terraform-aws-route53-alias
cloudposse/terraform-aws-managed-grafana
cloudposse/terraform-aws-emr-cluster
cloudposse/terraform-aws-ecs-container-definition
cloudposse/terraform-aws-alb-target-group-cloudwatch-sns-alarms
cloudposse/terraform-aws-efs-backup
cloudposse/terraform-aws-rds
cloudposse/terraform-aws-iam-s3-user
cloudposse/terraform-aws-mwaa
cloudposse/terraform-aws-alb-ingress
cloudposse/terraform-aws-rds-replica
cloudposse/terraform-aws-ssm-iam-role
cloudposse/terraform-aws-budgets
cloudposse/terraform-aws-iam-assumed-roles
cloudposse/terraform-aws-iam-role
cloudposse/terraform-aws-rds-db-proxy
cloudposse/terraform-aws-sns-cloudwatch-sns-alarms
cloudposse/terraform-github-repository-webhooks
cloudposse/terraform-aws-route53-cluster-zone
cloudposse/terraform-aws-organization-access-group
cloudposse/terraform-aws-ec2-instance-group
cloudposse/terraform-aws-lb-s3-bucket
cloudposse/terraform-aws-ecs-codepipeline
cloudposse/terraform-aws-nlb
cloudposse/terraform-aws-elasticsearch
cloudposse/terraform-aws-elasticache-redis
cloudposse/terraform-aws-vpc-peering-multi-account
cloudposse/terraform-aws-elasticache-memcached
cloudposse/terraform-aws-eks-workers
cloudposse/terraform-aws-ssm-patch-manager
cloudposse/terraform-aws-s3-bucket
cloudposse/terraform-aws-firewall-manager
cloudposse/terraform-aws-utils
cloudposse/terraform-aws-datadog-lambda-forwarder
cloudposse/terraform-aws-ecr
cloudposse/terraform-aws-ecs-alb-service-task
cloudposse/terraform-aws-config
cloudposse/terraform-aws-alb
cloudposse/terraform-aws-ec2-instance
cloudposse/terraform-yaml-stack-config
cloudposse/terraform-spacelift-cloud-infrastructure-automation
cloudposse/terraform-aws-cloudfront-s3-cdn
cloudposse/terraform-aws-documentdb-cluster
cloudposse/terraform-aws-rds-cluster
cloudposse/terraform-cloudflare-zone
cloudposse/terraform-aws-eks-node-group
cloudposse/terraform-aws-eks-fargate-profile
cloudposse/terraform-aws-eks-cluster
cloudposse/terraform-aws-mq-broker
cloudposse/terraform-aws-ec2-autoscale-group
cloudposse/terraform-example-module
cloudposse/terraform-yaml-config
cloudposse/terraform-aws-cloudfront-cdn
cloudposse/terraform-aws-amplify-app
cloudposse/terraform-opsgenie-incident-management
cloudposse/terraform-aws-ec2-bastion-server
cloudposse/terraform-null-ansible
cloudposse/terraform-aws-tfstate-backend
cloudposse/terraform-aws-eks-spotinst-ocean-nodepool
cloudposse/terraform-aws-transfer-sftp
cloudposse/terraform-aws-cloudtrail
cloudposse/terraform-aws-dynamodb-autoscaler
cloudposse/terraform-aws-dynamodb
cloudposse/terraform-aws-cloudwatch-events
cloudposse/terraform-aws-guardduty
cloudposse/terraform-aws-vpc-flow-logs-s3-bucket
cloudposse/terraform-aws-ecs-cluster
cloudposse/terraform-aws-codebuild
cloudposse/terraform-aws-iam-chamber-s3-role
cloudposse/terraform-aws-managed-prometheus
cloudposse/terraform-aws-rds-cloudwatch-sns-alarms
cloudposse/terraform-tls-ssh-key-pair
cloudposse/terraform-aws-lambda-elasticsearch-cleanup
cloudposse/terraform-aws-transit-gateway
cloudposse/terraform-aws-ses-lambda-forwarder
cloudposse/terraform-aws-global-accelerator
cloudposse/terraform-aws-ses
cloudposse/terraform-aws-macie
cloudposse/terraform-aws-health-events
cloudposse/terraform-aws-ecs-cloudwatch-autoscaling
cloudposse/terraform-aws-cloudtrail-cloudwatch-alarms
cloudposse/terraform-aws-ssm-tls-self-signed-cert
cloudposse/terraform-aws-kms-key
cloudposse/terraform-aws-cloudwatch-logs
cloudposse/terraform-aws-cloudformation-stack
cloudposse/terraform-aws-iam-user
cloudposse/terraform-aws-service-quotas
cloudposse/terraform-aws-ec2-ami-backup
cloudposse/terraform-aws-elastic-beanstalk-application
cloudposse/terraform-null-smtp-mail
cloudposse/terraform-aws-redshift-cluster
cloudposse/terraform-aws-ec2-admin-server
cloudposse/terraform-aws-dynamic-subnets
cloudposse/terraform-aws-lakeformation
cloudposse/terraform-aws-msk-apache-kafka-cluster
cloudposse/terraform-aws-refarch-utils
cloudposse/terraform-aws-ssm-parameter-store-policy-documents
cloudposse/terraform-aws-glue
cloudposse/terraform-aws-vpc-peering
cloudposse/terraform-aws-named-subnets
cloudposse/terraform-aws-route53-cluster-hostname
cloudposse/terraform-aws-api-gateway
cloudposse/terraform-aws-inspector
cloudposse/terraform-aws-ec2-ami-snapshot
cloudposse/terraform-aws-ecr-public
cloudposse/terraform-aws-cloudformation-stack-set
cloudposse/terraform-aws-code-deploy
cloudposse/terraform-aws-iam-policy
cloudposse/terraform-artifactory-kv-store
cloudposse/terraform-aws-batch
7 changes: 7 additions & 0 deletions migrate/migrations/20240905/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
title "Migrate new test account"

refresh_github_settings
install .github/workflows

# Merge the PR
auto_merge
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ permissions:
pull-requests: write
id-token: write
contents: write
statuses: write

jobs:
terraform-module:
test:
uses: cloudposse/.github/.github/workflows/shared-terraform-chatops.yml@main
secrets:
github_access_token: ${{ secrets.REPO_ACCESS_TOKEN }}
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/terratest') }}
secrets: inherit

0 comments on commit b772f72

Please sign in to comment.