From 027bea83c1d8431fe873a58f7040e68d89221889 Mon Sep 17 00:00:00 2001 From: yadavprakash Date: Thu, 8 Jul 2021 17:08:49 +0530 Subject: [PATCH 1/3] fix terratest --- .github/workflows/readme.yml | 6 +++--- .github/workflows/terraform.yml | 38 +++++++++++++++++++++++++++------ _example/.terraform.lock.hcl | 21 ------------------ _test/vpcpeering_test.go | 2 +- 4 files changed, 35 insertions(+), 32 deletions(-) delete mode 100644 _example/.terraform.lock.hcl diff --git a/.github/workflows/readme.yml b/.github/workflows/readme.yml index 3edbae3..8f58374 100644 --- a/.github/workflows/readme.yml +++ b/.github/workflows/readme.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: 'Checkout' - uses: actions/checkout@master + uses: actions/checkout@v2.3.4 - name: Set up Python 3.7. uses: actions/setup-python@v2 @@ -18,7 +18,7 @@ jobs: python-version: '3.x' - name: 'create readme' - uses: 'clouddrove/github-actions@v7.0' + uses: 'clouddrove/github-actions@v8.0' with: actions_subcommand: 'readme' github_token: '${{ secrets.GITHUB}}' @@ -35,7 +35,7 @@ jobs: continue-on-error: true - name: 'push readme' - uses: 'clouddrove/github-actions@v7.0' + uses: 'clouddrove/github-actions@v8.0' continue-on-error: true with: actions_subcommand: 'push' diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index 1eb33e5..71a4da5 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -13,11 +13,7 @@ jobs: uses: actions/checkout@v2.3.4 - name: 'Terraform Format' - uses: 'clouddrove/github-actions@v7.0' - with: - actions_subcommand: 'fmt' - - name: 'Terraform Format' - uses: 'clouddrove/github-actions@v7.0' + uses: 'clouddrove/github-actions@v8.0' with: actions_subcommand: 'fmt' @@ -36,22 +32,50 @@ jobs: aws-region: us-east-2 - name: 'Terraform init' - uses: 'clouddrove/github-actions@v7.0' + uses: 'clouddrove/github-actions@v8.0' with: actions_subcommand: 'init' tf_actions_working_dir: ./_example - name: 'Terraform validate' - uses: 'clouddrove/github-actions@v7.0' + uses: 'clouddrove/github-actions@v8.0' with: actions_subcommand: 'validate' tf_actions_working_dir: ./_example + plan: + name: 'terraform plan' + runs-on: ubuntu-latest + steps: + - name: 'Checkout' + uses: actions/checkout@v2.3.4 + + - name: 'Terraform init' + uses: 'clouddrove/github-actions@v8.0' + with: + actions_subcommand: 'init' + tf_actions_working_dir: ./_example + + - name: 'Configure AWS Credentials' + uses: clouddrove/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.TEST_AWS_ACCESS_KEY }} + aws-secret-access-key: ${{ secrets.TEST_AWS_ACCESS_SECRET_KEY }} + aws-region: us-east-2 + + - name: 'Terraform plan' + uses: 'clouddrove/github-actions@v8.0' + with: + actions_subcommand: 'plan' + tf_actions_working_dir: ./_example + pre-commit: name: 'Pre-Commit' needs: - fmt + - plan - validate + runs-on: ubuntu-latest steps: - name: 'Checkout' diff --git a/_example/.terraform.lock.hcl b/_example/.terraform.lock.hcl deleted file mode 100644 index ec687b4..0000000 --- a/_example/.terraform.lock.hcl +++ /dev/null @@ -1,21 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/aws" { - version = "3.45.0" - constraints = ">= 1.25.0, >= 3.1.15" - hashes = [ - "h1:LKU/xfna87/p+hl5yTTW3dvOqWJp5JEM+Dt3nnvSDvA=", - "zh:0fdbb3af75ff55807466533f97eb314556ec41a908a543d7cafb06546930f7c6", - "zh:20656895744fa0f4607096b9681c77b2385f450b1577f9151d3070818378a724", - "zh:390f316d00f25a5e45ef5410961fd05bf673068c1b701dc752d11df6d8e741d7", - "zh:3da70f9de241d5f66ea9994ef1e0beddfdb005fa2d2ef6712392f57c5d2e4844", - "zh:65de63cc0f97c85c28a19db560c546aa25f4f403dbf4783ac53c3918044cf180", - "zh:6fc52072e5a66a5d0510aaa2b373a2697895f51398613c68619d8c0c95fc75f5", - "zh:7c1da61092bd1206a020e3ee340ab11be8a4f9bb74e925ca1229ea5267fb3a62", - "zh:94e533d86ce3c08e7102dcabe34ba32ae7fd7819fd0aedef28f48d29e635eae2", - "zh:a3180d4826662e19e71cf20e925a2be8613a51f2f3f7b6d2643ac1418b976d58", - "zh:c783df364928c77fd4dec5419533b125bebe2d50212c4ad609f83b701c2d981a", - "zh:e1279bde388cb675d324584d965c6d22c3ec6890b13de76a50910a3bcd84ed64", - ] -} diff --git a/_test/vpcpeering_test.go b/_test/vpcpeering_test.go index deb0755..fa2b545 100644 --- a/_test/vpcpeering_test.go +++ b/_test/vpcpeering_test.go @@ -30,6 +30,6 @@ func Test(t *testing.T) { Tags := terraform.OutputMap(t, terraformOptions, "tags") // Check that we get back the outputs that we expect - assert.Equal(t, "test-vpc-peering-clouddrove", Tags["Name"]) + assert.Equal(t, "test-vpc-peering", Tags["Name"]) assert.Contains(t, Status, "pending-acceptance") } From 00617d66a3a3770759129256c17eb4b743900870 Mon Sep 17 00:00:00 2001 From: yadavprakash Date: Thu, 8 Jul 2021 17:10:58 +0530 Subject: [PATCH 2/3] fix terratest --- .github/workflows/terraform.yml | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index 71a4da5..acfc06d 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -43,38 +43,12 @@ jobs: actions_subcommand: 'validate' tf_actions_working_dir: ./_example - plan: - name: 'terraform plan' - runs-on: ubuntu-latest - steps: - - name: 'Checkout' - uses: actions/checkout@v2.3.4 - - - name: 'Terraform init' - uses: 'clouddrove/github-actions@v8.0' - with: - actions_subcommand: 'init' - tf_actions_working_dir: ./_example - - - name: 'Configure AWS Credentials' - uses: clouddrove/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.TEST_AWS_ACCESS_KEY }} - aws-secret-access-key: ${{ secrets.TEST_AWS_ACCESS_SECRET_KEY }} - aws-region: us-east-2 - - - name: 'Terraform plan' - uses: 'clouddrove/github-actions@v8.0' - with: - actions_subcommand: 'plan' - tf_actions_working_dir: ./_example pre-commit: name: 'Pre-Commit' needs: - fmt - plan - - validate runs-on: ubuntu-latest steps: From 0ed7229a525f9710e447fc4d99d7e8409aa0d3a2 Mon Sep 17 00:00:00 2001 From: yadavprakash Date: Thu, 8 Jul 2021 17:11:45 +0530 Subject: [PATCH 3/3] fix terratest --- .github/workflows/terraform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index acfc06d..0af8e1e 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -48,7 +48,7 @@ jobs: name: 'Pre-Commit' needs: - fmt - - plan + - validate runs-on: ubuntu-latest steps: