Skip to content

Comments

Onboard infrahouse-website-infra CI/CD with gha-admin v3.6.1#85

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

Onboard infrahouse-website-infra CI/CD with gha-admin v3.6.1#85
akuzminsky merged 1 commit intomainfrom
onboard-infrahouse_website_infra

Conversation

@akuzminsky
Copy link
Member

@akuzminsky akuzminsky commented Feb 20, 2026

Summary

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

Migration plan

See .claude/plans/migrate-infrahouse-website-infra-gha-admin.md for full step-by-step instructions including import commands and child repo cleanup.

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 493370826424
  • Update infrahouse-website-infra backend config (new DynamoDB table)
  • Clean up aws-control-493370826424 and aws-control-289256138624

🤖 Generated with Claude Code

Migrate infrahouse-website-infra CI/CD from child repos
(aws-control-493370826424 gha-admin v1.0 + aws-control-289256138624
state-manager) to centralized gha-admin v3.6.1 in aws-control.
Creates state-bucket, gha-admin, and ci-cd-params modules with roles
in 493370826424 and state management in 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_infrahouse_website_infra.aws_ssm_parameter.admin_role_arn
🟢 module.ci_cd_params_infrahouse_website_infra.aws_ssm_parameter.github_role_arn
🟢 module.ci_cd_params_infrahouse_website_infra.aws_ssm_parameter.lock_table
🟢 module.ci_cd_params_infrahouse_website_infra.aws_ssm_parameter.state_bucket
🟢 module.ci_cd_params_infrahouse_website_infra.aws_ssm_parameter.state_manager_role_arn
🟢 module.ih_tf_infrahouse_website_infra.aws_iam_policy.github
🟢 module.ih_tf_infrahouse_website_infra.aws_iam_role_policy_attachment.admin
🟢 module.ih_tf_infrahouse_website_infra.aws_iam_role_policy_attachment.github
🟢 module.state_bucket_infrahouse_website_infra.aws_dynamodb_table.terraform_locks
🟢 module.state_bucket_infrahouse_website_infra.random_pet.suffix
🟢 module.ih_tf_infrahouse_website_infra.module.state-manager.aws_iam_policy.permissions_ro
🟢 module.ih_tf_infrahouse_website_infra.module.state-manager.aws_iam_policy.permissions_rw
🟢 module.ih_tf_infrahouse_website_infra.module.state-manager.aws_iam_role_policy_attachment.state-manager-ro
🟢 module.ih_tf_infrahouse_website_infra.module.state-manager.aws_iam_role_policy_attachment.state-manager-rw[0]
🟡 module.ih_tf_infrahouse_website_infra.aws_iam_role.admin
🟡 module.ih_tf_infrahouse_website_infra.aws_iam_role.github
🟡 module.state_bucket_infrahouse_website_infra.aws_s3_bucket.state-bucket
🟡 module.state_bucket_infrahouse_website_infra.aws_s3_bucket_policy.state-bucke
🟡 module.ih_tf_infrahouse_website_infra.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_infrahouse_website_infra.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/infrahouse-website-infra/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_infrahouse_website_infra.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/infrahouse-website-infra/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_infrahouse_website_infra.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/infrahouse-website-infra/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_infrahouse_website_infra.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/infrahouse-website-infra/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_infrahouse_website_infra.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/infrahouse-website-infra/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_infrahouse_website_infra.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::493370826424:role/ih-tf-infrahouse-website-infra-github",
                  + "arn:aws:iam::990466748045:role/aws-reserved/sso.amazonaws.com/us-west-1/AWSReservedSSO_AWSAdministratorAccess_16bdbe5eb442e7ef",
                ]
              + type        = "AWS"
            }
        }
    }

  # module.ih_tf_infrahouse_website_infra.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-infrahouse-website-infra-state-manager",
              + "arn:aws:iam::493370826424:role/ih-tf-infrahouse-website-infra-admin",
            ]
        }
    }

  # module.ih_tf_infrahouse_website_infra.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-infrahouse-website-infra-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_infrahouse_website_infra.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::493370826424:role/ih-tf-infrahouse-website-infra-github"
                        }
                      - Sid       = "000"
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> (known after apply)
        id                    = "ih-tf-infrahouse-website-infra-admin"
      ~ max_session_duration  = 3600 -> 43200
        name                  = "ih-tf-infrahouse-website-infra-admin"
      ~ tags                  = {
          - "created_by"        = "infrahouse/aws-control-493370826424" -> null
          + "created_by_module" = "infrahouse/gha-admin/aws"
          + "module_version"    = "3.6.1"
        }
      ~ tags_all              = {
          ~ "created_by"        = "infrahouse/aws-control-493370826424" -> "infrahouse/aws-control"
          + "created_by_module" = "infrahouse/gha-admin/aws"
          + "module_version"    = "3.6.1"
            # (1 unchanged element hidden)
        }
        # (9 unchanged attributes hidden)
    }

  # module.ih_tf_infrahouse_website_infra.aws_iam_role.github will be updated in-place
  ~ resource "aws_iam_role" "github" {
      ~ assume_role_policy    = jsonencode(
          ~ {
              ~ Statement = [
                  ~ {
                      - Sid       = "010"
                        # (4 unchanged attributes hidden)
                    },
                ]
                # (1 unchanged attribute hidden)
            }
        )
        id                    = "ih-tf-infrahouse-website-infra-github"
      ~ max_session_duration  = 3600 -> 43200
        name                  = "ih-tf-infrahouse-website-infra-github"
      ~ tags                  = {
          - "created_by"        = "infrahouse/aws-control-493370826424" -> null
          + "created_by_module" = "infrahouse/gha-admin/aws"
        }
      ~ tags_all              = {
          ~ "created_by"        = "infrahouse/aws-control-493370826424" -> "infrahouse/aws-control"
          + "created_by_module" = "infrahouse/gha-admin/aws"
            # (1 unchanged element hidden)
        }
        # (9 unchanged attributes hidden)
    }

  # module.ih_tf_infrahouse_website_infra.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-infrahouse-website-infra-admin"
    }

  # module.ih_tf_infrahouse_website_infra.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-infrahouse-website-infra-github"
    }

  # module.state_bucket_infrahouse_website_infra.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-website-infra",
              + "arn:aws:s3:::infrahouse-website-infra/*",
            ]
          + sid       = "AllowSSLRequestsOnly"

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

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

  # module.state_bucket_infrahouse_website_infra.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-website-infra"
        }
      + 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-website-infra"
        }
      + 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_infrahouse_website_infra.aws_s3_bucket.state-bucket will be updated in-place
  ~ resource "aws_s3_bucket" "state-bucket" {
      + force_destroy               = false
        id                          = "infrahouse-website-infra"
      ~ tags                        = {
          - "created_by"        = "infrahouse/aws-control-289256138624"
          - "created_by_module" = "infrahouse/state-bucket/aws"
          - "description"       = "Terraform state for https://github.com/infrahouse/infrahouse-website-infra"
          - "lock_table"        = "infrahouse-website-infra-well-pony"
          - "module_version"    = "2.2.0"
          - "repo"              = "infrahouse/infrahouse-website-infra"
        } -> (known after apply)
      ~ tags_all                    = {
          - "created_by"        = "infrahouse/aws-control-289256138624"
          - "created_by_module" = "infrahouse/state-bucket/aws"
          - "description"       = "Terraform state for https://github.com/infrahouse/infrahouse-website-infra"
          - "lock_table"        = "infrahouse-website-infra-well-pony"
          - "module_version"    = "2.2.0"
          - "repo"              = "infrahouse/infrahouse-website-infra"
        } -> (known after apply)
        # (11 unchanged attributes hidden)

        # (3 unchanged blocks hidden)
    }

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

  # module.state_bucket_infrahouse_website_infra.random_pet.suffix will be created
  + resource "random_pet" "suffix" {
      + id        = (known after apply)
      + length    = 2
      + prefix    = "infrahouse-website-infra"
      + separator = "-"
    }

  # module.ih_tf_infrahouse_website_infra.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-website-infra/*.zip",
              + "arn:aws:s3:::infrahouse-website-infra/plans/*",
              + "arn:aws:s3:::infrahouse-website-infra/terraform.tfstate",
            ]
        }
      + statement {
          + actions   = [
              + "dynamodb:DeleteItem",
              + "dynamodb:DescribeTable",
              + "dynamodb:GetItem",
              + "dynamodb:PutItem",
            ]
          + resources = [
              + (known after apply),
            ]
        }
    }

  # module.ih_tf_infrahouse_website_infra.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-infrahouse-website-infra-state-manager-ro"
      + path             = "/"
      + policy           = jsonencode(
            {
              + Statement = [
                  + {
                      + Action   = "s3:ListBucket"
                      + Effect   = "Allow"
                      + Resource = "arn:aws:s3:::infrahouse-website-infra"
                    },
                  + {
                      + Action   = "s3:GetObject"
                      + Effect   = "Allow"
                      + Resource = [
                          + "arn:aws:s3:::infrahouse-website-infra/terraform.tfstate",
                          + "arn:aws:s3:::infrahouse-website-infra/plans/*",
                          + "arn:aws:s3:::infrahouse-website-infra/*.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_infrahouse_website_infra.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-infrahouse-website-infra-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_infrahouse_website_infra.module.state-manager.aws_iam_role.state-manager will be updated in-place
  ~ resource "aws_iam_role" "state-manager" {
        id                    = "ih-tf-infrahouse-website-infra-state-manager"
        name                  = "ih-tf-infrahouse-website-infra-state-manager"
      ~ tags                  = {
          - "created_by"        = "infrahouse/aws-control-289256138624" -> null
            "created_by_module" = "infrahouse/state-manager/aws"
            "module_version"    = "1.4.2"
        }
      ~ tags_all              = {
          ~ "created_by"        = "infrahouse/aws-control-289256138624" -> "infrahouse/aws-control"
          + "environment"       = "production"
            # (2 unchanged elements hidden)
        }
        # (11 unchanged attributes hidden)
    }

  # module.ih_tf_infrahouse_website_infra.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-infrahouse-website-infra-state-manager"
    }

  # module.ih_tf_infrahouse_website_infra.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-infrahouse-website-infra-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 d42ea00 into main Feb 20, 2026
2 checks passed
@akuzminsky akuzminsky deleted the onboard-infrahouse_website_infra branch February 20, 2026 19:29
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