Skip to content

chore(iam): remove chart updater AWS role - #30

Merged
xnoto merged 1 commit into
mainfrom
fix/remove-chart-updater-role
Aug 28, 2026
Merged

chore(iam): remove chart updater AWS role#30
xnoto merged 1 commit into
mainfrom
fix/remove-chart-updater-role

Conversation

@xnoto

@xnoto xnoto commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • remove the chart updater GitHub Actions OIDC role
  • remove its inline Secrets Manager read policy
  • update generated resource documentation

Validation

  • repository pre-commit hooks passed after removing a stale local .terraform cache
  • Terraform validate, tflint, Checkov, fmt, docs, and secret-detection hooks passed

Rollout dependency

Merge only after makeitworkcloud/tfroot-github#42 has applied and makeitworkcloud/charts#13 is merged. This ensures the updater no longer references the role before Terraform destroys it.

The manually created Secrets Manager secret is intentionally not deleted by this PR.

@xnoto
xnoto requested a review from a team as a code owner August 28, 2026 16:23
@github-actions

Copy link
Copy Markdown
Contributor

OpenTofu CI passed

View the workflow run.

Validation output (redacted, last 12000 characters)

Terraform validate.......................................................Passed
Terraform validate with tflint...........................................Passed
Checkov..................................................................Passed
Terraform fmt............................................................Passed
Terraform docs...........................................................Passed
Detect hardcoded secrets.................................................Passed
check for case conflicts.................................................Passed
check for merge conflicts................................................Passed
check for broken symlinks............................(no files to check)Skipped
check vcs permalinks.....................................................Passed
detect destroyed symlinks................................................Passed
detect private key.......................................................Passed
fix end of files.........................................................Passed
mixed line ending........................................................Passed
trim trailing whitespace.................................................Passed
don't commit to branch..................................................Skipped
check for added large files..............................................Passed

@github-actions

Copy link
Copy Markdown
Contributor

OpenTofu Plan

