diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index 1e9e00a8..619edbb9 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -35,7 +35,7 @@ jobs: env: BASE_SHA: ${{ github.event.pull_request.base.sha }} run: | - JQ_OUTPUT_CHANGED=$(git diff --name-only $BASE_SHA $GITHUB_SHA modules/*/*/*.tf | + JQ_OUTPUT_CHANGED=$(git diff --name-only $BASE_SHA $GITHUB_SHA modules/**/*.tf | cut -d/ -f1-3 | sort -u | jq -MRsc 'split("\n")[:-1]') echo "changed_modules=$JQ_OUTPUT_CHANGED" >> $GITHUB_OUTPUT @@ -69,6 +69,17 @@ jobs: id: validate run: terraform validate + - name: Terraform Plan + id: plan + env: + "AWS_DEFAULT_REGION": "eu-west-2" + "AWS_ACCESS_KEY_ID": ${{ secrets.AWS_ACCESS_KEY_ID }} + "AWS_SECRET_ACCESS_KEY": ${{ secrets.AWS_SECRET_ACCESS_KEY }} + run: | + cd test + terraform init + terraform plan + - name: Terraform Security uses: aquasecurity/tfsec-action@v1.0.3 with: @@ -135,4 +146,3 @@ jobs: commit_author: "github-actions[bot] " file_pattern: .github/dependabot.yml skip_checkout: true - diff --git a/modules/aws/ec2/examples/README.md b/modules/aws/ec2/test/README.md similarity index 100% rename from modules/aws/ec2/examples/README.md rename to modules/aws/ec2/test/README.md diff --git a/modules/aws/ec2/examples/output.tf b/modules/aws/ec2/test/output.tf similarity index 100% rename from modules/aws/ec2/examples/output.tf rename to modules/aws/ec2/test/output.tf diff --git a/modules/aws/ec2/examples/example.tf b/modules/aws/ec2/test/test.tf similarity index 100% rename from modules/aws/ec2/examples/example.tf rename to modules/aws/ec2/test/test.tf diff --git a/modules/aws/rds_serverless_cluster/examples/README.md b/modules/aws/rds_serverless_cluster/test/README.md similarity index 100% rename from modules/aws/rds_serverless_cluster/examples/README.md rename to modules/aws/rds_serverless_cluster/test/README.md diff --git a/modules/aws/rds_serverless_cluster/examples/outputs.tf b/modules/aws/rds_serverless_cluster/test/outputs.tf similarity index 100% rename from modules/aws/rds_serverless_cluster/examples/outputs.tf rename to modules/aws/rds_serverless_cluster/test/outputs.tf diff --git a/modules/aws/rds_serverless_cluster/examples/example.tf b/modules/aws/rds_serverless_cluster/test/test.tf similarity index 100% rename from modules/aws/rds_serverless_cluster/examples/example.tf rename to modules/aws/rds_serverless_cluster/test/test.tf diff --git a/modules/aws/route53/example/README.md b/modules/aws/route53/test/README.md similarity index 100% rename from modules/aws/route53/example/README.md rename to modules/aws/route53/test/README.md diff --git a/modules/aws/route53/example/example.tf b/modules/aws/route53/test/test.tf similarity index 99% rename from modules/aws/route53/example/example.tf rename to modules/aws/route53/test/test.tf index 3cbfd20c..59b3cdc3 100644 --- a/modules/aws/route53/example/example.tf +++ b/modules/aws/route53/test/test.tf @@ -5,7 +5,6 @@ module "example_com" { aliases = [ "example.org" ] - alias_records = { "example.org" = { foo = { @@ -27,5 +26,4 @@ module "example_com" { records = ["1.2.3.4"] } } - } diff --git a/modules/aws/state_manager/examples/README.md b/modules/aws/state_manager/test/README.md similarity index 100% rename from modules/aws/state_manager/examples/README.md rename to modules/aws/state_manager/test/README.md diff --git a/modules/aws/state_manager/examples/example-state-definition/README.md b/modules/aws/state_manager/test/example-state-definition/README.md similarity index 100% rename from modules/aws/state_manager/examples/example-state-definition/README.md rename to modules/aws/state_manager/test/example-state-definition/README.md diff --git a/modules/aws/state_manager/examples/example-state-definition/example.tf b/modules/aws/state_manager/test/example-state-definition/test.tf similarity index 100% rename from modules/aws/state_manager/examples/example-state-definition/example.tf rename to modules/aws/state_manager/test/example-state-definition/test.tf diff --git a/modules/aws/state_manager/examples/example.tf b/modules/aws/state_manager/test/test.tf similarity index 100% rename from modules/aws/state_manager/examples/example.tf rename to modules/aws/state_manager/test/test.tf diff --git a/modules/aws/vpc/examples/README.md b/modules/aws/vpc/test/README.md similarity index 100% rename from modules/aws/vpc/examples/README.md rename to modules/aws/vpc/test/README.md diff --git a/modules/aws/vpc/examples/example.tf b/modules/aws/vpc/test/test.tf similarity index 100% rename from modules/aws/vpc/examples/example.tf rename to modules/aws/vpc/test/test.tf