Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add ephemeral_storage_size variable #167

Conversation

carterjones
Copy link
Contributor

@carterjones carterjones commented May 3, 2022

Description

When using this module in GovCloud, we get this error (this is sanitized):

│ Error: error modifying Lambda Function (lambda-name) configuration : InvalidParameterValueException: Ephemeral storage configuration ('ephemeralStorage') is currently not supported. Please remove the ephemeral storage parameter from your request and try again.
│ {
│   RespMetadata: {
│     StatusCode: 400,
│     RequestID: "..."
│   },
│   Message_: "Ephemeral storage configuration ('ephemeralStorage') is currently not supported. Please remove the ephemeral storage parameter from your request and try again.",
│   Type: "User"
│ }

This was fixed in 3.1.1 of terraform-aws-lambda: terraform-aws-modules/terraform-aws-lambda#304 (comment)

This PR does two things:

  1. Upgrades the version of terraform-aws-lambda to the latest: 3.2.0
  2. Allows for the configuration of ephemeral_storage_size by adding a new variable.

When adding the new variable, I followed the naming scheme I observed here (e.g.: lambda_function_variable_name_from_submodule):

variable "lambda_function_tags" {
description = "Additional tags for the Lambda function"
type = map(string)
default = {}
}
variable "lambda_function_vpc_subnet_ids" {
description = "List of subnet ids when Lambda Function should run in the VPC. Usually private or intra subnets."
type = list(string)
default = null
}
variable "lambda_function_vpc_security_group_ids" {
description = "List of security group ids when Lambda Function should run in the VPC."
type = list(string)
default = null
}
variable "lambda_function_store_on_s3" {
description = "Whether to store produced artifacts on S3 or locally."
type = bool
default = false
}
variable "lambda_function_s3_bucket" {
description = "S3 bucket to store artifacts"
type = string
default = null
}

I copied the description, type, and default from here: https://github.com/terraform-aws-modules/terraform-aws-lambda/blob/19b9f11fc8ed04a34c02db553d3f463cab6b740a/variables.tf#L112-L116

Motivation and Context

Without this change, using this module in GovCloud results in this error:

Ephemeral storage configuration ('ephemeralStorage') is currently not supported. Please remove the ephemeral storage parameter from your request and try again.

This is the same issue described here: terraform-aws-modules/terraform-aws-lambda#304

Breaking Changes

This does not break backward compatibility. The default in this module (512) is the same as the default used by the terraform-aws-lambda module (512).

How Has This Been Tested?

  • I have executed pre-commit run -a on my pull request
  • I tested this by running terraform apply with it in GovCloud. The error no longer occurs when I set lambda_function_ephemeral_storage_size to null.

@carterjones carterjones changed the title add ephemeral_storage_size variable feat: add ephemeral_storage_size variable May 3, 2022
@carterjones carterjones changed the title feat: add ephemeral_storage_size variable feat: Add ephemeral_storage_size variable May 3, 2022
@antonbabenko antonbabenko merged commit c82299a into terraform-aws-modules:master May 4, 2022
@antonbabenko
Copy link
Member

Thank you, @carterjones !

antonbabenko pushed a commit that referenced this pull request May 4, 2022
## [5.1.0](v5.0.0...v5.1.0) (2022-05-04)

### Features

* Added ephemeral_storage_size variable ([#167](#167)) ([c82299a](c82299a))
@antonbabenko
Copy link
Member

This PR is included in version 5.1.0 🎉

@github-actions
Copy link

github-actions bot commented Nov 8, 2022

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants