-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade Terraform to 0.13 and introduce Travis CI with some simple tests
- Loading branch information
Showing
10 changed files
with
41 additions
and
5 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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/.terraform/ | ||
/temp/ | ||
/tests/*.plan |
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,12 +1,12 @@ | ||
repos: | ||
- repo: git://github.com/antonbabenko/pre-commit-terraform | ||
rev: v1.31.0 | ||
rev: v1.32.0 | ||
hooks: | ||
- id: terraform_tflint | ||
- id: terraform_fmt | ||
- id: terraform_validate | ||
- id: terraform_docs | ||
- repo: git://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.5.0 | ||
rev: v3.2.0 | ||
hooks: | ||
- id: check-merge-conflict |
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 @@ | ||
0.12.29 | ||
0.13.0 |
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,18 @@ | ||
script: | ||
- git clone https://github.com/tfutils/tfenv.git ~/.tfenv | ||
- sudo ln -s ~/.tfenv/bin/* /usr/local/bin | ||
- tfenv install | ||
- terraform init | ||
|
||
# Test the variable values are tested and passed to the plan appropriately. | ||
- terraform plan -var-file='tests/test.tfvars' -out='tests/test.plan' | ||
- if [[ ! "$(terraform show -json tests/test.plan | jq -cMSr .variables)" == '{"assume_role_arn":{"value":"arn:aws:iam::000000000000:root"},"aws_cli_commands":{"value":["version"]},"aws_cli_query":{"value":""},"role_session_name":{"value":"terraform-aws-cli"}}' ]]; then | ||
echo 'Failed to incorporate expected variable values into plan.'; | ||
exit -1; | ||
fi | ||
|
||
# Test an invalid ARN reports appropriately. | ||
- if [[ ! "$(terraform plan -var-file='tests/bad_arn.tfvars' -no-color 2>&1)" == *'variable "assume_role_arn"'* ]]; then | ||
echo 'Failed to detect invalid ARN.'; | ||
exit -1; | ||
fi |
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
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
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,2 @@ | ||
assume_role_arn = "bad_arn" | ||
aws_cli_commands = ["version"] |
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,2 @@ | ||
assume_role_arn = "arn:aws:iam::000000000000:root" | ||
aws_cli_commands = ["version"] |
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
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