Skip to content

Commit

Permalink
Migrate terraform modules to shared workflows (#91)
Browse files Browse the repository at this point in the history
* Migrate terraform modules to shared workflows

* Rollback migration 20240507

* Update script.sh

* Update script.sh
  • Loading branch information
goruha authored May 21, 2024
1 parent 9f2a18b commit 99b7882
Show file tree
Hide file tree
Showing 22 changed files with 388 additions and 36 deletions.
2 changes: 1 addition & 1 deletion migrate/migrations/20240507/repos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
gh repo list cloudposse --limit 500 --json name,owner \
--jq '.[] | select(.name | test("^terraform")) | select(.name | test("^terraform-provider") | not) | .owner.login + "/" + .name' > repos.txt

split -d -l 16 repos.txt repos-
split -d -l 16 repos.txt repos-
5 changes: 5 additions & 0 deletions migrate/migrations/20240517/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## what
- Update workflows (`.github/workflows`) to use shared workflows from `.github` repo

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

install .github/workflows
remove .github/workflows/feature-branch.yml
remove .github/workflows/release-branch.yml
remove .github/workflows/release-published.yml
remove .github/workflows/feature-branch-chatops.yml

# Merge the PR
auto_merge
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
---
name: release-branch
name: Branch
on:
pull_request:
branches:
- main
- release/**
types: [opened, synchronize, reopened, labeled, unlabeled]
push:
branches:
- main
Expand All @@ -16,5 +21,5 @@ permissions: {}

jobs:
terraform-module:
uses: cloudposse/github-actions-workflows-terraform-module/.github/workflows/release-branch.yml@main
uses: cloudposse/.github/.github/workflows/shared-terraform-module.yml@main
secrets: inherit
Loading

0 comments on commit 99b7882

Please sign in to comment.