From ef57265948958c8daa577ff970583f277a98d9d1 Mon Sep 17 00:00:00 2001 From: Anton Babenko Date: Tue, 24 Nov 2020 10:00:16 +0100 Subject: [PATCH] fix: Updated supported Terraform versions --- .pre-commit-config.yaml | 20 +++++++++++++++-- README.md | 7 +++--- examples/complete-alb/README.md | 10 ++++++--- examples/complete-alb/main.tf | 35 ++++++++++++++++++----------- examples/complete-alb/variables.tf | 0 examples/complete-alb/versions.tf | 8 +++++++ examples/complete-nlb/README.md | 10 ++++++--- examples/complete-nlb/main.tf | 36 +++++++++++++++--------------- examples/complete-nlb/variables.tf | 0 examples/complete-nlb/versions.tf | 8 +++++++ examples/disabled/README.md | 34 ---------------------------- examples/disabled/main.tf | 12 ---------- versions.tf | 4 ++-- 13 files changed, 94 insertions(+), 90 deletions(-) create mode 100644 examples/complete-alb/variables.tf create mode 100644 examples/complete-alb/versions.tf create mode 100644 examples/complete-nlb/variables.tf create mode 100644 examples/complete-nlb/versions.tf delete mode 100644 examples/disabled/README.md delete mode 100644 examples/disabled/main.tf diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0285452..8677870 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/README.md b/README.md index bd6ae47..0a6ad5e 100644 --- a/README.md +++ b/README.md @@ -301,14 +301,14 @@ module "lb" { | Name | Version | |------|---------| -| terraform | >= 0.12.6, < 0.14 | -| aws | >= 2.54, < 4.0 | +| terraform | >= 0.12.6 | +| aws | >= 2.54 | ## Providers | Name | Version | |------|---------| -| aws | >= 2.54, < 4.0 | +| aws | >= 2.54 | ## Inputs @@ -322,6 +322,7 @@ module "lb" { | enable\_http2 | Indicates whether HTTP/2 is enabled in application load balancers. | `bool` | `true` | no | | extra\_ssl\_certs | A list of maps describing any extra SSL certificates to apply to the HTTPS listeners. Required key/values: certificate\_arn, https\_listener\_index (the index of the listener within https\_listeners which the cert applies toward). | `list(map(string))` | `[]` | no | | http\_tcp\_listeners | A list of maps describing the HTTP listeners or TCP ports for this ALB. Required key/values: port, protocol. Optional key/values: target\_group\_index (defaults to http\_tcp\_listeners[count.index]) | `any` | `[]` | no | +| https\_listener\_rules | A list of maps describing the Listener Rules for this ALB. Required key/values: actions, conditions. Optional key/values: priority, https\_listener\_index (default to https\_listeners[count.index]) | `any` | `[]` | no | | https\_listeners | A list of maps describing the HTTPS listeners for this ALB. Required key/values: port, certificate\_arn. Optional key/values: ssl\_policy (defaults to ELBSecurityPolicy-2016-08), target\_group\_index (defaults to https\_listeners[count.index]) | `any` | `[]` | no | | idle\_timeout | The time in seconds that the connection is allowed to be idle. | `number` | `60` | no | | internal | Boolean determining if the load balancer is internal or externally facing. | `bool` | `false` | no | diff --git a/examples/complete-alb/README.md b/examples/complete-alb/README.md index 74eecda..f2fabf1 100644 --- a/examples/complete-alb/README.md +++ b/examples/complete-alb/README.md @@ -17,14 +17,18 @@ Note that this example may create resources which cost money. Run `terraform des ## Requirements -No requirements. +| Name | Version | +|------|---------| +| terraform | >= 0.12.6 | +| aws | >= 2.54 | +| random | >= 2.0 | ## Providers | Name | Version | |------|---------| -| aws | n/a | -| random | n/a | +| aws | >= 2.54 | +| random | >= 2.0 | ## Inputs diff --git a/examples/complete-alb/main.tf b/examples/complete-alb/main.tf index ea93865..2250ac0 100644 --- a/examples/complete-alb/main.tf +++ b/examples/complete-alb/main.tf @@ -38,15 +38,15 @@ module "security_group" { egress_rules = ["all-all"] } -//module "log_bucket" { -// source = "terraform-aws-modules/s3-bucket/aws" -// version = "~> 1.0" -// -// bucket = "logs-${random_pet.this.id}" -// acl = "log-delivery-write" -// force_destroy = true -// attach_elb_log_delivery_policy = true -//} +# module "log_bucket" { +# source = "terraform-aws-modules/s3-bucket/aws" +# version = "~> 1.0" +# +# bucket = "logs-${random_pet.this.id}" +# acl = "log-delivery-write" +# force_destroy = true +# attach_elb_log_delivery_policy = true +# } module "acm" { source = "terraform-aws-modules/acm/aws" @@ -92,10 +92,10 @@ module "alb" { security_groups = [module.security_group.this_security_group_id] subnets = data.aws_subnet_ids.all.ids - // # See notes in README (ref: https://github.com/terraform-providers/terraform-provider-aws/issues/7987) - // access_logs = { - // bucket = module.log_bucket.this_s3_bucket_id - // } + # # See notes in README (ref: https://github.com/terraform-providers/terraform-provider-aws/issues/7987) + # access_logs = { + # bucket = module.log_bucket.this_s3_bucket_id + # } http_tcp_listeners = [ # Forward action is default, either when defined or undefined @@ -308,3 +308,12 @@ module "alb" { MyGlobalTargetGroupTag = "bar" } } + +######################### +# LB will not be created +######################### +module "lb_disabled" { + source = "../../" + + create_lb = false +} diff --git a/examples/complete-alb/variables.tf b/examples/complete-alb/variables.tf new file mode 100644 index 0000000..e69de29 diff --git a/examples/complete-alb/versions.tf b/examples/complete-alb/versions.tf new file mode 100644 index 0000000..fa3bbde --- /dev/null +++ b/examples/complete-alb/versions.tf @@ -0,0 +1,8 @@ +terraform { + required_version = ">= 0.12.6" + + required_providers { + aws = ">= 2.54" + random = ">= 2.0" + } +} diff --git a/examples/complete-nlb/README.md b/examples/complete-nlb/README.md index c90390f..a3b17e5 100644 --- a/examples/complete-nlb/README.md +++ b/examples/complete-nlb/README.md @@ -17,14 +17,18 @@ Note that this example may create resources which cost money. Run `terraform des ## Requirements -No requirements. +| Name | Version | +|------|---------| +| terraform | >= 0.12.6 | +| aws | >= 2.54 | +| random | >= 2.0 | ## Providers | Name | Version | |------|---------| -| aws | n/a | -| random | n/a | +| aws | >= 2.54 | +| random | >= 2.0 | ## Inputs diff --git a/examples/complete-nlb/main.tf b/examples/complete-nlb/main.tf index af10261..f99d954 100644 --- a/examples/complete-nlb/main.tf +++ b/examples/complete-nlb/main.tf @@ -25,15 +25,15 @@ data "aws_route53_zone" "this" { name = local.domain_name } -//module "log_bucket" { -// source = "terraform-aws-modules/s3-bucket/aws" -// version = "~> 1.0" -// -// bucket = "logs-${random_pet.this.id}" -// acl = "log-delivery-write" -// force_destroy = true -// attach_elb_log_delivery_policy = true -//} +# module "log_bucket" { +# source = "terraform-aws-modules/s3-bucket/aws" +# version = "~> 1.0" +# +# bucket = "logs-${random_pet.this.id}" +# acl = "log-delivery-write" +# force_destroy = true +# attach_elb_log_delivery_policy = true +# } module "acm" { source = "terraform-aws-modules/acm/aws" @@ -61,19 +61,19 @@ module "nlb" { vpc_id = data.aws_vpc.default.id - // Use `subnets` if you don't want to attach EIPs - // subnets = tolist(data.aws_subnet_ids.all.ids) + # Use `subnets` if you don't want to attach EIPs + # subnets = tolist(data.aws_subnet_ids.all.ids) - // Use `subnet_mapping` to attach EIPs + # Use `subnet_mapping` to attach EIPs subnet_mapping = [for i, eip in aws_eip.this : { allocation_id : eip.id, subnet_id : tolist(data.aws_subnet_ids.all.ids)[i] }] - // # See notes in README (ref: https://github.com/terraform-providers/terraform-provider-aws/issues/7987) - // access_logs = { - // bucket = module.log_bucket.this_s3_bucket_id - // } + # # See notes in README (ref: https://github.com/terraform-providers/terraform-provider-aws/issues/7987) + # access_logs = { + # bucket = module.log_bucket.this_s3_bucket_id + # } - // TCP_UDP, UDP, TCP + # TCP_UDP, UDP, TCP http_tcp_listeners = [ { port = 81 @@ -92,7 +92,7 @@ module "nlb" { }, ] - // TLS + # TLS https_listeners = [ { port = 84 diff --git a/examples/complete-nlb/variables.tf b/examples/complete-nlb/variables.tf new file mode 100644 index 0000000..e69de29 diff --git a/examples/complete-nlb/versions.tf b/examples/complete-nlb/versions.tf new file mode 100644 index 0000000..fa3bbde --- /dev/null +++ b/examples/complete-nlb/versions.tf @@ -0,0 +1,8 @@ +terraform { + required_version = ">= 0.12.6" + + required_providers { + aws = ">= 2.54" + random = ">= 2.0" + } +} diff --git a/examples/disabled/README.md b/examples/disabled/README.md deleted file mode 100644 index 41305cb..0000000 --- a/examples/disabled/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# Disabled creation of ALB example - -Configuration in this directory will not create ALB. - -## Usage - -To run this example you need to execute: - -```bash -$ terraform init -$ terraform plan -$ terraform apply -``` - -Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources. - - -## Requirements - -No requirements. - -## Providers - -No provider. - -## Inputs - -No input. - -## Outputs - -No output. - - diff --git a/examples/disabled/main.tf b/examples/disabled/main.tf deleted file mode 100644 index 37b75eb..0000000 --- a/examples/disabled/main.tf +++ /dev/null @@ -1,12 +0,0 @@ -provider "aws" { - region = "eu-west-1" -} - -########################################## -# LB WILL NOT be created by this example -########################################## -module "lb_disabled" { - source = "../../" - - create_lb = false -} diff --git a/versions.tf b/versions.tf index 3c1037e..a86d343 100644 --- a/versions.tf +++ b/versions.tf @@ -1,7 +1,7 @@ terraform { - required_version = ">= 0.12.6, < 0.14" + required_version = ">= 0.12.6" required_providers { - aws = ">= 2.54, < 4.0" + aws = ">= 2.54" } }