Skip to content

Commit

Permalink
bump modules to be supported by tf 0.13+
Browse files Browse the repository at this point in the history
  • Loading branch information
wsilva authored May 15, 2024
1 parent af2f557 commit f7a3146
Show file tree
Hide file tree
Showing 37 changed files with 135 additions and 125 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @grupoboticario/sq-devops-dea-ped
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2

registries:
github-grupoboticario:
type: git
url: https://github.com
username: x-access-token
password: ${{ secrets.GB_TERRAFORM_API_TOKEN }}

updates:
- package-ecosystem: github-actions
directory: /
open-pull-requests-limit: 10
schedule:
interval: weekly

updates:
22 changes: 22 additions & 0 deletions .github/workflows/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Update Dependabot Config File

on:
- pull_request

permissions:
contents: write
pull-requests: read
deployments: write

jobs:
updateDependabotCfgFile:
runs-on: [self-hosted, core-shr]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Update Dependabot Config File
uses: grupoboticario/actions-tf-dependabot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
13 changes: 13 additions & 0 deletions .github/workflows/devsecops.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
run-name: DevSecOps
name: DevSecOps
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]

jobs:
devsecops:
uses: grupoboticario/actions-devsecops-workflows/.github/workflows/devsecops.yml@v0
80 changes: 9 additions & 71 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -1,78 +1,16 @@
name: Pre-Commit
name: pre-commit

on:
pull_request:
branches:
- main
- master

env:
TERRAFORM_DOCS_VERSION: v0.16.0
branches: [main]
push:
branches: [main]

jobs:
collectInputs:
name: Collect workflow inputs
runs-on: ubuntu-latest
outputs:
directories: ${{ steps.dirs.outputs.directories }}
pre-commit:
runs-on: [self-hosted, core-shr]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Get root directories
id: dirs
uses: clowdhaus/terraform-composite-actions/[email protected]

preCommitMinVersions:
name: Min TF pre-commit
needs: collectInputs
runs-on: ubuntu-latest
strategy:
matrix:
directory: ${{ fromJson(needs.collectInputs.outputs.directories) }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Terraform min/max versions
id: minMax
uses: clowdhaus/[email protected]
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/[email protected]
with:
terraform-version: ${{ steps.minMax.outputs.minVersion }}
args: 'terraform_validate --color=always --show-diff-on-failure --files ${{ 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/[email protected]
with:
terraform-version: ${{ steps.minMax.outputs.minVersion }}
args: 'terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)'

preCommitMaxVersion:
name: Max TF pre-commit
runs-on: ubuntu-latest
needs: collectInputs
steps:
- name: Checkout
uses: actions/checkout@v2
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/[email protected]

- name: Pre-commit Terraform ${{ steps.minMax.outputs.maxVersion }}
uses: clowdhaus/terraform-composite-actions/[email protected]
with:
terraform-version: ${{ steps.minMax.outputs.maxVersion }}
terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }}
uses: actions/checkout@v4
- name: pre-commit
uses: grupoboticario/actions-tf-pre-commit@v1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ override.tf.json
# Ignore CLI configuration files
.terraformrc
terraform.rc
.terraform.lock.hcl
51 changes: 27 additions & 24 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.64.0
rev: v1.89.0
hooks:
- id: terraform_fmt
- id: terraform_validate
- id: terraform_docs
- id: terraform_checkov
args:
- '--args=--lockfile=false'
- --args=--skip-check CKV_AWS_23
- --args=--skip-check CKV_AWS_18
- --args=--skip-check CKV_AWS_109
- --args=--skip-check CKV_AWS_111
- --args=--skip-check CKV_AWS_144
- --args=--skip-check CKV_AWS_145
- --args=--skip-check CKV_AWS_149
- --args=--skip-check CKV_AWS_274
- --args=--skip-check CKV_AWS_356
- --args=--skip-check CKV2_AWS_5
- --args=--skip-check CKV2_AWS_57
- --args=--skip-check CKV2_AWS_61
- --args=--skip-check CKV2_AWS_62
- --args=--skip-check CKV2_AWS_65
- --args=--skip-check CKV_TF_1
- --args=--skip-check CKV2_GHA_1
- id: terraform_docs
- id: terraform_docs_without_aggregate_type_defaults
- id: terraform_fmt
- id: terraform_tflint
args:
- '--args=--only=terraform_deprecated_interpolation'
- '--args=--only=terraform_deprecated_index'
- '--args=--only=terraform_unused_declarations'
- '--args=--only=terraform_comment_syntax'
- '--args=--only=terraform_documented_outputs'
- '--args=--only=terraform_documented_variables'
- '--args=--only=terraform_typed_variables'
- '--args=--only=terraform_module_pinned_source'
- '--args=--only=terraform_naming_convention'
- '--args=--only=terraform_required_version'
- '--args=--only=terraform_required_providers'
- '--args=--only=terraform_standard_module_structure'
- '--args=--only=terraform_workspace_remote'
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: check-merge-conflict
- id: end-of-file-fixer
- id: terraform_trivy
# - id: terraform_validate
# - id: terrascan
# args:
# - --args=--non-recursive
# - --args=--skip-rules="AC_AWS_0500"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ Users have the ability to:
1. This module does not create RDS security group. Use [terraform-aws-security-group](https://github.com/terraform-aws-modules/terraform-aws-security-group) module for this.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

## Requirements

| Name | Version |
Expand Down
1 change: 1 addition & 0 deletions examples/complete-mssql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ $ terraform apply
Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

## Requirements

| Name | Version |
Expand Down
4 changes: 2 additions & 2 deletions examples/complete-mssql/versions.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
terraform {
required_version = ">= 0.13.1"
required_version = ">= 1"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.0"
version = ">= 4"
}
}
}
1 change: 1 addition & 0 deletions examples/complete-mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ $ terraform apply
Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

