generated from hackforla/.github-hackforla-base-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 14
50 lines (40 loc) · 1.09 KB
/
terraform-plan-with-oidc.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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