aws / aws/aws-cdk

aws-cdk-lib.aws_s3_deployment.BucketDeployment: Unable to configure Custom Resource Environment Variables Encryption

Open
#26,959 1 comment 1 reaction 0 assignees View on GitHub
aws-cdk-lib effort/medium feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
1d 19h
Merged PRs (30d)
74

Description

### Describe the feature

We are required by our enterprise to enable Encryption at Rest for Lambda Environment Variables using Customer Master Keys.

We are unable to find any capability on the BucketDeployment construct (version 2.93.0) to be able to configure the Customer Resource (Lambda) that is provisioned. The construct has the capability to configure the S3 bucket encryption but not the custom resource.

https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3_deployment.BucketDeployment.html

The workarounds that we understand are possible currently are:

- manually configured via the Console
- via a CLI to update the Lambda after our cdk automation runs
- use the low level cdk constructs to find the lambda function and set it

All the above workarounds are not ideal and we would much prefer that BucketDeployment provided this capability.

Have we missed something and there is a way to do this via BucketDeployment? Or is this a feature request and if so please add this feature request to your backlog?

### Use Case

I am required by my enterprise standards to enable Encryption at Rest for Lambda Environment Variables using Customer Master Keys, including the Custom Resource (Lambda) that is provisioned by the BucketDeployment construct.

### Proposed Solution

_No response_

### Other Information

_No response_

### Acknowledgements

- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### CDK version used

2.93.0

### Environment details (OS name and version, etc.)

aws-cdk-lib aws_codebuild LinuxBuildImage.STANDARD_6_0

Contributor guide

Open the contributing guide

Research direction

Start with the aws_s3_deployment.BucketDeployment API documentation and its construct implementation, then trace the provisioned custom-resource Lambda. Compare the existing S3 bucket encryption configuration with the requested customer-managed-key setting and define tests for the generated Lambda configuration. Done means BucketDeployment exposes and applies this option through CDK.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.