diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b5335fa..7bc1c4f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.3.0 + rev: v3.4.0 hooks: - id: check-added-large-files args: ['--maxkb=500'] @@ -18,7 +18,7 @@ repos: args: ['--allow-missing-credentials'] - id: trailing-whitespace - repo: git://github.com/antonbabenko/pre-commit-terraform - rev: v1.45.0 + rev: v1.50.0 hooks: - id: terraform_fmt - id: terraform_docs diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dd7fdf..aff0efb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,13 @@ All notable changes to this project will be documented in this file. ## [Unreleased] -- Remove lb name's postfix and update examples +- Update README.md + + + +## [2.0.0] - 2020-12-10 + +- Remove lb name's postfix and update examples ([#5](https://github.com/umotif-public/terraform-aws-alb/issues/5)) @@ -52,7 +58,8 @@ All notable changes to this project will be documented in this file. - Add default redirect and nlb example -[Unreleased]: https://github.com/umotif-public/terraform-aws-alb/compare/1.2.2...HEAD +[Unreleased]: https://github.com/umotif-public/terraform-aws-alb/compare/2.0.0...HEAD +[2.0.0]: https://github.com/umotif-public/terraform-aws-alb/compare/1.2.2...2.0.0 [1.2.2]: https://github.com/umotif-public/terraform-aws-alb/compare/1.2.1...1.2.2 [1.2.1]: https://github.com/umotif-public/terraform-aws-alb/compare/1.2.0...1.2.1 [1.2.0]: https://github.com/umotif-public/terraform-aws-alb/compare/1.1.0...1.2.0 diff --git a/README.md b/README.md index 24defac..9ce4a25 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ These types of resources are supported: ## Terraform versions -Terraform 0.12. Pin module version to `~> v2.0`. Submit pull-requests to `master` branch. +Terraform 0.12. Pin module version to `~> v2.1`. Submit pull-requests to `master` branch. ## Usage @@ -20,7 +20,7 @@ Terraform 0.12. Pin module version to `~> v2.0`. Submit pull-requests to `master ```hcl module "alb" { source = "umotif-public/alb/aws" - version = "~> 2.0.0" + version = "~> 2.1.0" name_prefix = "complete-alb" @@ -45,7 +45,7 @@ module "alb" { ```hcl module "nlb" { source = "umotif-public/alb/aws" - version = "~> 2.0.0" + version = "~> 2.1.0" name_prefix = "complete-nlb" @@ -64,10 +64,6 @@ module "nlb" { } ``` -## Assumptions - -Module is to be used with Terraform > 0.12. - ## Examples * [Application Load Balancer ALB](https://github.com/umotif-public/terraform-aws-alb/tree/master/examples/alb) @@ -76,58 +72,72 @@ Module is to be used with Terraform > 0.12. ## Authors -Module managed by [Marcin Cuber](https://github.com/marcincuber) [linkedin](https://www.linkedin.com/in/marcincuber/). +Module managed by [Marcin Cuber](https://github.com/marcincuber) [LinkedIn](https://www.linkedin.com/in/marcincuber/). ## Requirements | Name | Version | |------|---------| -| terraform | >= 0.12.6 | -| aws | >= 2.45 | +| [terraform](#requirement\_terraform) | >= 0.12.6 | +| [aws](#requirement\_aws) | >= 3.40 | ## Providers | Name | Version | |------|---------| -| aws | >= 2.45 | +| [aws](#provider\_aws) | >= 3.40 | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [aws_lb.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb) | resource | +| [aws_lb_listener.frontend_http_to_https_redirect](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_listener) | resource | +| [aws_security_group.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | resource | +| [aws_security_group_rule.allow_port_443_ingress_for_http_to_https_redirect](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource | +| [aws_security_group_rule.allow_port_80_ingress_for_http_to_https_redirect](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource | +| [aws_security_group_rule.egress](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource | ## Inputs | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| access\_logs | An Access Logs block. | `map(string)` | `{}` | no | -| cidr\_blocks\_redirect | List of CIDR ranges to allow at security group level. Defaults to 0.0.0.0/0 | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| description | The description of the all resources. | `string` | `"Managed by Terraform"` | no | -| enable\_cross\_zone\_load\_balancing | If true, cross-zone load balancing of the load balancer will be enabled. This is a network load balancer feature. | `bool` | `false` | no | -| enable\_deletion\_protection | If true, deletion of the load balancer will be disabled via the AWS API. This will prevent Terraform from deleting the load balancer. | `bool` | `false` | no | -| enable\_http2 | Indicates whether HTTP/2 is enabled in application load balancers. | `bool` | `true` | no | -| enable\_http\_to\_https\_redirect | Enable default redirect rule from port 80 to 443. | `bool` | `false` | no | -| idle\_timeout | (Optional) The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type application. | `number` | `60` | no | -| internal | Provision an internal load balancer. Defaults to false. | `bool` | `false` | no | -| ip\_address\_type | The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 and dualstack. | `string` | `"ipv4"` | no | -| load\_balancer\_create\_timeout | Timeout value when creating the ALB. | `string` | `"15m"` | no | -| load\_balancer\_delete\_timeout | Timeout value when deleting the ALB. | `string` | `"15m"` | no | -| load\_balancer\_type | Type of load balancer to provision (network or application). | `string` | `"application"` | no | -| load\_balancer\_update\_timeout | Timeout value when updating the ALB. | `string` | `"15m"` | no | -| name\_prefix | A prefix used for naming resources. | `string` | n/a | yes | -| subnet\_mapping | A list of subnet mapping blocks describing subnets to attach to network load balancer | `list(map(string))` | `[]` | no | -| subnets | A list of subnet IDs to attach to the LB. | `list(string)` | n/a | yes | -| tags | A map of tags (key-value pairs) passed to resources. | `map(string)` | `{}` | no | -| vpc\_id | The VPC ID. | `string` | n/a | yes | +| [access\_logs](#input\_access\_logs) | An Access Logs block. | `map(string)` | `{}` | no | +| [cidr\_blocks\_redirect](#input\_cidr\_blocks\_redirect) | List of CIDR ranges to allow at security group level. Defaults to 0.0.0.0/0 | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [description](#input\_description) | The description of the all resources. | `string` | `"Managed by Terraform"` | no | +| [enable\_cross\_zone\_load\_balancing](#input\_enable\_cross\_zone\_load\_balancing) | If true, cross-zone load balancing of the load balancer will be enabled. This is a network load balancer feature. | `bool` | `false` | no | +| [enable\_deletion\_protection](#input\_enable\_deletion\_protection) | If true, deletion of the load balancer will be disabled via the AWS API. This will prevent Terraform from deleting the load balancer. | `bool` | `false` | no | +| [enable\_http2](#input\_enable\_http2) | Indicates whether HTTP/2 is enabled in application load balancers. | `bool` | `true` | no | +| [enable\_http\_to\_https\_redirect](#input\_enable\_http\_to\_https\_redirect) | Enable default redirect rule from port 80 to 443. | `bool` | `false` | no | +| [idle\_timeout](#input\_idle\_timeout) | (Optional) The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type application. | `number` | `60` | no | +| [internal](#input\_internal) | Provision an internal load balancer. Defaults to false. | `bool` | `false` | no | +| [ip\_address\_type](#input\_ip\_address\_type) | The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 and dualstack. | `string` | `"ipv4"` | no | +| [load\_balancer\_create\_timeout](#input\_load\_balancer\_create\_timeout) | Timeout value when creating the ALB. | `string` | `"15m"` | no | +| [load\_balancer\_delete\_timeout](#input\_load\_balancer\_delete\_timeout) | Timeout value when deleting the ALB. | `string` | `"15m"` | no | +| [load\_balancer\_type](#input\_load\_balancer\_type) | Type of load balancer to provision (network or application). | `string` | `"application"` | no | +| [load\_balancer\_update\_timeout](#input\_load\_balancer\_update\_timeout) | Timeout value when updating the ALB. | `string` | `"15m"` | no | +| [name\_prefix](#input\_name\_prefix) | A prefix used for naming resources. | `string` | n/a | yes | +| [subnet\_mapping](#input\_subnet\_mapping) | A list of subnet mapping blocks describing subnets to attach to network load balancer | `list(map(string))` | `[]` | no | +| [subnets](#input\_subnets) | A list of subnet IDs to attach to the LB. | `list(string)` | n/a | yes | +| [tags](#input\_tags) | A map of tags (key-value pairs) passed to resources. | `map(string)` | `{}` | no | +| [vpc\_id](#input\_vpc\_id) | The VPC ID. | `string` | n/a | yes | ## Outputs | Name | Description | |------|-------------| -| arn | The ARN of the load balancer. | -| arn\_suffix | The ARN suffix for use with CloudWatch Metrics. | -| dns\_name | The DNS name of the load balancer. | -| name | The name of the load balancer. | -| origin\_id | First part of the DNS name of the load balancer. | -| security\_group\_id | The ID of the security group. | -| zone\_id | The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record). | - +| [arn](#output\_arn) | The ARN of the load balancer. | +| [arn\_suffix](#output\_arn\_suffix) | The ARN suffix for use with CloudWatch Metrics. | +| [dns\_name](#output\_dns\_name) | The DNS name of the load balancer. | +| [name](#output\_name) | The name of the load balancer. | +| [origin\_id](#output\_origin\_id) | First part of the DNS name of the load balancer. | +| [security\_group\_id](#output\_security\_group\_id) | The ID of the security group. | +| [zone\_id](#output\_zone\_id) | The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record). | ## License diff --git a/main.tf b/main.tf index 48d8638..25ba39e 100644 --- a/main.tf +++ b/main.tf @@ -61,6 +61,8 @@ resource "aws_lb_listener" "frontend_http_to_https_redirect" { status_code = "HTTP_301" } } + + tags = var.tags } resource "aws_security_group" "main" { diff --git a/versions.tf b/versions.tf index ae35ced..61dae76 100644 --- a/versions.tf +++ b/versions.tf @@ -2,6 +2,6 @@ terraform { required_version = ">= 0.12.6" required_providers { - aws = ">= 2.45" + aws = ">= 3.40" } }