Adding automated TF deployment to CI account #6
Workflow file for this run
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: ScouteSuite | |
on: | |
pull_request: | |
branches: | |
["main"] | |
push: | |
branches: | |
["main"] | |
jobs: | |
Terraform: | |
strategy: | |
matrix: { dir: ["samples/simple-build-pipeline"] } | |
environment: aws-ci | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: us-east-1 | |
## the following creates an ARN based on the values entered into github secrets | |
role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} | |
role-session-name: CGDToolkitGitHubActions | |
- name: Terraform fmt | |
id: fmt | |
working-directory: ${{ matrix.dir }} | |
run: terraform fmt -check | |
continue-on-error: true | |
- name: Terraform Init | |
id: init | |
working-directory: ${{ matrix.dir }} | |
run: terraform init | |
- name: Terraform Validate | |
id: validate | |
working-directory: ${{ matrix.dir }} | |
run: terraform validate -no-color | |
- name: Terraform Plan | |
id: plan | |
working-directory: ${{ matrix.dir }} | |
run: terraform plan -no-color |