Skip to content

Instantly share code, notes, and snippets.

@gbvanrenswoude
Created November 10, 2021 14:38
Show Gist options
  • Save gbvanrenswoude/f6bb699b3366171a3975dffd3d94d4d1 to your computer and use it in GitHub Desktop.
Save gbvanrenswoude/f6bb699b3366171a3975dffd3d94d4d1 to your computer and use it in GitHub Desktop.
Discover subnets via ssm with AWS CDK
// tslint:disable-next-line:max-line-length
const privateSubnetID1 = ec2.Subnet.fromSubnetId(this, 'DataSourcePrivateSubnetSSMParameter1', ssm.StringParameter.fromStringParameterAttributes(this, 'DataSourceSSMSubnet1', {
parameterName: '/corp/landing-zone/vpc/subnets/private-1-id'
}).stringValue);
// SubnetSelection
vpcSubnets: { subnets: [privateSubnetID1, privateSubnetID2, privateSubnetID3] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment