-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[Enhancement] aws lambda function: Add source_kms_key_arn
argument to encrypt deployment package with custom KMS key
#44080
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
[Enhancement] aws lambda function: Add source_kms_key_arn
argument to encrypt deployment package with custom KMS key
#44080
Conversation
Community GuidelinesThis comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀 Voting for Prioritization
Pull Request Authors
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀.
% make testacc TESTARGS='-run=TestAccLambdaFunction_sourceKMSKeyARN\|TestAccLambdaFunction_basic\|TestAccLambdaFunction_code\|TestAccLambdaFunctionDataSource_' PKG=lambda ACCTEST_PARALLELISM=4
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.24.6 test ./internal/service/lambda/... -v -count 1 -parallel 4 -run=TestAccLambdaFunction_sourceKMSKeyARN\|TestAccLambdaFunction_basic\|TestAccLambdaFunction_code\|TestAccLambdaFunctionDataSource_ -timeout 360m -vet=off
2025/08/29 11:43:56 Creating Terraform AWS Provider (SDKv2-style)...
2025/08/29 11:43:56 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN TestAccLambdaFunctionDataSource_tags
=== PAUSE TestAccLambdaFunctionDataSource_tags
=== RUN TestAccLambdaFunctionDataSource_tags_NullMap
=== PAUSE TestAccLambdaFunctionDataSource_tags_NullMap
=== RUN TestAccLambdaFunctionDataSource_tags_EmptyMap
=== PAUSE TestAccLambdaFunctionDataSource_tags_EmptyMap
=== RUN TestAccLambdaFunctionDataSource_tags_DefaultTags_nonOverlapping
=== PAUSE TestAccLambdaFunctionDataSource_tags_DefaultTags_nonOverlapping
=== RUN TestAccLambdaFunctionDataSource_tags_IgnoreTags_Overlap_DefaultTag
=== PAUSE TestAccLambdaFunctionDataSource_tags_IgnoreTags_Overlap_DefaultTag
=== RUN TestAccLambdaFunctionDataSource_tags_IgnoreTags_Overlap_ResourceTag
=== PAUSE TestAccLambdaFunctionDataSource_tags_IgnoreTags_Overlap_ResourceTag
=== RUN TestAccLambdaFunctionDataSource_basic
=== PAUSE TestAccLambdaFunctionDataSource_basic
=== RUN TestAccLambdaFunctionDataSource_version
=== PAUSE TestAccLambdaFunctionDataSource_version
=== RUN TestAccLambdaFunctionDataSource_versionWithReservedConcurrency
=== PAUSE TestAccLambdaFunctionDataSource_versionWithReservedConcurrency
=== RUN TestAccLambdaFunctionDataSource_latestVersion
=== PAUSE TestAccLambdaFunctionDataSource_latestVersion
=== RUN TestAccLambdaFunctionDataSource_unpublishedVersion
=== PAUSE TestAccLambdaFunctionDataSource_unpublishedVersion
=== RUN TestAccLambdaFunctionDataSource_alias
=== PAUSE TestAccLambdaFunctionDataSource_alias
=== RUN TestAccLambdaFunctionDataSource_layers
=== PAUSE TestAccLambdaFunctionDataSource_layers
=== RUN TestAccLambdaFunctionDataSource_vpc
=== PAUSE TestAccLambdaFunctionDataSource_vpc
=== RUN TestAccLambdaFunctionDataSource_environment
=== PAUSE TestAccLambdaFunctionDataSource_environment
=== RUN TestAccLambdaFunctionDataSource_fileSystem
=== PAUSE TestAccLambdaFunctionDataSource_fileSystem
=== RUN TestAccLambdaFunctionDataSource_image
=== PAUSE TestAccLambdaFunctionDataSource_image
=== RUN TestAccLambdaFunctionDataSource_architectures
=== PAUSE TestAccLambdaFunctionDataSource_architectures
=== RUN TestAccLambdaFunctionDataSource_ephemeralStorage
=== PAUSE TestAccLambdaFunctionDataSource_ephemeralStorage
=== RUN TestAccLambdaFunctionDataSource_loggingConfig
=== PAUSE TestAccLambdaFunctionDataSource_loggingConfig
=== RUN TestAccLambdaFunction_basic
=== PAUSE TestAccLambdaFunction_basic
=== RUN TestAccLambdaFunction_codeSigning
=== PAUSE TestAccLambdaFunction_codeSigning
=== RUN TestAccLambdaFunction_sourceKMSKeyARN
=== PAUSE TestAccLambdaFunction_sourceKMSKeyARN
=== CONT TestAccLambdaFunctionDataSource_tags
=== CONT TestAccLambdaFunctionDataSource_layers
=== CONT TestAccLambdaFunctionDataSource_basic
=== CONT TestAccLambdaFunctionDataSource_ephemeralStorage
--- PASS: TestAccLambdaFunctionDataSource_ephemeralStorage (27.69s)
=== CONT TestAccLambdaFunctionDataSource_tags_DefaultTags_nonOverlapping
--- PASS: TestAccLambdaFunctionDataSource_tags (33.84s)
=== CONT TestAccLambdaFunctionDataSource_tags_IgnoreTags_Overlap_ResourceTag
--- PASS: TestAccLambdaFunctionDataSource_basic (39.89s)
=== CONT TestAccLambdaFunctionDataSource_tags_IgnoreTags_Overlap_DefaultTag
--- PASS: TestAccLambdaFunctionDataSource_layers (46.06s)
=== CONT TestAccLambdaFunctionDataSource_fileSystem
--- PASS: TestAccLambdaFunctionDataSource_tags_DefaultTags_nonOverlapping (25.96s)
=== CONT TestAccLambdaFunctionDataSource_architectures
--- PASS: TestAccLambdaFunctionDataSource_tags_IgnoreTags_Overlap_ResourceTag (26.39s)
=== CONT TestAccLambdaFunctionDataSource_image
function_data_source_test.go:403: AWS_LAMBDA_IMAGE_LATEST_ID env var must be set for Lambda Function Data Source Image Support acceptance tests.
--- SKIP: TestAccLambdaFunctionDataSource_image (0.00s)
=== CONT TestAccLambdaFunctionDataSource_tags_EmptyMap
--- PASS: TestAccLambdaFunctionDataSource_tags_IgnoreTags_Overlap_DefaultTag (27.09s)
=== CONT TestAccLambdaFunctionDataSource_environment
--- PASS: TestAccLambdaFunctionDataSource_architectures (27.72s)
=== CONT TestAccLambdaFunction_codeSigning
--- PASS: TestAccLambdaFunctionDataSource_tags_EmptyMap (27.17s)
=== CONT TestAccLambdaFunction_sourceKMSKeyARN
--- PASS: TestAccLambdaFunctionDataSource_environment (27.17s)
=== CONT TestAccLambdaFunctionDataSource_tags_NullMap
--- PASS: TestAccLambdaFunctionDataSource_tags_NullMap (29.40s)
=== CONT TestAccLambdaFunctionDataSource_vpc
--- PASS: TestAccLambdaFunction_codeSigning (59.56s)
=== CONT TestAccLambdaFunction_basic
--- PASS: TestAccLambdaFunction_sourceKMSKeyARN (434.26s)
=== CONT TestAccLambdaFunctionDataSource_versionWithReservedConcurrency
--- PASS: TestAccLambdaFunction_basic (389.96s)
=== CONT TestAccLambdaFunctionDataSource_alias
--- PASS: TestAccLambdaFunctionDataSource_versionWithReservedConcurrency (27.08s)
=== CONT TestAccLambdaFunctionDataSource_latestVersion
--- PASS: TestAccLambdaFunctionDataSource_alias (32.91s)
=== CONT TestAccLambdaFunctionDataSource_version
--- PASS: TestAccLambdaFunctionDataSource_latestVersion (30.22s)
=== CONT TestAccLambdaFunctionDataSource_loggingConfig
--- PASS: TestAccLambdaFunctionDataSource_version (29.58s)
=== CONT TestAccLambdaFunctionDataSource_unpublishedVersion
--- PASS: TestAccLambdaFunctionDataSource_unpublishedVersion (29.43s)
--- PASS: TestAccLambdaFunctionDataSource_loggingConfig (44.44s)
--- PASS: TestAccLambdaFunctionDataSource_fileSystem (658.56s)
--- PASS: TestAccLambdaFunctionDataSource_vpc (750.71s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/lambda 879.994s
@tabito-hara Thanks for the contribution 🎉 👏. |
Warning This Issue has been closed, meaning that any additional comments are much easier for the maintainers to miss. Please assume that the maintainers will not see them. Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed. |
This functionality has been released in v6.12.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
Rollback Plan
If a change needs to be reverted, we will publish an updated version of the library.
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
Description
source_kms_key_arn
argument to allow users to provide their own KMS key for encrypting Lambda function source code.Relations
Closes #43055
Closes #40276
References
https://docs.aws.amazon.com/lambda/latest/api/API_CreateFunction.html
https://docs.aws.amazon.com/lambda/latest/api/API_UpdateFunction.html
https://docs.aws.amazon.com/lambda/latest/api/API_GetFunction.html
Output from Acceptance Testing