Skip to content

Commit de14c89

Browse files
committed
docs: Add UPGRADE guide
1 parent c54a696 commit de14c89

File tree

12 files changed

+204
-129
lines changed

12 files changed

+204
-129
lines changed

README.md

Lines changed: 31 additions & 26 deletions
Large diffs are not rendered by default.

docs/UPGRADE-10.0.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Upgrade from v9.x to v10.x
2+
3+
Please consult the `examples` directory for reference example configurations. If you find a bug, please open an issue with supporting configuration to reproduce.
4+
5+
## List of backwards incompatible changes
6+
7+
- Terraform `v1.5.7` is now minimum supported version
8+
- AWS provider `v6.5` is now minimum supported version
9+
10+
## Additional changes
11+
12+
### Added
13+
14+
- Support for `region` parameter to specify the AWS region for the resources created if different from the provider region.
15+
16+
### Modified
17+
18+
- Variable definitions now contain detailed `object` types in place of the previously used any type.
19+
- Security group rules now use a default naming scheme of `<security-group-name>-<map-key>` unless a more specific rule name is provided.
20+
- `rule.actions.type` has been replaced with `rule.actions.<type>`. See before/after below for more details.
21+
- `query_string` supports a list of key:value pairs; type definition updated to support this (i.e. was `map(string)` and is now `list(map(string))`)
22+
23+
### Removed
24+
25+
- None
26+
27+
### Variable and output changes
28+
29+
1. Removed variables:
30+
31+
- None
32+
33+
2. Renamed variables:
34+
35+
- None
36+
37+
3. Added variables:
38+
39+
- None
40+
41+
4. Removed outputs:
42+
43+
- None
44+
45+
5. Renamed outputs:
46+
47+
- None
48+
49+
6. Added outputs:
50+
51+
- None
52+
53+
## Upgrade Migrations
54+
55+
### Diff of Before vs After
56+
57+
```hcl
58+
module "alb" {
59+
source = "terraform-aws-modules/alb/aws"
60+
- version = "9.17.0"
61+
+ version = "10.0.0"
62+
63+
listeners = {
64+
ex-http-https-redirect = {
65+
port = 80
66+
protocol = "HTTP"
67+
redirect = {
68+
port = "443"
69+
protocol = "HTTPS"
70+
status_code = "HTTP_301"
71+
}
72+
73+
rules = {
74+
ex-fixed-response = {
75+
priority = 3
76+
actions = [{
77+
# Same for all action types, not just `fixed_response`
78+
- type = "fixed-response"
79+
+ fixed_response = {
80+
content_type = "text/plain"
81+
status_code = 200
82+
message_body = "This is a fixed response"
83+
+ }
84+
}]
85+
86+
conditions = [{
87+
- query_string = {
88+
+ query_string = [{
89+
key = "weighted"
90+
value = "true"
91+
- }
92+
+ }]
93+
}]
94+
}
95+
}
96+
}
97+
}
98+
}
99+
```
100+
101+
## Terraform State Moves
102+
103+
None required

docs/patterns.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,12 @@ module "alb" {
226226
weighted_forward = {
227227
target_groups = [
228228
{
229-
target_group_key = "ex-lambda-with-trigger"
230-
weight = 60
229+
key = "ex-lambda-with-trigger"
230+
weight = 60
231231
},
232232
{
233-
target_group_key = "ex-lambda-without-trigger"
234-
weight = 40
233+
key = "ex-lambda-without-trigger"
234+
weight = 40
235235
}
236236
]
237237
}
@@ -257,7 +257,7 @@ module "alb" {
257257
258258
module "lambda_with_allowed_triggers" {
259259
source = "terraform-aws-modules/lambda/aws"
260-
version = "~> 6.0"
260+
version = "~> 8.0"
261261
262262
# Truncated for brevity ...
263263
@@ -271,7 +271,7 @@ module "lambda_with_allowed_triggers" {
271271
272272
module "lambda_without_allowed_triggers" {
273273
source = "terraform-aws-modules/lambda/aws"
274-
version = "~> 6.0"
274+
version = "~> 8.0"
275275
276276
# Truncated for brevity ...
277277

examples/complete-alb/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Note that this example may create resources which cost money. Run `terraform des
6464

6565
| Name | Description | Type | Default | Required |
6666
|------|-------------|------|---------|:--------:|
67-
| <a name="input_domain_name"></a> [domain\_name](#input\_domain\_name) | The domain name for which the certificate should be issued | `string` | `"terraform-aws-modules.modules.tf"` | no |
67+
| <a name="input_domain_name"></a> [domain\_name](#input\_domain\_name) | The domain name for which the certificate should be issued | `string` | `"sharedservices.clowd.haus"` | no |
6868

6969
## Outputs
7070

examples/complete-alb/main.tf

Lines changed: 18 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,6 @@ module "alb" {
6767
prefix = "connection-logs"
6868
}
6969

70-
minimum_load_balancer_capacity = {
71-
capacity_units = 10
72-
}
73-
7470
client_keep_alive = 7200
7571

7672
listeners = {
@@ -165,12 +161,12 @@ module "alb" {
165161
weighted_forward = {
166162
target_groups = [
167163
{
168-
key = "ex-lambda-with-trigger"
169-
weight = 60
164+
target_group_key = "ex-lambda-with-trigger"
165+
weight = 60
170166
},
171167
{
172-
key = "ex-instance"
173-
weight = 40
168+
target_group_key = "ex-instance"
169+
weight = 40
174170
}
175171
]
176172
}
@@ -248,12 +244,12 @@ module "alb" {
248244
weighted_forward = {
249245
target_groups = [
250246
{
251-
key = "ex-instance"
252-
weight = 2
247+
target_group_key = "ex-instance"
248+
weight = 2
253249
},
254250
{
255-
key = "ex-lambda-with-trigger"
256-
weight = 1
251+
target_group_key = "ex-lambda-with-trigger"
252+
weight = 1
257253
}
258254
]
259255
stickiness = {
@@ -375,53 +371,6 @@ module "alb" {
375371
target_group_key = "ex-instance"
376372
}
377373
}
378-
379-
ex-response-headers = {
380-
port = "443"
381-
protocol = "HTTPS"
382-
ssl_policy = "ELBSecurityPolicy-TLS13-1-2-Res-2021-06"
383-
certificate_arn = module.acm.acm_certificate_arn
384-
385-
fixed_response = {
386-
content_type = "text/plain"
387-
message_body = "Fixed message"
388-
status_code = "200"
389-
}
390-
391-
routing_http_response_server_enabled = false
392-
routing_http_response_strict_transport_security_header_value = "max-age=31536000; includeSubDomains; preload"
393-
routing_http_response_access_control_allow_origin_header_value = "https://example.com"
394-
routing_http_response_access_control_allow_methods_header_value = "TRACE,GET"
395-
routing_http_response_access_control_allow_headers_header_value = "Accept-Language,Content-Language"
396-
routing_http_response_access_control_allow_credentials_header_value = "true"
397-
routing_http_response_access_control_expose_headers_header_value = "Cache-Control"
398-
routing_http_response_access_control_max_age_header_value = 86400
399-
routing_http_response_content_security_policy_header_value = "*"
400-
routing_http_response_x_content_type_options_header_value = "nosniff"
401-
routing_http_response_x_frame_options_header_value = "SAMEORIGIN"
402-
}
403-
404-
ex-request-headers = {
405-
port = "443"
406-
protocol = "HTTPS"
407-
ssl_policy = "ELBSecurityPolicy-TLS13-1-2-Res-2021-06"
408-
certificate_arn = module.acm.acm_certificate_arn
409-
410-
fixed_response = {
411-
content_type = "text/plain"
412-
message_body = "Fixed message"
413-
status_code = "200"
414-
}
415-
416-
routing_http_request_x_amzn_tls_version_header_name = "X-Amzn-Tls-Version-Custom"
417-
routing_http_request_x_amzn_tls_cipher_suite_header_name = "X-Amzn-Tls-Cipher-Suite-Custom"
418-
routing_http_request_x_amzn_mtls_clientcert_header_name = "X-Amzn-Mtls-Clientcert-Custom"
419-
routing_http_request_x_amzn_mtls_clientcert_serial_number_header_name = "X-Amzn-Mtls-Clientcert-Serial-Number-Custom"
420-
routing_http_request_x_amzn_mtls_clientcert_issuer_header_name = "X-Amzn-Mtls-Clientcert-Issuer-Custom"
421-
routing_http_request_x_amzn_mtls_clientcert_subject_header_name = "X-Amzn-Mtls-Clientcert-Subject-Custom"
422-
routing_http_request_x_amzn_mtls_clientcert_validity_header_name = "X-Amzn-Mtls-Clientcert-Validity-Custom"
423-
routing_http_request_x_amzn_mtls_clientcert_leaf_header_name = "X-Amzn-Mtls-Clientcert-Leaf-Custom"
424-
}
425374
}
426375

427376
target_groups = {
@@ -598,16 +547,22 @@ module "acm" {
598547
source = "terraform-aws-modules/acm/aws"
599548
version = "~> 6.0"
600549

601-
domain_name = var.domain_name
602-
zone_id = data.aws_route53_zone.this.id
550+
domain_name = var.domain_name
551+
zone_id = data.aws_route53_zone.this.id
552+
validation_method = "DNS"
553+
554+
tags = local.tags
603555
}
604556

605557
module "wildcard_cert" {
606558
source = "terraform-aws-modules/acm/aws"
607559
version = "~> 6.0"
608560

609-
domain_name = "*.${var.domain_name}"
610-
zone_id = data.aws_route53_zone.this.id
561+
domain_name = "*.${var.domain_name}"
562+
zone_id = data.aws_route53_zone.this.id
563+
validation_method = "DNS"
564+
565+
tags = local.tags
611566
}
612567

613568
data "aws_ssm_parameter" "al2023" {

examples/complete-alb/variables.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
variable "domain_name" {
22
description = "The domain name for which the certificate should be issued"
33
type = string
4-
default = "terraform-aws-modules.modules.tf"
4+
# default = "terraform-aws-modules.modules.tf"
5+
default = "sharedservices.clowd.haus"
56
}

examples/complete-nlb/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Note that this example may create resources which cost money. Run `terraform des
5151

5252
| Name | Description | Type | Default | Required |
5353
|------|-------------|------|---------|:--------:|
54-
| <a name="input_domain_name"></a> [domain\_name](#input\_domain\_name) | The domain name for which the certificate should be issued | `string` | `"terraform-aws-modules.modules.tf"` | no |
54+
| <a name="input_domain_name"></a> [domain\_name](#input\_domain\_name) | The domain name for which the certificate should be issued | `string` | `"sharedservices.clowd.haus"` | no |
5555

5656
## Outputs
5757

examples/complete-nlb/main.tf

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,11 @@ module "acm" {
197197
source = "terraform-aws-modules/acm/aws"
198198
version = "~> 6.0"
199199

200-
domain_name = var.domain_name
201-
zone_id = data.aws_route53_zone.this.id
200+
domain_name = var.domain_name
201+
zone_id = data.aws_route53_zone.this.id
202+
validation_method = "DNS"
203+
204+
tags = local.tags
202205
}
203206

204207
resource "aws_eip" "this" {

examples/complete-nlb/variables.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
variable "domain_name" {
22
description = "The domain name for which the certificate should be issued"
33
type = string
4-
default = "terraform-aws-modules.modules.tf"
4+
# default = "terraform-aws-modules.modules.tf"
5+
default = "sharedservices.clowd.haus"
56
}

examples/mutual-auth-alb/main.tf

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,11 @@ module "acm" {
237237
source = "terraform-aws-modules/acm/aws"
238238
version = "~> 6.0"
239239

240-
domain_name = "*.${var.domain_name}"
241-
zone_id = data.aws_route53_zone.this.id
240+
domain_name = "*.${var.domain_name}"
241+
zone_id = data.aws_route53_zone.this.id
242+
validation_method = "DNS"
243+
244+
tags = local.tags
242245
}
243246

244247
resource "null_resource" "generate_crl" {

0 commit comments

Comments
 (0)