(s3-deployment): Add securityGroups to BucketDeploymentProps #33229
Labels
@aws-cdk/aws-s3-deployment
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
Describe the feature
Allow users to specify custom security groups through
BucketDeploymentProps
for enhanced network control. This enhancement ensures that teams operating in restricted environments can safely useBucketDeployment
while maintaining strict security controls. 🚀Use Case
The
BucketDeployment
construct in AWS CDK allows deploying assets to S3 buckets, often requiring a Lambda function to perform the deployment. Currently, users can specify a custom VPC viaBucketDeploymentProps
, ensuring the deployment happens within a restricted network.However, many organizations require more granular network security control. While specifying a VPC is helpful, allowing custom security groups would enable teams to define specific ingress/egress rules, meeting stricter compliance and security requirements.
Proposed Solution
Modify
BucketDeploymentProps
inbucket-deployment.ts
to include an optionalsecurityGroups
property.1. Extend
BucketDeploymentProps
2. Pass securityGroups to the deployment Lambda
Modify the BucketDeployment constructor to ensure the security groups are assigned when the Lambda function is created.
}
3. Allow Users to Define Security Groups in BucketDeployment
Developers should be able to instantiate BucketDeployment with explicitly defined security groups.
const securityGroup = new ec2.SecurityGroup(this, 'CustomSecurityGroup', { vpc });
Other Information
No response
Acknowledgements
CDK version used
2.177.0
Environment details (OS name and version, etc.)
MacOS Sequoia 15.2
The text was updated successfully, but these errors were encountered: