OIDC + a deploy action
The AWS deploy pattern is OIDC for auth, then one of:
- ECS rolling deploy —
aws-actions/amazon-ecs-deploy-task-definition - EKS via kubectl —
aws-actions/configure-aws-credentials+aws eks update-kubeconfig+kubectl apply. - Lambda —
aws-actions/aws-lambda-deployoraws lambda update-function-code. - S3 / CloudFront static —
aws s3 sync+aws cloudfront create-invalidation. - App Runner —
aws-actions/amazon-app-runner-deploy.
One-time setup on AWS side
- IAM Identity Provider for
token.actions.githubusercontent.com. - IAM Role with trust policy keyed on
repo:my-org/my-repo:ref:refs/heads/main. - Role's permissions policy allows the specific deploy action (e.g.,
ecs:UpdateServiceon the specific service ARN).
Once set up, every workflow run gets fresh, scoped, ~1-hour credentials. No static keys.