From 84d42b824b24332c4c67903aa9dc5cd6579305e5 Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Thu, 27 Oct 2022 14:16:31 -0400 Subject: [PATCH 1/2] fix: Update CI configuration files to use latest version --- .github/workflows/lock.yml | 21 +++++++++++++++++++++ .github/workflows/pr-title.yml | 2 +- .github/workflows/pre-commit.yml | 18 +++++++++--------- .github/workflows/release.yml | 2 +- .github/workflows/stale-actions.yaml | 2 +- .pre-commit-config.yaml | 2 +- 6 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/lock.yml diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml new file mode 100644 index 0000000..d887a66 --- /dev/null +++ b/.github/workflows/lock.yml @@ -0,0 +1,21 @@ +name: 'Lock Threads' + +on: + schedule: + - cron: '50 1 * * *' + +jobs: + lock: + runs-on: ubuntu-latest + steps: + - uses: dessant/lock-threads@v3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + issue-comment: > + I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues. + If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. + issue-inactive-days: '30' + pr-comment: > + I'm going to lock this pull request because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues. + If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. + pr-inactive-days: '30' diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml index 168011c..cb32a0f 100644 --- a/.github/workflows/pr-title.yml +++ b/.github/workflows/pr-title.yml @@ -14,7 +14,7 @@ jobs: steps: # Please look up the latest version from # https://github.com/amannn/action-semantic-pull-request/releases - - uses: amannn/action-semantic-pull-request@v3.4.6 + - uses: amannn/action-semantic-pull-request@v5.0.2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index b8f1b8a..06270c8 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -17,11 +17,11 @@ jobs: directories: ${{ steps.dirs.outputs.directories }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Get root directories id: dirs - uses: clowdhaus/terraform-composite-actions/directories@v1.3.0 + uses: clowdhaus/terraform-composite-actions/directories@v1.8.0 preCommitMinVersions: name: Min TF pre-commit @@ -32,18 +32,18 @@ jobs: directory: ${{ fromJson(needs.collectInputs.outputs.directories) }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Terraform min/max versions id: minMax - uses: clowdhaus/terraform-min-max@v1.0.3 + uses: clowdhaus/terraform-min-max@v1.2.0 with: directory: ${{ matrix.directory }} - name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }} # Run only validate pre-commit check on min version supported if: ${{ matrix.directory != '.' }} - uses: clowdhaus/terraform-composite-actions/pre-commit@v1.3.0 + uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.0 with: terraform-version: ${{ steps.minMax.outputs.minVersion }} args: 'terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/*' @@ -51,7 +51,7 @@ jobs: - name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }} # Run only validate pre-commit check on min version supported if: ${{ matrix.directory == '.' }} - uses: clowdhaus/terraform-composite-actions/pre-commit@v1.3.0 + uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.0 with: terraform-version: ${{ steps.minMax.outputs.minVersion }} args: 'terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)' @@ -62,17 +62,17 @@ jobs: needs: collectInputs steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.ref }} repository: ${{github.event.pull_request.head.repo.full_name}} - name: Terraform min/max versions id: minMax - uses: clowdhaus/terraform-min-max@v1.0.3 + uses: clowdhaus/terraform-min-max@v1.2.0 - name: Pre-commit Terraform ${{ steps.minMax.outputs.maxVersion }} - uses: clowdhaus/terraform-composite-actions/pre-commit@v1.3.0 + uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.0 with: terraform-version: ${{ steps.minMax.outputs.maxVersion }} terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9b42030..d2556e0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: if: github.repository_owner == 'terraform-aws-modules' steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: persist-credentials: false fetch-depth: 0 diff --git a/.github/workflows/stale-actions.yaml b/.github/workflows/stale-actions.yaml index c09ae1d..5037995 100644 --- a/.github/workflows/stale-actions.yaml +++ b/.github/workflows/stale-actions.yaml @@ -7,7 +7,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v4 + - uses: actions/stale@v6 with: repo-token: ${{ secrets.GITHUB_TOKEN }} # Staling issues and PR's diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 727e21c..74f3751 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/antonbabenko/pre-commit-terraform - rev: v1.74.1 + rev: v1.76.0 hooks: - id: terraform_fmt - id: terraform_validate From e3138b1c95b57b06e1e74a2bcec4998fc500583d Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Thu, 27 Oct 2022 14:46:57 -0400 Subject: [PATCH 2/2] fix: Correct linting failures --- outputs.tf | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/outputs.tf b/outputs.tf index ec26edd..eda1189 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,69 +1,69 @@ # RDS Proxy output "proxy_id" { description = "The ID for the proxy" - value = element(concat(aws_db_proxy.this.*.id, [""]), 0) + value = try(aws_db_proxy.this[0].id, "") } output "proxy_arn" { description = "The Amazon Resource Name (ARN) for the proxy" - value = element(concat(aws_db_proxy.this.*.arn, [""]), 0) + value = try(aws_db_proxy.this[0].arn, "") } output "proxy_endpoint" { description = "The endpoint that you can use to connect to the proxy" - value = element(concat(aws_db_proxy.this.*.endpoint, [""]), 0) + value = try(aws_db_proxy.this[0].endpoint, "") } # Proxy Default Target Group output "proxy_default_target_group_id" { description = "The ID for the default target group" - value = element(concat(aws_db_proxy_default_target_group.this.*.id, [""]), 0) + value = try(aws_db_proxy_default_target_group.this[0].id, "") } output "proxy_default_target_group_arn" { description = "The Amazon Resource Name (ARN) for the default target group" - value = element(concat(aws_db_proxy_default_target_group.this.*.arn, [""]), 0) + value = try(aws_db_proxy_default_target_group.this[0].arn, "") } output "proxy_default_target_group_name" { description = "The name of the default target group" - value = element(concat(aws_db_proxy_default_target_group.this.*.name, [""]), 0) + value = try(aws_db_proxy_default_target_group.this[0].name, "") } # Proxy Target output "proxy_target_endpoint" { description = "Hostname for the target RDS DB Instance. Only returned for `RDS_INSTANCE` type" - value = element(concat(aws_db_proxy_target.db_instance.*.endpoint, aws_db_proxy_target.db_cluster.*.endpoint, [""]), 0) + value = try(aws_db_proxy_target.db_instance[0].endpoint, aws_db_proxy_target.db_cluster[0].endpoint, "") } output "proxy_target_id" { description = "Identifier of `db_proxy_name`, `target_group_name`, target type (e.g. `RDS_INSTANCE` or `TRACKED_CLUSTER`), and resource identifier separated by forward slashes (/)" - value = element(concat(aws_db_proxy_target.db_instance.*.id, aws_db_proxy_target.db_cluster.*.id, [""]), 0) + value = try(aws_db_proxy_target.db_instance[0].id, aws_db_proxy_target.db_cluster[0].id, "") } output "proxy_target_port" { description = "Port for the target RDS DB Instance or Aurora DB Cluster" - value = element(concat(aws_db_proxy_target.db_instance.*.port, aws_db_proxy_target.db_cluster.*.port, [""]), 0) + value = try(aws_db_proxy_target.db_instance[0].port, aws_db_proxy_target.db_cluster[0].port, "") } output "proxy_target_rds_resource_id" { description = "Identifier representing the DB Instance or DB Cluster target" - value = element(concat(aws_db_proxy_target.db_instance.*.rds_resource_id, aws_db_proxy_target.db_cluster.*.rds_resource_id, [""]), 0) + value = try(aws_db_proxy_target.db_instance[0].rds_resource_id, aws_db_proxy_target.db_cluster[0].rds_resource_id, "") } output "proxy_target_target_arn" { description = "Amazon Resource Name (ARN) for the DB instance or DB cluster. Currently not returned by the RDS API" - value = element(concat(aws_db_proxy_target.db_instance.*.target_arn, aws_db_proxy_target.db_cluster.*.target_arn, [""]), 0) + value = try(aws_db_proxy_target.db_instance[0].target_arn, aws_db_proxy_target.db_cluster[0].target_arn, "") } output "proxy_target_tracked_cluster_id" { description = "DB Cluster identifier for the DB Instance target. Not returned unless manually importing an RDS_INSTANCE target that is part of a DB Cluster" - value = element(concat(aws_db_proxy_target.db_cluster.*.tracked_cluster_id, [""]), 0) + value = try(aws_db_proxy_target.db_cluster[0].tracked_cluster_id, "") } output "proxy_target_type" { description = "Type of target. e.g. `RDS_INSTANCE` or `TRACKED_CLUSTER`" - value = element(concat(aws_db_proxy_target.db_instance.*.type, aws_db_proxy_target.db_cluster.*.type, [""]), 0) + value = try(aws_db_proxy_target.db_instance[0].type, aws_db_proxy_target.db_cluster[0].type, "") } # DB proxy endponts @@ -75,5 +75,5 @@ output "db_proxy_endpoints" { # CloudWatch logs output "log_group_arn" { description = "The Amazon Resource Name (ARN) of the CloudWatch log group" - value = element(concat(aws_cloudwatch_log_group.this.*.arn, [""]), 0) + value = try(aws_cloudwatch_log_group.this[0].arn, "") }