## Requirements

| Name | Version |
Expand Down
4 changes: 2 additions & 2 deletions examples/complete-mysql/versions.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
terraform {
required_version = ">= 0.13.1"
required_version = ">= 1"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.0"
version = ">= 4"
}
}
}
1 change: 1 addition & 0 deletions examples/complete-oracle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ $ terraform apply
Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

## Requirements

| Name | Version |
Expand Down
4 changes: 2 additions & 2 deletions examples/complete-oracle/versions.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
terraform {
required_version = ">= 0.13.1"
required_version = ">= 1"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.0"
version = ">= 4"
}
}
}
1 change: 1 addition & 0 deletions examples/complete-postgres/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ $ terraform apply
Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

## Requirements

| Name | Version |
Expand Down
4 changes: 2 additions & 2 deletions examples/complete-postgres/versions.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
terraform {
required_version = ">= 0.13.1"
required_version = ">= 1"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.0"
version = ">= 4"
}
}
}
1 change: 1 addition & 0 deletions examples/cross-region-replica-postgres/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ $ terraform apply
Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

## Requirements

| Name | Version |
Expand Down
4 changes: 2 additions & 2 deletions examples/cross-region-replica-postgres/versions.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
terraform {
required_version = ">= 0.13.1"
required_version = ">= 1"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.0"
version = ">= 4"
}
}
}
1 change: 1 addition & 0 deletions examples/enhanced-monitoring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ $ terraform apply
Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

## Requirements

| Name | Version |
Expand Down
4 changes: 2 additions & 2 deletions examples/enhanced-monitoring/versions.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
terraform {
required_version = ">= 0.13.1"
required_version = ">= 1"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.0"
version = ">= 4"
}
}
}
1 change: 1 addition & 0 deletions examples/groups/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ $ terraform apply
Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

## Requirements

| Name | Version |
Expand Down
4 changes: 2 additions & 2 deletions examples/groups/versions.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
terraform {
required_version = ">= 0.13.1"
required_version = ">= 1"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.0"
version = ">= 4"
}
}
}
1 change: 1 addition & 0 deletions examples/replica-mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ $ terraform apply
Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

## Requirements

| Name | Version |
Expand Down
4 changes: 2 additions & 2 deletions examples/replica-mysql/versions.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
terraform {
required_version = ">= 0.13.1"
required_version = ">= 1"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.0"
version = ">= 4"
}
}
}
1 change: 1 addition & 0 deletions examples/replica-postgres/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ $ terraform apply
Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

## Requirements

| Name | Version |
Expand Down
Loading

0 comments on commit f7a3146

Please sign in to comment.