Terraform deploy with OIDC #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Terraform deploy with OIDC | |
on: | |
workflow_dispatch: | |
inputs: | |
target-host-environment: | |
type: choice | |
description: The AWS environment to deploy (dev/test/prod) | |
options: | |
- dev | |
- test | |
- prod | |
env: | |
AWS_REGION : "us-west-2" | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
TerraformPlan: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone repo | |
uses: actions/checkout@v4 | |
- name: configure aws credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: arn:aws:iam::035866691871:role/gha-incubator | |
role-session-name: ghaincubatorsession | |
aws-region: ${{ env.AWS_REGION }} | |
# Hello from AWS: WhoAmI | |
- name: Sts GetCallerIdentity | |
run: | | |
aws sts get-caller-identity | |
- name: Setup terraform | |
uses: hashicorp/setup-terraform@v3 | |
- name: Run terraform | |
run: | | |
pushd ./terraform-incubator/home-unite-us/dev | |
terraform init | |
terraform plan | |
popd |