我想根据参数值创建资源。我怎样才能做到这一点
例如:
vpc_create = core.CfnParameter(stack, "createVPC")
condition = core.CfnCondition(stack,
"testeCondition",
expression=core.Fn.condition_equals(vpc_create, True)
)
vpc = ec2.Vpc(stack, "MyVpc", max_azs=3)
如果参数为true,如何为正在创建的VPC向VPC资源添加条件
我认为我需要获得云信息资源,类似这样的东西:
vpc.node.default_child # And I think this returns an object from ec2.CfnVPC class, but I'm stuck here.
谢谢
使用
context
数据可以有条件地创建资源和许多其他灵活性。AWS本身建议context
优于parameters
请在https://docs.aws.amazon.com/cdk/latest/guide/parameters.html全文阅读
相关问题 更多 >
编程相关推荐