Skip to content

Commit 1690b9c

Browse files
committed
chore: Update upgrade guide
1 parent 6ba213e commit 1690b9c

File tree

13 files changed

+644
-297
lines changed

13 files changed

+644
-297
lines changed

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- master
88

99
env:
10-
TERRAFORM_DOCS_VERSION: v0.16.0
10+
TERRAFORM_DOCS_VERSION: v0.17.0
1111
TFLINT_VERSION: v0.50.3
1212

1313
jobs:

README.md

Lines changed: 80 additions & 40 deletions
Large diffs are not rendered by default.

UPGRADE-5.0.md

Lines changed: 165 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,88 @@ Please consult the `examples` directory for reference example configurations. If
55
## List of backwards incompatible changes
66

77
- Minimum supported Terraform version increased to `v1.3` to support Terraform state `moved` blocks as well as other advanced features
8+
- The `apigatewayv2_` and `default_apigatewayv2_` prefixes has been removed from the output names
9+
- When a custom domain is used, the execution endpoint is disabled automatically; this is to ensure that requests are sent via the custom domain
10+
- For `authorizers`, the `audience` and `issuer` properties are now nested under `jwt_configuration` to better match the upstream API
811

912
## Additional changes
1013

14+
- Minimum supported Terraform AWS provider raised to `v5.37.0` to support recent bug fixes in the provider
15+
- Default values for `api_key_selection_expression`, `route_selection_expression` variables set to `null` (still matches prior value v4.x version but is set as `null` now)
16+
- The input data structure for `routes` (was `integrations`) has been updated and now uses optional inputs
17+
1118
### Added
1219

13-
-
20+
- Support for creating a websocket API endpoint
21+
- Support for creating Route53 alias records for custom domain names w/ support for multiple sub-domains using a wildcard API Gateway custom domain name
22+
- Support for creating ACM certificate for custom domain
23+
- Support for automatically deploying the stage when updates have been made (for Websocket, HTTP is always auto-deployed by the API)
1424

1525
### Modified
1626

17-
-
27+
- Stage access log group settings are now embedded into the `stage_access_log_settings` variable
28+
- API mapping is created automatically when using a custom domain
29+
- Default values of 500 and 1000 have been set for `throttling_burst_limit` and `throttling_rate_limit` respectively to ensure users do not face errors when deploying APIs for the first time and not configuring these
30+
- Default values for the log group name (`"/aws/apigateway/${var.name}/${var.stage_name}"`) and retention period (`30`) have been provided for the stage access logs log group
1831

1932
### Removed
2033

21-
-
34+
- None
2235

2336
### Variable and output changes
2437

2538
1. Removed variables:
2639

27-
-
40+
- `create_api_gateway`
41+
- `create_default_stage_api_mapping`
42+
- `create_default_stage_access_log_group` -> replaced by `create_log_group` set within `stage_access_log_settings`
43+
- `default_stage_access_log_*` -> replaced by setting values within `stage_access_log_settings`
44+
- `create_vpc_link`
45+
- `default_stage_access_log_destination_arn`
46+
- `domain_name_tags`
2847

2948
2. Renamed variables:
3049

31-
-
50+
- `integrations` -> `routes`
51+
- `create_default_stage` -> `create_stage`
52+
- `create_api_domain_name` -> `create_domain_name`
53+
- `default_route_settings` -> `stage_default_route_settings`
54+
- `default_stage_tags` -> `stage_tags`
3255

3356
3. Added variables:
3457

35-
-
58+
- `create_domain_name`
59+
- `create_domain_records`
60+
- `subdomains`
61+
- `create_certificate`
62+
- `stage_access_log_settings`
63+
- `stage_client_certificate_id`
64+
- `stage_description`
65+
- `stage_name`
66+
- `stage_variables`
67+
- `deploy_stage`
3668

3769
4. Removed outputs:
3870

39-
-
71+
- `default_apigatewayv2_stage_domain_name`
72+
- `aws_apigatewayv2_api_mapping`
73+
- `apigatewayv2_vpc_link_id` -> replaced by `vpc_links`
74+
- `apigatewayv2_vpc_link_arn` -> replaced by `vpc_links`
75+
- `apigatewayv2_authorizer_id` -> replaced by `authorizers`
4076

4177
5. Renamed outputs:
4278

43-
-
79+
- `apigatewayv2_api_` -> prefix replaced with `api_`
80+
- `default_apigatewayv2_stage_` prefix replaced with `stage_`
81+
- `apigatewayv2_domain_` prefix replaced with `domain_`
4482

4583
6. Added outputs:
4684

47-
-
85+
- `acm_certificate_arn`
86+
- `integrations`
87+
- `routes`
88+
- `stage_access_logs_cloudwatch_log_group_name`
89+
- `stage_access_logs_cloudwatch_log_group_arn`
4890

4991
## Upgrade Migrations
5092

@@ -56,7 +98,119 @@ Please consult the `examples` directory for reference example configurations. If
5698
- version = "~> 4.0"
5799
+ version = "~> 5.0"
58100

