Skip to content

Session 6 Goal 1 | Update ecs module source #9

Session 6 Goal 1 | Update ecs module source

Session 6 Goal 1 | Update ecs module source #9

Workflow file for this run

name: Deploy Infra
on: push
env:
AWS_REGION: ap-south-1
IAM_ROLE: arn:aws:iam::160071257600:role/tw-krish-iac-lab-github-actions-role
VAR_FILE: dev.tfvars
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-session-name: GitHubActionsSession
role-to-assume: ${{ env.IAM_ROLE }}
aws-region: ${{ env.AWS_REGION }}
- name: Get aws identity
run: |
aws sts get-caller-identity
- name: Install Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.9.5
- name: Terraform Init
run: terraform init
- name: Terraform Plan
run: terraform plan -var-file=${{ env.VAR_FILE }}
- name: Terraform Apply
run: terraform apply -var-file=${{ env.VAR_FILE }} -auto-approve