Skip to content

Commit

Permalink
feat!: Update supported Terraform min version to v1.0+ and AWS provid…
Browse files Browse the repository at this point in the history
…er to v4.0+ (#45)
  • Loading branch information
bryantbiggs authored Nov 12, 2022
1 parent 0314876 commit 4702d67
Show file tree
Hide file tree
Showing 15 changed files with 63 additions and 43 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/lock.yml
Original file line number Diff line number Diff line change
@@ -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'
2 changes: 1 addition & 1 deletion .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: Pre-Commit
on:
pull_request:
branches:
- main
- master

env:
Expand All @@ -17,11 +16,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
Expand All @@ -32,26 +31,26 @@ 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.1
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 }}/*'

- 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)'
Expand All @@ -62,17 +61,18 @@ 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.1

- 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 }}
install-hcledit: true
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
workflow_dispatch:
push:
branches:
- main
- master
paths:
- '**/*.tpl'
Expand All @@ -20,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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.62.3
rev: v1.76.0
hooks:
- id: terraform_fmt
- id: terraform_validate
Expand All @@ -23,7 +23,7 @@ repos:
- '--args=--only=terraform_standard_module_structure'
- '--args=--only=terraform_workspace_remote'
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.3.0
hooks:
- id: check-merge-conflict
- id: end-of-file-fixer
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ module "elb_http" {

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.26 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.20 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.0 |

## Providers

Expand Down
6 changes: 3 additions & 3 deletions examples/complete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ Note that this example may create resources which cost money. Run `terraform des

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.26 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.20 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.0 |
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 2.20 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.0 |
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 |

## Modules
Expand Down
4 changes: 2 additions & 2 deletions examples/complete/versions.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
terraform {
required_version = ">= 0.12.26"
required_version = ">= 1.0"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 2.20"
version = ">= 4.0"
}

random = {
Expand Down
6 changes: 3 additions & 3 deletions modules/elb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.26 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.20 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 2.20 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.0 |

## Modules

Expand Down
16 changes: 8 additions & 8 deletions modules/elb/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
output "elb_id" {
description = "The name of the ELB"
value = concat(aws_elb.this.*.id, [""])[0]
value = try(aws_elb.this[0].id, "")
}

output "elb_arn" {
description = "The ARN of the ELB"
value = concat(aws_elb.this.*.arn, [""])[0]
value = try(aws_elb.this[0].arn, "")
}

output "elb_name" {
description = "The name of the ELB"
value = concat(aws_elb.this.*.name, [""])[0]
value = try(aws_elb.this[0].name, "")
}

output "elb_dns_name" {
description = "The DNS name of the ELB"
value = concat(aws_elb.this.*.dns_name, [""])[0]
value = try(aws_elb.this[0].dns_name, "")
}

output "elb_instances" {
description = "The list of instances in the ELB"
value = flatten(aws_elb.this.*.instances)
value = flatten(aws_elb.this[*].instances)
}

output "elb_source_security_group" {
description = "The name of the security group that you can use as part of your inbound rules for your load balancer's back-end application instances. Use this for Classic or Default VPC only."
value = concat(aws_elb.this.*.source_security_group, [""])[0]
value = try(aws_elb.this[0].source_security_group, "")
}

output "elb_source_security_group_id" {
description = "The ID of the security group that you can use as part of your inbound rules for your load balancer's back-end application instances. Only available on ELBs launched in a VPC."
value = concat(aws_elb.this.*.source_security_group_id, [""])[0]
value = try(aws_elb.this[0].source_security_group_id, "")
}

output "elb_zone_id" {
description = "The canonical hosted zone ID of the ELB (to be used in a Route 53 Alias record)"
value = concat(aws_elb.this.*.zone_id, [""])[0]
value = try(aws_elb.this[0].zone_id, "")
}
4 changes: 2 additions & 2 deletions modules/elb/versions.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
terraform {
required_version = ">= 0.12.26"
required_version = ">= 1.0"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 2.20"
version = ">= 4.0"
}
}
}
6 changes: 3 additions & 3 deletions modules/elb_attachment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.26 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.20 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 2.20 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.0 |

## Modules

Expand Down
4 changes: 2 additions & 2 deletions modules/elb_attachment/versions.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
terraform {
required_version = ">= 0.12.26"
required_version = ">= 1.0"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 2.20"
version = ">= 4.0"
}
}
}
4 changes: 2 additions & 2 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
terraform {
required_version = ">= 0.12.26"
required_version = ">= 1.0"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 2.20"
version = ">= 4.0"
}
}
}

0 comments on commit 4702d67

Please sign in to comment.