apply-terraform-identity.sh
Applies the Terraform identity stack for GitHub OIDC and IAM roles.
Purpose
Runs a guided Terraform workflow for infra/identity so you do not need to manually change directories or remember command order.
What It Does
- Validates prerequisites:
terraformCLIawsCLI- Valid AWS credentials (
aws sts get-caller-identity) - Runs Terraform in
infra/identity: terraform init(with locked provider versions)terraform validateterraform plan- Prompts for confirmation before apply
- Runs
terraform apply - Prints identity outputs (OIDC provider and role ARNs)
Usage
./scripts/apply-terraform-identity.sh
Notes
- Safe to run repeatedly; Terraform handles drift and idempotency.
- If you answer
nat the prompt, no changes are applied. - This script targets the shared identity stack in
infra/identity. - Provider versions are pinned via
.terraform.lock.hcl. To upgrade providers intentionally, useterraform init -upgradelocally and commit lock file changes via PR.