Skip to content

Optional AWS-specific parameter

0

Hello,

I want to create a Cloudformation template that can take optional ListAWS::EC2::VPC::Id , ListAWS::EC2::Subnet::Id and ListAWS::EC2::SecurityGroup::Id.

My intention is to create a user-friendly cloud formation template in which if the user provides optional parameters I can use those parameters in deploying the Lambda function if the user does not provide them (Or they don't have them) I can deploy lambda without these parameters.

I know I can use CommaDelimitedList but that will not user friendly as that will not give the list of valid parameter values.

Please help.

Thanks

1 Answer
0

To make it user-friendly could you provide a list of friendly names of the different valid VPC, Subnet, SGs combinations then in the template use mappings to get the specific values in the resource definition. Also, the default friendly name could be "None" for networking, then you can use Conditions to control whether to include networking.

You could make it more dynamic by having the Friendly name be the stack name that created the network components and import those values using dynamic references.

AWS
EXPERT
answered 3 years ago
  • Thanks for your answer. Problem is I don't have a list of VPC, Subnet, and SGs as these are varies depending upon the AWS Account as these accounts are third-party.

    This is a good idea to use ListAWS::EC2::VPC::Id as this list out all available VPC but we cannot make it optional.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.