Skip to content

Commit

Permalink
fix: Updated supported Terraform versions (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbabenko authored Nov 24, 2020
1 parent f708954 commit 0db935e
Show file tree
Hide file tree
Showing 39 changed files with 185 additions and 42 deletions.
20 changes: 18 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
repos:
- repo: git://github.com/antonbabenko/pre-commit-terraform
rev: v1.27.0
rev: v1.44.0
hooks:
- id: terraform_fmt
- id: terraform_validate
- id: terraform_docs
- 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: git://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
rev: v3.3.0
hooks:
- id: check-merge-conflict
5 changes: 4 additions & 1 deletion examples/cis-alarms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ Note that this example may create resources which cost money. Run `terraform des
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

No requirements.
| Name | Version |
|------|---------|
| terraform | >= 0.12.6 |
| aws | >= 2.55 |

## Providers

Expand Down
Empty file.
7 changes: 7 additions & 0 deletions examples/cis-alarms/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
terraform {
required_version = ">= 0.12.6"

required_providers {
aws = ">= 2.55"
}
}
5 changes: 4 additions & 1 deletion examples/complete-log-metric-filter-and-alarm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ Note that this example may create resources which cost money. Run `terraform des
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

No requirements.
| Name | Version |
|------|---------|
| terraform | >= 0.12.6 |
| aws | >= 2.55 |

## Providers

Expand Down
1 change: 1 addition & 0 deletions examples/complete-log-metric-filter-and-alarm/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ output "this_cloudwatch_log_metric_filter_id" {
description = "The name of the metric filter"
value = module.log_metric_filter.this_cloudwatch_log_metric_filter_id
}

output "this_cloudwatch_metric_alarm_arn" {
description = "The ARN of the Cloudwatch metric alarm"
value = module.alarm.this_cloudwatch_metric_alarm_arn
Expand Down
Empty file.
7 changes: 7 additions & 0 deletions examples/complete-log-metric-filter-and-alarm/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
terraform {
required_version = ">= 0.12.6"

required_providers {
aws = ">= 2.55"
}
}
9 changes: 6 additions & 3 deletions examples/fixtures/aws_cloudwatch_log_group/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
output "random_id" {
value = random_pet.this.id
description = "Id"
value = random_pet.this.id
}

output "this_cloudwatch_log_group_arn" {
value = aws_cloudwatch_log_group.this.arn
description = "ARN"
value = aws_cloudwatch_log_group.this.arn
}

output "this_cloudwatch_log_group_name" {
value = aws_cloudwatch_log_group.this.name
description = "Name"
value = aws_cloudwatch_log_group.this.name
}
Empty file.
8 changes: 8 additions & 0 deletions examples/fixtures/aws_cloudwatch_log_group/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform {
required_version = ">= 0.12.6"

required_providers {
aws = ">= 2.55"
random = ">= 2.0"
}
}
4 changes: 0 additions & 4 deletions examples/fixtures/aws_kms_key/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,3 @@ resource "aws_kms_key" "this" {
description = "fixtures-${random_pet.this.id}"

}

output "this_kms_key_id" {
value = aws_kms_key.this.key_id
}
4 changes: 4 additions & 0 deletions examples/fixtures/aws_kms_key/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
output "this_kms_key_id" {
description = "Id"
value = aws_kms_key.this.key_id
}
Empty file.
8 changes: 8 additions & 0 deletions examples/fixtures/aws_kms_key/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform {
required_version = ">= 0.12.6"

required_providers {
aws = ">= 2.55"
random = ">= 2.0"
}
}
9 changes: 6 additions & 3 deletions examples/fixtures/aws_lambda_function/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
output "random_id" {
value = random_pet.this.id
description = "Id"
value = random_pet.this.id
}

output "this_lambda_function_arn" {
value = aws_lambda_function.this.arn
description = "ARN"
value = aws_lambda_function.this.arn
}

output "this_lambda_function_name" {
value = aws_lambda_function.this.function_name
description = "Name"
value = aws_lambda_function.this.function_name
}
Empty file.
9 changes: 9 additions & 0 deletions examples/fixtures/aws_lambda_function/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 0.12.6"

required_providers {
aws = ">= 2.55"
random = ">= 2.0"
archive = ">= 2.0"
}
}
8 changes: 0 additions & 8 deletions examples/fixtures/aws_sns_topic/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,3 @@ resource "random_pet" "this" {
resource "aws_sns_topic" "this" {
name = "fixtures-${random_pet.this.id}"
}

output "this_sns_topic_arn" {
value = aws_sns_topic.this.arn
}

output "this_sns_topic_name" {
value = aws_sns_topic.this.name
}
9 changes: 9 additions & 0 deletions examples/fixtures/aws_sns_topic/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
output "this_sns_topic_arn" {
description = "ARN"
value = aws_sns_topic.this.arn
}

output "this_sns_topic_name" {
description = "Name"
value = aws_sns_topic.this.name
}
Empty file.
8 changes: 8 additions & 0 deletions examples/fixtures/aws_sns_topic/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform {
required_version = ">= 0.12.6"

required_providers {
aws = ">= 2.55"
random = ">= 2.0"
}
}
9 changes: 6 additions & 3 deletions examples/lambda-metric-alarm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ Note that this example may create resources which cost money. Run `terraform des
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

No requirements.
| Name | Version |
|------|---------|
| terraform | >= 0.12.6 |
| aws | >= 2.55 |

## Providers

Expand All @@ -33,7 +36,7 @@ No input.
|------|-------------|
| this\_cloudwatch\_metric\_alarm\_arn | The ARN of the Cloudwatch metric alarm |
| this\_cloudwatch\_metric\_alarm\_id | The ID of the Cloudwatch metric alarm |
| this\_lambda\_function1\_arn | n/a |
| this\_lambda\_function1\_name | n/a |
| this\_lambda\_function1\_arn | Lambda function ARN |
| this\_lambda\_function1\_name | Lambda function name |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
2 changes: 1 addition & 1 deletion examples/lambda-metric-alarm/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module "aws_sns_topic" {
source = "../fixtures/aws_sns_topic"
}

// Alarm - "there is at least one error in a minute in AWS Lambda functions"
# Alarm - "there is at least one error in a minute in AWS Lambda functions"
module "all_lambdas_errors_alarm" {
source = "../../modules/metric-alarm"

Expand Down
6 changes: 4 additions & 2 deletions examples/lambda-metric-alarm/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ output "this_cloudwatch_metric_alarm_id" {
}

output "this_lambda_function1_arn" {
value = module.aws_lambda_function1.this_lambda_function_arn
description = "Lambda function ARN"
value = module.aws_lambda_function1.this_lambda_function_arn
}

output "this_lambda_function1_name" {
value = module.aws_lambda_function1.this_lambda_function_name
description = "Lambda function name"
value = module.aws_lambda_function1.this_lambda_function_name
}
Empty file.
7 changes: 7 additions & 0 deletions examples/lambda-metric-alarm/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
terraform {
required_version = ">= 0.12.6"

required_providers {
aws = ">= 2.55"
}
}
9 changes: 6 additions & 3 deletions examples/multiple-lambda-metric-alarm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ Note that this example may create resources which cost money. Run `terraform des
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

No requirements.
| Name | Version |
|------|---------|
| terraform | >= 0.12.6 |
| aws | >= 2.55 |

## Providers

Expand All @@ -33,7 +36,7 @@ No input.
|------|-------------|
| this\_cloudwatch\_metric\_alarm\_arns | List of ARN of the Cloudwatch metric alarms |
| this\_cloudwatch\_metric\_alarm\_ids | List of ID of the Cloudwatch metric alarms |
| this\_lambda\_function1\_arn | n/a |
| this\_lambda\_function1\_name | n/a |
| this\_lambda\_function1\_arn | Lambda function ARN |
| this\_lambda\_function1\_name | Lambda function name |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
6 changes: 4 additions & 2 deletions examples/multiple-lambda-metric-alarm/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ output "this_cloudwatch_metric_alarm_ids" {
}

output "this_lambda_function1_arn" {
value = module.aws_lambda_function1.this_lambda_function_arn
description = "Lambda function ARN"
value = module.aws_lambda_function1.this_lambda_function_arn
}

output "this_lambda_function1_name" {
value = module.aws_lambda_function1.this_lambda_function_name
description = "Lambda function name"
value = module.aws_lambda_function1.this_lambda_function_name
}
Empty file.
7 changes: 7 additions & 0 deletions examples/multiple-lambda-metric-alarm/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
terraform {
required_version = ">= 0.12.6"

required_providers {
aws = ">= 2.55"
}
}
10 changes: 7 additions & 3 deletions modules/cis-alarms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ Read more about [CIS AWS Foundations Controls](https://docs.aws.amazon.com/secur
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

No requirements.
| Name | Version |
|------|---------|
| terraform | >= 0.12.6 |
| aws | >= 2.55 |
| random | >= 2.0 |

## Providers

| Name | Version |
|------|---------|
| aws | n/a |
| random | n/a |
| aws | >= 2.55 |
| random | >= 2.0 |

## Inputs

Expand Down
8 changes: 8 additions & 0 deletions modules/cis-alarms/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform {
required_version = ">= 0.12.6"

required_providers {
aws = ">= 2.55"
random = ">= 2.0"
}
}
7 changes: 5 additions & 2 deletions modules/log-metric-filter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

No requirements.
| Name | Version |
|------|---------|
| terraform | >= 0.12.6 |
| aws | >= 2.55 |

## Providers

| Name | Version |
|------|---------|
| aws | n/a |
| aws | >= 2.55 |

## Inputs

Expand Down
7 changes: 7 additions & 0 deletions modules/log-metric-filter/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
terraform {
required_version = ">= 0.12.6"

required_providers {
aws = ">= 2.55"
}
}
7 changes: 5 additions & 2 deletions modules/metric-alarm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

No requirements.
| Name | Version |
|------|---------|
| terraform | >= 0.12.6 |
| aws | >= 2.55 |

## Providers

| Name | Version |
|------|---------|
| aws | n/a |
| aws | >= 2.55 |

## Inputs

Expand Down
7 changes: 7 additions & 0 deletions modules/metric-alarm/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
terraform {
required_version = ">= 0.12.6"

required_providers {
aws = ">= 2.55"
}
}
7 changes: 5 additions & 2 deletions modules/metric-alarms-by-multiple-dimensions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

No requirements.
| Name | Version |
|------|---------|
| terraform | >= 0.12.6 |
| aws | >= 2.55 |

## Providers

| Name | Version |
|------|---------|
| aws | n/a |
| aws | >= 2.55 |

## Inputs

Expand Down
7 changes: 7 additions & 0 deletions modules/metric-alarms-by-multiple-dimensions/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
terraform {
required_version = ">= 0.12.6"

required_providers {
aws = ">= 2.55"
}
}

0 comments on commit 0db935e

Please sign in to comment.