In CloudFormation How do I reference the VPC Id from a chosen subnet id? -




i creating ec2 instance cf template, , choose subnet on3 of parameters. once have chosen subnet, there way cloudformation find vpc id of subnet?

i'm afraid there isn't easy way vpc id automatically subnet id, cloudformation limitation @ moment. have 2 main options getting around this:

easiest option: pass in vpc id parameter matches subnet id.

harder option: create custom resource, lambda easiest way, gets vpc id subnet id. amazon has sample on creating custom resource values up.

looking around found someone has built library executing cli commands lambda custom resource. option if building own lambda function bit much.





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -