This is a demo code for the post: AWS in GitHub Actions: authenticate with IAM roles and forget about Access Keys.
The code can be used as a reference. If you fork this repository and want to make it work, please follow these steps:
- Adjust a repository name and other variables in variables.tf
- Add policies you need to the assumable IAM role in iam.tf
- Apply Terraform:
cd terraform
terraform apply
- Put an IAM role ARN from Terraform Outputs to verify-iam-role.yml workflow