-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Mario-Valente/TESTE-002
ci: 💚 Add workflow of PR validation
- Loading branch information
Showing
4 changed files
with
69 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: pr validation terraform | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
env: | ||
AWS_ACCESS_KEY_ID: "${{secrets.AWS_ACCESS_KEY_ID}}" | ||
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}" | ||
AWS_REGION: "${{ secrets.AWS_REGION }}" | ||
|
||
concurrency: | ||
group: ${{github.workflow}} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
terraform-plan: | ||
runs-on: ${{matrix.os}} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
terraform: [0.14.8] | ||
|
||
steps: | ||
- name: checkout 🛎 | ||
uses: actions/checkout@master | ||
|
||
|
||
- name: Aws credentions | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ env.AWS_REGION }} | ||
|
||
- name: Setup Terrafom | ||
uses: hashicorp/[email protected] | ||
with: | ||
terraform_version: ${{ matrix.terraform }} | ||
|
||
- name: Terraform Init | ||
id: tf_init | ||
run: terraform init | ||
|
||
- name: Terraform Validade | ||
id: tf_validate | ||
run: terraform validate -no-color | ||
|
||
- name: terraform plan | ||
id: tf-plan | ||
run: terraform plan -out=plan.out -input=false -lock=false | ||
continue-on-error: true | ||
|
||
- name: terraform show plan | ||
id: tf_show | ||
run: terraform show -no-color plan.out | ||
continue-on-error: true | ||
|
||
|
||
- name: Terraform Plan Status | ||
if: steps.tf_plan.outcome == 'failure' | ||
run: exit 1 |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ terraform { | |
|
||
} | ||
|
||
|
||
provider "aws" { | ||
region = "us-east-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
variable "aws_iam_user"{} | ||
variable "aws_iam_user"{ | ||
type = string | ||
default = "teste_iam" | ||
} |