101+
- create_default_stage_access_log_group = true
102+
- default_stage_access_log_format = "$context.identity.sourceIp"
103+
+ stage_access_log_settings = {
104+
+ create_log_group = true
105+
+ format = "$context.identity.sourceIp"
106+
+ }
107+
108+
authorizers = {
109+
"cognito" = {
110+
authorizer_type = "JWT"
111+
identity_sources = "$request.header.Authorization"
112+
name = "cognito"
113+
114+
- audience = ["d6a38afd-45d6-4874-d1aa-3c5c558aqcc2"]
115+
- issuer = "https://${aws_cognito_user_pool.this.endpoint}"
116+
jwt_configuration = {
117+
+ audience = ["d6a38afd-45d6-4874-d1aa-3c5c558aqcc2"]
118+
+ issuer = "https://${aws_cognito_user_pool.this.endpoint}"
119+
}
120+
}
121+
}
122+
123+
- integrations = {
124+
+ routes = {
125+
"POST /start-step-function" = {
126+
- integration_type = "AWS_PROXY"
127+
- integration_subtype = "StepFunctions-StartExecution"
128+
- credentials_arn = module.step_function.role_arn
129+
130+
- request_parameters = jsonencode({
131+
- StateMachineArn = module.step_function.state_machine_arn
132+
- })
133+
134+
- payload_format_version = "1.0"
135+
- timeout_milliseconds = 12000
136+
137+
+ integration = {
138+
+ type = "AWS_PROXY"
139+
+ subtype = "StepFunctions-StartExecution"
140+
+ credentials_arn = module.step_function.role_arn
141+
142+
+ request_parameters = {
143+
+ StateMachineArn = module.step_function.state_machine_arn
144+
+ }
145+
146+
+ payload_format_version = "1.0"
147+
+ timeout_milliseconds = 12000
148+
+ }
149+
}
150+
151+
"GET /some-route-with-authorizer-and-scope" = {
152+
- lambda_arn = module.lambda_function.lambda_function_arn
153+
- payload_format_version = "2.0"
154+
- authorization_type = "JWT"
155+
- authorizer_key = "cognito"
156+
- authorization_scopes = "tf/something.relevant.read,tf/something.relevant.write"
157+
- cognito user pool
158+
159+
+ authorization_type = "JWT"
160+
+ authorizer_key = "cognito"
161+
+ authorization_scopes = ["tf/something.relevant.read", "tf/something.relevant.write"]
162+
163+
+ integration = {
164+
+ uri = module.lambda_function.lambda_function_arn
165+
+ payload_format_version = "2.0"
166+
+ }
167+
}
168+
169+
"$default" = {
170+
- lambda_arn = module.lambda_function.lambda_function_arn
171+
- tls_config = jsonencode({
172+
- server_name_to_verify = local.domain_name
173+
- })
174+
175+
- response_parameters = jsonencode([
176+
- {
177+
- status_code = 500
178+
- mappings = {
179+
- "append:header.header1" = "$context.requestId"
180+
- "overwrite:statuscode" = "403"
181+
- }
182+
- },
183+
- {
184+
- status_code = 404
185+
- mappings = {
186+
- "append:header.error" = "$stageVariables.environmentId"
187+
- }
188+
- }
189+
- ])
190+
191+
+ integration = {
192+
+ uri = module.lambda_function.lambda_function_arn
193+
+ tls_config = jsonencode({
194+
+ server_name_to_verify = local.domain_name
195+
+ })
196+
197+
+ response_parameters = [
198+
+ {
199+
+ status_code = 500
200+
+ mappings = {
201+
+ "append:header.header1" = "$context.requestId"
202+
+ "overwrite:statuscode" = "403"
203+
+ }
204+
+ },
205+
+ {
206+
+ status_code = 404
207+
+ mappings = {
208+
+ "append:header.error" = "$stageVariables.environmentId"
209+
+ }
210+
+ }
211+
+ ]
212+
+ }
213+
}
214+
}
59215
}
60216
```
61-
62-
## Terraform State Moves

examples/complete-http/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Note that this example may create resources which cost money. Run `terraform des
3333
| Name | Source | Version |
3434
|------|--------|---------|
3535
| <a name="module_api_gateway"></a> [api\_gateway](#module\_api\_gateway) | ../../ | n/a |
36+
| <a name="module_api_gateway_disabled"></a> [api\_gateway\_disabled](#module\_api\_gateway\_disabled) | ../../ | n/a |
3637
| <a name="module_lambda_function"></a> [lambda\_function](#module\_lambda\_function) | terraform-aws-modules/lambda/aws | ~> 7.0 |
3738
| <a name="module_step_function"></a> [step\_function](#module\_step\_function) | terraform-aws-modules/step-functions/aws | ~> 4.0 |
3839

@@ -46,7 +47,7 @@ Note that this example may create resources which cost money. Run `terraform des
4647

4748
| Name | Description | Type | Default | Required |
4849
|------|-------------|------|---------|:--------:|
49-
| <a name="input_domain_name"></a> [domain\_name](#input\_domain\_name) | Custom domain name to use on API Gateway endpoint | `string` | `"*.sharedservices.clowd.haus"` | no |
50+
| <a name="input_domain_name"></a> [domain\_name](#input\_domain\_name) | Custom domain name to use on API Gateway endpoint | `string` | `"terraform-aws-modules.modules.tf"` | no |
5051

5152
## Outputs
5253

0 commit comments

Comments
 (0)