Skip to content

Comments

Onboard github-control CI/CD with gha-admin v3.6.1#84

Merged
akuzminsky merged 1 commit intomainfrom
onboard-github-control
Feb 20, 2026
Merged

Onboard github-control CI/CD with gha-admin v3.6.1#84
akuzminsky merged 1 commit intomainfrom
onboard-github-control

Conversation

@akuzminsky
Copy link
Member

Summary

  • Add centralized gha-admin v3.6.1 + state-bucket + ci-cd-params modules for github-control
  • Roles created in 303467602807 (OIDC + admin) and 289256138624 (state-manager)
  • SSM parameters created in 303467602807 for backend discovery
  • Existing S3 bucket and IAM roles need to be imported before apply (see plan)

Migration plan

See .claude/plans/migrate-github-control-gha-admin.md for full step-by-step instructions including import commands and github-control repo changes.

Test plan

  • terraform init succeeds
  • Import existing S3 bucket and IAM roles (commands in plan)
  • terraform plan shows no destroys
  • terraform apply succeeds
  • SSM parameters queryable in 303467602807
  • Follow up with github-control PR to complete migration

🤖 Generated with Claude Code

Migrate github-control's CI/CD infrastructure from self-managed
terraform-aws-ci-cd module to centralized gha-admin v3.6.1 in
aws-control. Creates state-bucket, gha-admin, and ci-cd-params
modules for github-control in accounts 303467602807 and 289256138624.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link

State s3://infrahouse-aws-control-990466748045/terraform.tfstate

Affected resources counts

Success 🟢 Add 🟡 Change Destroy
14 5 0

Affected resources by action

Action Resources
🟢 module.ci_cd_params_github_control.aws_ssm_parameter.admin_role_arn
🟢 module.ci_cd_params_github_control.aws_ssm_parameter.github_role_arn
🟢 module.ci_cd_params_github_control.aws_ssm_parameter.lock_table
🟢 module.ci_cd_params_github_control.aws_ssm_parameter.state_bucket
🟢 module.ci_cd_params_github_control.aws_ssm_parameter.state_manager_role_arn
🟢 module.ih_tf_github_control.aws_iam_policy.github
🟢 module.ih_tf_github_control.aws_iam_role_policy_attachment.admin
🟢 module.ih_tf_github_control.aws_iam_role_policy_attachment.github
🟢 module.state_bucket_github_control.aws_dynamodb_table.terraform_locks
🟢 module.state_bucket_github_control.random_pet.suffix
🟢 module.ih_tf_github_control.module.state-manager.aws_iam_policy.permissions_ro
🟢 module.ih_tf_github_control.module.state-manager.aws_iam_policy.permissions_rw
🟢 module.ih_tf_github_control.module.state-manager.aws_iam_role_policy_attachment.state-manager-ro
🟢 module.ih_tf_github_control.module.state-manager.aws_iam_role_policy_attachment.state-manager-rw[0]
🟡 module.ih_tf_github_control.aws_iam_role.admin
🟡 module.ih_tf_github_control.aws_iam_role.github
🟡 module.state_bucket_github_control.aws_s3_bucket.state-bucket
🟡 module.state_bucket_github_control.aws_s3_bucket_policy.state-bucke
🟡 module.ih_tf_github_control.module.state-manager.aws_iam_role.state-manager
STDOUT
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
 <= read (data resources)

Terraform will perform the following actions:

  # module.ci_cd_params_github_control.aws_ssm_parameter.admin_role_arn will be created
  + resource "aws_ssm_parameter" "admin_role_arn" {
      + arn            = (known after apply)
      + data_type      = (known after apply)
      + has_value_wo   = (known after apply)
      + id             = (known after apply)
      + insecure_value = (known after apply)
      + key_id         = (known after apply)
      + name           = "/terraform/github-control/ci-cd/admin_role_arn"
      + tags_all       = {
          + "created_by"  = "infrahouse/aws-control"
          + "environment" = "production"
        }
      + tier           = (known after apply)
      + type           = "String"
      + value          = (sensitive value)
      + value_wo       = (write-only attribute)
      + version        = (known after apply)
    }

  # module.ci_cd_params_github_control.aws_ssm_parameter.github_role_arn will be created
  + resource "aws_ssm_parameter" "github_role_arn" {
      + arn            = (known after apply)
      + data_type      = (known after apply)
      + has_value_wo   = (known after apply)
      + id             = (known after apply)
      + insecure_value = (known after apply)
      + key_id         = (known after apply)
      + name           = "/terraform/github-control/ci-cd/github_role_arn"
      + tags_all       = {
          + "created_by"  = "infrahouse/aws-control"
          + "environment" = "production"
        }
      + tier           = (known after apply)
      + type           = "String"
      + value          = (sensitive value)
      + value_wo       = (write-only attribute)
      + version        = (known after apply)
    }

  # module.ci_cd_params_github_control.aws_ssm_parameter.lock_table will be created
  + resource "aws_ssm_parameter" "lock_table" {
      + arn            = (known after apply)
      + data_type      = (known after apply)
      + has_value_wo   = (known after apply)
      + id             = (known after apply)
      + insecure_value = (known after apply)
      + key_id         = (known after apply)
      + name           = "/terraform/github-control/backend/lock_table"
      + tags_all       = {
          + "created_by"  = "infrahouse/aws-control"
          + "environment" = "production"
        }
      + tier           = (known after apply)
      + type           = "String"
      + value          = (sensitive value)
      + value_wo       = (write-only attribute)
      + version        = (known after apply)
    }

  # module.ci_cd_params_github_control.aws_ssm_parameter.state_bucket will be created
  + resource "aws_ssm_parameter" "state_bucket" {
      + arn            = (known after apply)
      + data_type      = (known after apply)
      + has_value_wo   = (known after apply)
      + id             = (known after apply)
      + insecure_value = (known after apply)
      + key_id         = (known after apply)
      + name           = "/terraform/github-control/backend/state_bucket"
      + tags_all       = {
          + "created_by"  = "infrahouse/aws-control"
          + "environment" = "production"
        }
      + tier           = (known after apply)
      + type           = "String"
      + value          = (sensitive value)
      + value_wo       = (write-only attribute)
      + version        = (known after apply)
    }

  # module.ci_cd_params_github_control.aws_ssm_parameter.state_manager_role_arn will be created
  + resource "aws_ssm_parameter" "state_manager_role_arn" {
      + arn            = (known after apply)
      + data_type      = (known after apply)
      + has_value_wo   = (known after apply)
      + id             = (known after apply)
      + insecure_value = (known after apply)
      + key_id         = (known after apply)
      + name           = "/terraform/github-control/backend/state_manager_role_arn"
      + tags_all       = {
          + "created_by"  = "infrahouse/aws-control"
          + "environment" = "production"
        }
      + tier           = (known after apply)
      + type           = "String"
      + value          = (sensitive value)
      + value_wo       = (write-only attribute)
      + version        = (known after apply)
    }

  # module.ih_tf_github_control.data.aws_iam_policy_document.admin-trust will be read during apply
  # (depends on a resource or a module with changes pending)
 <= data "aws_iam_policy_document" "admin-trust" {
      + id            = (known after apply)
      + json          = (known after apply)
      + minified_json = (known after apply)

      + statement {
          + actions = [
              + "sts:AssumeRole",
            ]

          + principals {
              + identifiers = [
                  + "arn:aws:iam::303467602807:role/ih-tf-github-control-github",
                  + "arn:aws:iam::990466748045:role/aws-reserved/sso.amazonaws.com/us-west-1/AWSReservedSSO_AWSAdministratorAccess_16bdbe5eb442e7ef",
                ]
              + type        = "AWS"
            }
        }
    }

  # module.ih_tf_github_control.data.aws_iam_policy_document.github-permissions will be read during apply
  # (depends on a resource or a module with changes pending)
 <= data "aws_iam_policy_document" "github-permissions" {
      + id            = (known after apply)
      + json          = (known after apply)
      + minified_json = (known after apply)

      + statement {
          + actions   = [
              + "sts:AssumeRole",
            ]
          + resources = [
              + "arn:aws:iam::289256138624:role/ih-tf-aws-control-289256138624-admin",
              + "arn:aws:iam::289256138624:role/ih-tf-github-control-state-manager",
              + "arn:aws:iam::303467602807:role/ih-tf-github-control-admin",
              + "arn:aws:iam::493370826424:role/ih-tf-aws-control-493370826424-admin",
            ]
        }
    }

  # module.ih_tf_github_control.aws_iam_policy.github will be created
  + resource "aws_iam_policy" "github" {
      + arn              = (known after apply)
      + attachment_count = (known after apply)
      + id               = (known after apply)
      + name             = (known after apply)
      + name_prefix      = "ih-tf-github-control-github"
      + path             = "/"
      + policy           = (known after apply)
      + policy_id        = (known after apply)
      + tags             = {
          + "created_by_module" = "infrahouse/gha-admin/aws"
        }
      + tags_all         = {
          + "created_by"        = "infrahouse/aws-control"
          + "created_by_module" = "infrahouse/gha-admin/aws"
          + "environment"       = "production"
        }
    }

  # module.ih_tf_github_control.aws_iam_role.admin will be updated in-place
  ~ resource "aws_iam_role" "admin" {
      ~ assume_role_policy    = jsonencode(
            {
              - Statement = [
                  - {
                      - Action    = "sts:AssumeRole"
                      - Effect    = "Allow"
                      - Principal = {
                          - AWS = [
                              - "arn:aws:iam::303467602807:role/ih-tf-github-control-github",
                              - "arn:aws:iam::990466748045:role/aws-reserved/sso.amazonaws.com/us-west-1/AWSReservedSSO_AWSAdministratorAccess_16bdbe5eb442e7ef",
                            ]
                        }
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> (known after apply)
        id                    = "ih-tf-github-control-admin"
        name                  = "ih-tf-github-control-admin"
      ~ tags                  = {
          - "created_by"        = "infrahouse8/github-control" -> null
            "created_by_module" = "infrahouse/gha-admin/aws"
            "module_version"    = "3.6.1"
        }
      ~ tags_all              = {
          ~ "created_by"        = "infrahouse8/github-control" -> "infrahouse/aws-control"
          + "environment"       = "production"
            # (2 unchanged elements hidden)
        }
        # (10 unchanged attributes hidden)
    }

  # module.ih_tf_github_control.aws_iam_role.github will be updated in-place
  ~ resource "aws_iam_role" "github" {
        id                    = "ih-tf-github-control-github"
        name                  = "ih-tf-github-control-github"
      ~ tags                  = {
          - "created_by"        = "infrahouse8/github-control" -> null
            "created_by_module" = "infrahouse/gha-admin/aws"
        }
      ~ tags_all              = {
          ~ "created_by"        = "infrahouse8/github-control" -> "infrahouse/aws-control"
          + "environment"       = "production"
            # (1 unchanged element hidden)
        }
        # (11 unchanged attributes hidden)
    }

  # module.ih_tf_github_control.aws_iam_role_policy_attachment.admin will be created
  + resource "aws_iam_role_policy_attachment" "admin" {
      + id         = (known after apply)
      + policy_arn = "arn:aws:iam::aws:policy/AdministratorAccess"
      + role       = "ih-tf-github-control-admin"
    }

  # module.ih_tf_github_control.aws_iam_role_policy_attachment.github will be created
  + resource "aws_iam_role_policy_attachment" "github" {
      + id         = (known after apply)
      + policy_arn = (known after apply)
      + role       = "ih-tf-github-control-github"
    }

  # module.state_bucket_github_control.data.aws_iam_policy_document.enforce_ssl_policy will be read during apply
  # (depends on a resource or a module with changes pending)
 <= data "aws_iam_policy_document" "enforce_ssl_policy" {
      + id            = (known after apply)
      + json          = (known after apply)
      + minified_json = (known after apply)

      + statement {
          + actions   = [
              + "s3:*",
            ]
          + effect    = "Deny"
          + resources = [
              + "arn:aws:s3:::infrahouse-github-control-state",
              + "arn:aws:s3:::infrahouse-github-control-state/*",
            ]
          + sid       = "AllowSSLRequestsOnly"

          + condition {
              + test     = "Bool"
              + values   = [
                  + "false",
                ]
              + variable = "aws:SecureTransport"
            }

          + principals {
              + identifiers = [
                  + "*",
                ]
              + type        = "*"
            }
        }
    }

  # module.state_bucket_github_control.aws_dynamodb_table.terraform_locks will be created
  + resource "aws_dynamodb_table" "terraform_locks" {
      + arn              = (known after apply)
      + billing_mode     = "PAY_PER_REQUEST"
      + hash_key         = "LockID"
      + id               = (known after apply)
      + name             = (known after apply)
      + read_capacity    = (known after apply)
      + stream_arn       = (known after apply)
      + stream_label     = (known after apply)
      + stream_view_type = (known after apply)
      + tags             = {
          + "VantaNoAlert"      = "Table used for Terraform state lock and does not contain user data"
          + "created_by_module" = "infrahouse/state-bucket/aws"
          + "state_bucket"      = "infrahouse-github-control-state"
        }
      + tags_all         = {
          + "VantaNoAlert"      = "Table used for Terraform state lock and does not contain user data"
          + "created_by"        = "infrahouse/aws-control"
          + "created_by_module" = "infrahouse/state-bucket/aws"
          + "environment"       = "production"
          + "state_bucket"      = "infrahouse-github-control-state"
        }
      + write_capacity   = (known after apply)

      + attribute {
          + name = "LockID"
          + type = "S"
        }

      + point_in_time_recovery (known after apply)

      + server_side_encryption (known after apply)

      + ttl (known after apply)
    }

  # module.state_bucket_github_control.aws_s3_bucket.state-bucket will be updated in-place
  ~ resource "aws_s3_bucket" "state-bucket" {
      + force_destroy               = false
        id                          = "infrahouse-github-control-state"
      ~ tags                        = {
          - "created_by"        = "infrahouse8/github-control"
          - "created_by_module" = "infrahouse/state-bucket/aws"
          - "lock_table"        = "infrahouse-github-control-state-polished-lioness"
          - "module_version"    = "2.2.0"
          - "used_by"           = "infrahouse8/github-control"
        } -> (known after apply)
      ~ tags_all                    = {
          - "created_by"        = "infrahouse8/github-control"
          - "created_by_module" = "infrahouse/state-bucket/aws"
          - "lock_table"        = "infrahouse-github-control-state-polished-lioness"
          - "module_version"    = "2.2.0"
          - "used_by"           = "infrahouse8/github-control"
        } -> (known after apply)
        # (11 unchanged attributes hidden)

        # (3 unchanged blocks hidden)
    }

  # module.state_bucket_github_control.aws_s3_bucket_policy.state-bucke will be updated in-place
  ~ resource "aws_s3_bucket_policy" "state-bucke" {
        id     = "infrahouse-github-control-state"
      ~ policy = jsonencode(
            {
              - Statement = [
                  - {
                      - Action    = "s3:*"
                      - Condition = {
                          - Bool = {
                              - "aws:SecureTransport" = "false"
                            }
                        }
                      - Effect    = "Deny"
                      - Principal = "*"
                      - Resource  = [
                          - "arn:aws:s3:::infrahouse-github-control-state/*",
                          - "arn:aws:s3:::infrahouse-github-control-state",
                        ]
                      - Sid       = "AllowSSLRequestsOnly"
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> (known after apply)
        # (1 unchanged attribute hidden)
    }

  # module.state_bucket_github_control.random_pet.suffix will be created
  + resource "random_pet" "suffix" {
      + id        = (known after apply)
      + length    = 2
      + prefix    = "infrahouse-github-control-state"
      + separator = "-"
    }

  # module.ih_tf_github_control.module.state-manager.data.aws_iam_policy_document.permissions_rw will be read during apply
  # (config refers to values not yet known)
 <= data "aws_iam_policy_document" "permissions_rw" {
      + id            = (known after apply)
      + json          = (known after apply)
      + minified_json = (known after apply)

      + statement {
          + actions   = [
              + "s3:DeleteObject",
              + "s3:PutObject",
            ]
          + resources = [
              + "arn:aws:s3:::infrahouse-github-control-state/*.zip",
              + "arn:aws:s3:::infrahouse-github-control-state/plans/*",
              + "arn:aws:s3:::infrahouse-github-control-state/terraform.tfstate",
            ]
        }
      + statement {
          + actions   = [
              + "dynamodb:DeleteItem",
              + "dynamodb:DescribeTable",
              + "dynamodb:GetItem",
              + "dynamodb:PutItem",
            ]
          + resources = [
              + (known after apply),
            ]
        }
    }

  # module.ih_tf_github_control.module.state-manager.aws_iam_policy.permissions_ro will be created
  + resource "aws_iam_policy" "permissions_ro" {
      + arn              = (known after apply)
      + attachment_count = (known after apply)
      + id               = (known after apply)
      + name             = (known after apply)
      + name_prefix      = "ih-tf-github-control-state-manager-ro"
      + path             = "/"
      + policy           = jsonencode(
            {
              + Statement = [
                  + {
                      + Action   = "s3:ListBucket"
                      + Effect   = "Allow"
                      + Resource = "arn:aws:s3:::infrahouse-github-control-state"
                    },
                  + {
                      + Action   = "s3:GetObject"
                      + Effect   = "Allow"
                      + Resource = [
                          + "arn:aws:s3:::infrahouse-github-control-state/terraform.tfstate",
                          + "arn:aws:s3:::infrahouse-github-control-state/plans/*",
                          + "arn:aws:s3:::infrahouse-github-control-state/*.zip",
                        ]
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + policy_id        = (known after apply)
      + tags             = {
          + "created_by_module" = "infrahouse/state-manager/aws"
        }
      + tags_all         = {
          + "created_by"        = "infrahouse/aws-control"
          + "created_by_module" = "infrahouse/state-manager/aws"
          + "environment"       = "production"
        }
    }

  # module.ih_tf_github_control.module.state-manager.aws_iam_policy.permissions_rw will be created
  + resource "aws_iam_policy" "permissions_rw" {
      + arn              = (known after apply)
      + attachment_count = (known after apply)
      + id               = (known after apply)
      + name             = (known after apply)
      + name_prefix      = "ih-tf-github-control-state-manager-rw"
      + path             = "/"
      + policy           = (known after apply)
      + policy_id        = (known after apply)
      + tags             = {
          + "created_by_module" = "infrahouse/state-manager/aws"
        }
      + tags_all         = {
          + "created_by"        = "infrahouse/aws-control"
          + "created_by_module" = "infrahouse/state-manager/aws"
          + "environment"       = "production"
        }
    }

  # module.ih_tf_github_control.module.state-manager.aws_iam_role.state-manager will be updated in-place
  ~ resource "aws_iam_role" "state-manager" {
        id                    = "ih-tf-github-control-state-manager"
        name                  = "ih-tf-github-control-state-manager"
      ~ tags                  = {
          - "created_by"        = "infrahouse8/github-control" -> null
            "created_by_module" = "infrahouse/state-manager/aws"
            "module_version"    = "1.4.2"
        }
      ~ tags_all              = {
          ~ "created_by"        = "infrahouse8/github-control" -> "infrahouse/aws-control"
          + "environment"       = "production"
            # (2 unchanged elements hidden)
        }
        # (11 unchanged attributes hidden)
    }

  # module.ih_tf_github_control.module.state-manager.aws_iam_role_policy_attachment.state-manager-ro will be created
  + resource "aws_iam_role_policy_attachment" "state-manager-ro" {
      + id         = (known after apply)
      + policy_arn = (known after apply)
      + role       = "ih-tf-github-control-state-manager"
    }

  # module.ih_tf_github_control.module.state-manager.aws_iam_role_policy_attachment.state-manager-rw[0] will be created
  + resource "aws_iam_role_policy_attachment" "state-manager-rw" {
      + id         = (known after apply)
      + policy_arn = (known after apply)
      + role       = "ih-tf-github-control-state-manager"
    }

Plan: 14 to add, 5 to change, 0 to destroy.

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: tf.plan

To perform exactly these actions, run the following command to apply:
    terraform apply "tf.plan"
metadata
eyJzMzovL2luZnJhaG91c2UtYXdzLWNvbnRyb2wtOTkwNDY2NzQ4MDQ1L3RlcnJhZm9ybS50ZnN0YXRlIjogeyJzdWNjZXNzIjogdHJ1ZSwgImFkZCI6IDE0LCAiY2hhbmdlIjogNSwgImRlc3Ryb3kiOiAwfX0=

@akuzminsky akuzminsky merged commit eb889f1 into main Feb 20, 2026
2 checks passed
@akuzminsky akuzminsky deleted the onboard-github-control branch February 20, 2026 16:19
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.

2 participants