OpenTofu will perform the following actions:

  # aws_iam_role.github_actions_chart_updater will be destroyed
  # (because aws_iam_role.github_actions_chart_updater is not in configuration)
  - resource "aws_iam_role" "github_actions_chart_updater" {
      - arn                   = "arn:aws:iam::332355796717:role/github-actions-chart-updater" -> null
      - assume_role_policy    = jsonencode(
            {
              - Statement = [
                  - {
                      - Action    = "sts:AssumeRoleWithWebIdentity"
                      - Condition = {
                          - StringEquals = {
[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
                            }
                        }
                      - Effect    = "Allow"
                      - Principal = {
[REDACTED: potentially sensitive plan output]
                        }
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - create_date           = "2026-08-28T02:41:01Z" -> null
      - force_detach_policies = false -> null
      - id                    = "github-actions-chart-updater" -> null
      - managed_policy_arns   = [] -> null
      - max_session_duration  = 3600 -> null
      - name                  = "github-actions-chart-updater" -> null
      - path                  = "/" -> null
      - tags                  = {
          - "ManagedBy" = "Terraform"
          - "Purpose"   = "chart-gitops-updater"
        } -> null
      - tags_all              = {
          - "ManagedBy" = "Terraform"
          - "Purpose"   = "chart-gitops-updater"
        } -> null
      - unique_id             = "AROAU2YPS73WYRJD7EOL7" -> null

      - inline_policy {
          - name   = "read-chart-updater-github-app-key" -> null
          - policy = jsonencode(
                {
                  - Statement = [
                      - {
                          - Action   = [
[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
                            ]
                          - Effect   = "Allow"
[REDACTED: potentially sensitive plan output]
                          - Sid      = "ReadChartUpdaterGitHubAppKey"
                        },
                    ]
                  - Version   = "2012-10-17"
                }
            ) -> null
        }
    }

  # aws_iam_role_policy.github_actions_chart_updater will be destroyed
  # (because aws_iam_role_policy.github_actions_chart_updater is not in configuration)
  - resource "aws_iam_role_policy" "github_actions_chart_updater" {
      - id     = "github-actions-chart-updater:read-chart-updater-github-app-key" -> null
      - name   = "read-chart-updater-github-app-key" -> null
      - policy = jsonencode(
            {
              - Statement = [
                  - {
                      - Action   = [
[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
                        ]
                      - Effect   = "Allow"
[REDACTED: potentially sensitive plan output]
                      - Sid      = "ReadChartUpdaterGitHubAppKey"
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - role   = "github-actions-chart-updater" -> null
    }

Plan: 0 to add, 0 to change, 2 to destroy.
�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
OpenTofu used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  - destroy

OpenTofu will perform the following actions:

  # aws_iam_role.github_actions_chart_updater will be destroyed
  # (because aws_iam_role.github_actions_chart_updater is not in configuration)
  - resource "aws_iam_role" "github_actions_chart_updater" {
      - arn                   = "arn:aws:iam::332355796717:role/github-actions-chart-updater" -> null
      - assume_role_policy    = jsonencode(
            {
              - Statement = [
                  - {
                      - Action    = "sts:AssumeRoleWithWebIdentity"
                      - Condition = {
                          - StringEquals = {
[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
                            }
                        }
                      - Effect    = "Allow"
                      - Principal = {
[REDACTED: potentially sensitive plan output]
                        }
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - create_date           = "2026-08-28T02:41:01Z" -> null
      - force_detach_policies = false -> null
      - id                    = "github-actions-chart-updater" -> null
      - managed_policy_arns   = [] -> null
      - max_session_duration  = 3600 -> null
      - name                  = "github-actions-chart-updater" -> null
      - path                  = "/" -> null
      - tags                  = {
          - "ManagedBy" = "Terraform"
          - "Purpose"   = "chart-gitops-updater"
        } -> null
      - tags_all              = {
          - "ManagedBy" = "Terraform"
          - "Purpose"   = "chart-gitops-updater"
        } -> null
      - unique_id             = "AROAU2YPS73WYRJD7EOL7" -> null

      - inline_policy {
          - name   = "read-chart-updater-github-app-key" -> null
          - policy = jsonencode(
                {
                  - Statement = [
                      - {
                          - Action   = [
[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
                            ]
                          - Effect   = "Allow"
[REDACTED: potentially sensitive plan output]
                          - Sid      = "ReadChartUpdaterGitHubAppKey"
                        },
                    ]
                  - Version   = "2012-10-17"
                }
            ) -> null
        }
    }

  # aws_iam_role_policy.github_actions_chart_updater will be destroyed
  # (because aws_iam_role_policy.github_actions_chart_updater is not in configuration)
  - resource "aws_iam_role_policy" "github_actions_chart_updater" {
      - id     = "github-actions-chart-updater:read-chart-updater-github-app-key" -> null
      - name   = "read-chart-updater-github-app-key" -> null
      - policy = jsonencode(
            {
              - Statement = [
                  - {
                      - Action   = [
[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
                        ]
                      - Effect   = "Allow"
[REDACTED: potentially sensitive plan output]
                      - Sid      = "ReadChartUpdaterGitHubAppKey"
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - role   = "github-actions-chart-updater" -> null
    }

Plan: 0 to add, 0 to change, 2 to destroy.

@xnoto
xnoto merged commit 2992bd2 into main Aug 28, 2026
4 checks passed
@xnoto
xnoto deleted the fix/remove-chart-updater-role branch August 28, 2026 16:36
xnoto added a commit that referenced this pull request Aug 30, 2026
## Summary

- remove the `github-actions-opentofu-docs` IAM role and its inline
Secrets Manager read policy

## Context

The shared OpenTofu workflow's generated-docs commit path no longer uses
AWS: makeitworkcloud/shared-workflows#33 sources the chart updater
GitHub App key from the caller-mapped
`CHART_UPDATER_GITHUB_APP_PRIVATE_KEY` Actions secret, provisioned by
makeitworkcloud/tfroot-github#45. After those land, nothing references
this role or the legacy Secrets Manager copy, matching
`tfroot-github/docs/chart-updater-github-app.md`.

This mirrors #30, which removed the charts-facing role. The manually
created Secrets Manager secret
(`xnoto-s-chart-updater-github-app-private-key-*`) is intentionally not
deleted here; per the runbook its deletion is a separate approved
cleanup after the agreed rollback window.

## Rollout dependency

Draft until all of the following have merged and applied:

1. makeitworkcloud/shared-workflows#33
2. makeitworkcloud/tfroot-github#45
3. Caller PRs: #31, tfroot-cloudflare#37,
tfroot-gcp#5, tfroot-github#46, tfroot-libvirt#26

Destroying this role before then breaks generated-docs commits on
same-repository PRs.

## Validation

- GitHub Actions OpenTofu test and plan are required before merge; the
plan must show only the role and policy destruction.
- Reviewed the diff: file deletion only; no credentials or decrypted
values included.

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

1 participant