aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.7k stars 3.93k forks source link

(ec2-alpha): Support mapPublicIpOnLaunch prop in SubnetV2 #32159

Open nick-kang opened 6 days ago

nick-kang commented 6 days ago

Describe the feature

Subnet v1 supports the mapPublicIpOnLaunch prop while SubnetV2 does not. Add support for that prop.

https://github.com/aws/aws-cdk/blob/v2.167.1/packages/aws-cdk-lib/aws-ec2/lib/vpc.ts#L2091-L2097

Use Case

To maintain feature parity with Subnet V1.

mapPublicIpOnLaunch is useful for public asgs templates. https://stackoverflow.com/questions/72285006/how-to-enable-public-ip-addresses-when-using-autoscaling-group-launch-templates

Proposed Solution

No response

Other Information

No response

Acknowledgements

CDK version used

2.167.0-alpha.0

Environment details (OS name and version, etc.)

MacOS

pahud commented 4 days ago

related to https://github.com/aws/aws-cdk-rfcs/issues/507