feat: bootstrap infrastructure #1
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: Infrastructure | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
env: | |
AWS_REGION: eu-west-3 | |
# Permission can be added at job level or workflow level | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
contents: read # This is required for actions/checkout | |
jobs: | |
terraform-10-boostrap-plan: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: infrastructure/10_bootstrap | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: arn:aws:iam::448878779811:role/twitch-live-1710204-my-web-site | |
role-session-name: github-ipppontech-my-web-site-to-aws-via-oidc | |
aws-region: ${{ env.AWS_REGION }} | |
- uses: hashicorp/setup-terraform@v3 | |
with: | |
terraform_version: "1.9.7" | |
terraform_wrapper: false | |
- run: terraform fmt -check -recursive | |
- run: terraform init -backend=false | |
- run: terraform validate | |
- run: terraform init | |
- run: terraform plan -out=tfplan.out | |
- run: terraform apply -input=false tfplan.out |