Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Andriy Knysh <[email protected]>
  • Loading branch information
milldr and aknysh authored Feb 8, 2024
1 parent b245d3d commit a185645
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions modules/spa-s3-cloudfront/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ If you have `var.preview_environment_enabled` or `var.lambda_edge_redirect_404_e

#### Upgrading with both `preview_environment_enabled: false` and `lambda_edge_redirect_404_enabled: false`

If you have no Lambda@Edge functions deployed and where both `var.preview_environment_enabled` and `var.lambda_edge_redirect_404_enabled` are `false` (the default value), no change is necssary.
If you have no Lambda@Edge functions deployed and where both `var.preview_environment_enabled` and `var.lambda_edge_redirect_404_enabled` are `false` (the default value), no change is necessary.

### Lambda Runtime Version

The previous PR [#946](https://github.com/cloudposse/terraform-aws-components/pull/946) introduced the `var.lambda_runtime` input. Previously, the version of node in both submodules was hard-coded to be `nodejs12.x`. This PR sets renames that variable to `var.lambda_edge_runtime` and sets the default to `nodejs16.x`.
The previous PR [#946](https://github.com/cloudposse/terraform-aws-components/pull/946) introduced the `var.lambda_runtime` input. Previously, the version of node in both submodules was hard-coded to be `nodejs12.x`. This PR renames that variable to `var.lambda_edge_runtime` and sets the default to `nodejs16.x`.

If you want to maintain the previous version of node, set `var.lambda_edge_runtime` to `nodejs12.x`, though be aware that AWS deprecated that version on March 31, 2023, and lambdas using that environment may no longer work. Otherwise, this component will attempt to deploy the functions with runtime `nodejs16.x`.
If you want to maintain the previous version of Node, set `var.lambda_edge_runtime` to `nodejs12.x`, though be aware that AWS deprecated that version on March 31, 2023, and lambdas using that environment may no longer work. Otherwise, this component will attempt to deploy the functions with runtime `nodejs16.x`.

- [See all available runtimes here](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateFunction.html#SSS-CreateFunction-request-Runtime)
- [See runtime environment deprecation dates here](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy)
2 changes: 1 addition & 1 deletion modules/spa-s3-cloudfront/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ components:
enabled: true
lambda_edge_functions:
viewer_request: # overwrite existing function
source: null # this overwrites the 404 viewer request source with deep merge
source: null # this overwrites the 404 viewer request source with deep merging
source_zip: "./dist/lambda_edge_paywall_viewer_request.zip"
runtime: "nodejs16.x"
handler: "index.handler"
Expand Down
2 changes: 1 addition & 1 deletion modules/spa-s3-cloudfront/remote-state.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module "github_runners" {
component = var.github_runners_component_name
stage = var.github_runners_stage_name
environment = var.github_runners_environment_name
tenant = try(var.github_runners_tenant_name, var.tenant)
tenant = try(var.github_runners_tenant_name, module.this.tenant)

context = module.this.context
}
4 changes: 2 additions & 2 deletions modules/spa-s3-cloudfront/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ variable "lambda_edge_functions" {
description = <<-EOT
Lambda@Edge functions to create.
The key of this map is the name label of the Lambda@Edge function.
The key of this map is the name of the Lambda@Edge function.
This map will be deep merged with each enabled default function. Use deep merge to change or overwrite specific values passed by those function objects.
EOT
Expand Down Expand Up @@ -535,7 +535,7 @@ variable "lambda_edge_handler" {

variable "lambda_edge_allowed_ssm_parameters" {
type = list(string)
description = "The Lambda@Edge functions will be allowed to access this list of AWS SSM parameter ARN strings"
description = "The Lambda@Edge functions will be allowed to access the list of AWS SSM parameter with these ARNs"
default = []
}

Expand Down

0 comments on commit a185645

Please sign in to comment.