Skip to content

Commit f2a3166

Browse files
authored
feat(s3-deployment): support securityGroups in BucketDeploymentProps (#33233)
### Issue 33229 closes #33229 ### Reason for this change 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** via `BucketDeploymentProps`, 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. ### Description of changes - **Updated `BucketDeploymentProps`** to include an optional `securityGroups?: ec2.ISecurityGroup[]` property. - **Modified `BucketDeployment` constructor** to pass `securityGroups` to the Lambda function. - **Ensured backward compatibility** by keeping `securityGroups` optional. - **Updated README** to include guidance on setting ``vpc``, ``vpcSubnets``, and ``securityGroups`` parameters. - **Testing** has been implemented at a unit test and integration test level for all new logic.. - **Improved** unit testing patterns through all other unit tests in this module. ### Describe any new or updated permissions being added N/A ### Description of how you validated changes Added unit tests to the relevant code modules to cover feature usage. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 9d1c05c commit f2a3166

File tree

262 files changed

+124630
-102208
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

262 files changed

+124630
-102208
lines changed
Lines changed: 23 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-big-response.js.snapshot/integtestbucketdeploymentsDefaultTestDeployAssertCF25A2DF.assets.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)