Skip to content

Instantly share code, notes, and snippets.

@1davidmichael
Created October 27, 2021 19:00
Show Gist options
  • Save 1davidmichael/52b910a00c8090eb2f9045dea4d0a058 to your computer and use it in GitHub Desktop.
Save 1davidmichael/52b910a00c8090eb2f9045dea4d0a058 to your computer and use it in GitHub Desktop.
Convert CDK VPC subnet list into CFN subnet list type
var subnetIds:String[] = [];
vpc.privateSubnets.forEach((value: ISubnet)=>{
subnetIds.push(value.subnetId)
});
const template = new cfninc.CfnInclude(this, "Template", {
templateFile: 'template.yaml',
parameters: {
"ClusterName": cluster.clusterName,
"Subnets": cdk.Fn.split(",", subnetIds.join(",")),
LogGroupName: logGroup.logGroupName
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment