remind101 / stacker_blueprints

DEPRECATED - moved to:
https://github.com/cloudtools/stacker_blueprints
BSD 2-Clause "Simplified" License
39 stars 53 forks source link

ValueError: Route: only one of the following can be specified: EgressOnlyInternetGatewayId, GatewayId, InstanceId, NatGatewayId, NetworkInterfaceId, VpcPeeringConnectionId #143

Closed jseiser closed 6 years ago

jseiser commented 6 years ago

Working arround https://github.com/remind101/stacker_blueprints/issues/142

russellballestrini commented 6 years ago

Hey @jseiser I think we can avoid defining ec2.Route multiple times.

Lets try to do something like this:

                        route= ec2.Route(
                            route_name,
                            RouteTableId=Ref(route_table_name),
                            DestinationCidrBlock='0.0.0.0/0',
                        )
                        if variables["UseNatGateway"]:
                            route.NatGatewayId = Ref(NAT_GATEWAY_NAME % name_suffix)
                        else:
                            route.InstanceId = Ref(NAT_INSTANCE_NAME % name_suffix)
                        t.add_resource(route)