added tgw support in rt (#4178)
This commit is contained in:
parent
c5b63693b5
commit
1800733162
@ -4319,6 +4319,7 @@ class Route(CloudFormationModel):
|
|||||||
gateway=None,
|
gateway=None,
|
||||||
instance=None,
|
instance=None,
|
||||||
nat_gateway=None,
|
nat_gateway=None,
|
||||||
|
transit_gateway=None,
|
||||||
interface=None,
|
interface=None,
|
||||||
vpc_pcx=None,
|
vpc_pcx=None,
|
||||||
):
|
):
|
||||||
@ -4332,6 +4333,7 @@ class Route(CloudFormationModel):
|
|||||||
self.gateway = gateway
|
self.gateway = gateway
|
||||||
self.instance = instance
|
self.instance = instance
|
||||||
self.nat_gateway = nat_gateway
|
self.nat_gateway = nat_gateway
|
||||||
|
self.transit_gateway = transit_gateway
|
||||||
self.interface = interface
|
self.interface = interface
|
||||||
self.vpc_pcx = vpc_pcx
|
self.vpc_pcx = vpc_pcx
|
||||||
|
|
||||||
@ -4358,6 +4360,7 @@ class Route(CloudFormationModel):
|
|||||||
instance_id = properties.get("InstanceId")
|
instance_id = properties.get("InstanceId")
|
||||||
interface_id = properties.get("NetworkInterfaceId")
|
interface_id = properties.get("NetworkInterfaceId")
|
||||||
nat_gateway_id = properties.get("NatGatewayId")
|
nat_gateway_id = properties.get("NatGatewayId")
|
||||||
|
transit_gateway_id = properties.get("TransitGatewayId")
|
||||||
pcx_id = properties.get("VpcPeeringConnectionId")
|
pcx_id = properties.get("VpcPeeringConnectionId")
|
||||||
|
|
||||||
route_table_id = properties["RouteTableId"]
|
route_table_id = properties["RouteTableId"]
|
||||||
@ -4368,6 +4371,7 @@ class Route(CloudFormationModel):
|
|||||||
gateway_id=gateway_id,
|
gateway_id=gateway_id,
|
||||||
instance_id=instance_id,
|
instance_id=instance_id,
|
||||||
nat_gateway_id=nat_gateway_id,
|
nat_gateway_id=nat_gateway_id,
|
||||||
|
transit_gateway_id=transit_gateway_id,
|
||||||
interface_id=interface_id,
|
interface_id=interface_id,
|
||||||
vpc_peering_connection_id=pcx_id,
|
vpc_peering_connection_id=pcx_id,
|
||||||
)
|
)
|
||||||
@ -4596,11 +4600,13 @@ class RouteBackend(object):
|
|||||||
gateway_id=None,
|
gateway_id=None,
|
||||||
instance_id=None,
|
instance_id=None,
|
||||||
nat_gateway_id=None,
|
nat_gateway_id=None,
|
||||||
|
transit_gateway_id=None,
|
||||||
interface_id=None,
|
interface_id=None,
|
||||||
vpc_peering_connection_id=None,
|
vpc_peering_connection_id=None,
|
||||||
):
|
):
|
||||||
gateway = None
|
gateway = None
|
||||||
nat_gateway = None
|
nat_gateway = None
|
||||||
|
transit_gateway = None
|
||||||
|
|
||||||
route_table = self.get_route_table(route_table_id)
|
route_table = self.get_route_table(route_table_id)
|
||||||
|
|
||||||
@ -4623,6 +4629,8 @@ class RouteBackend(object):
|
|||||||
|
|
||||||
if nat_gateway_id is not None:
|
if nat_gateway_id is not None:
|
||||||
nat_gateway = self.nat_gateways.get(nat_gateway_id)
|
nat_gateway = self.nat_gateways.get(nat_gateway_id)
|
||||||
|
if transit_gateway_id is not None:
|
||||||
|
transit_gateway = self.transit_gateways.get(transit_gateway_id)
|
||||||
|
|
||||||
route = Route(
|
route = Route(
|
||||||
route_table,
|
route_table,
|
||||||
@ -4632,6 +4640,7 @@ class RouteBackend(object):
|
|||||||
gateway=gateway,
|
gateway=gateway,
|
||||||
instance=self.get_instance(instance_id) if instance_id else None,
|
instance=self.get_instance(instance_id) if instance_id else None,
|
||||||
nat_gateway=nat_gateway,
|
nat_gateway=nat_gateway,
|
||||||
|
transit_gateway=transit_gateway,
|
||||||
interface=None,
|
interface=None,
|
||||||
vpc_pcx=self.get_vpc_peering_connection(vpc_peering_connection_id)
|
vpc_pcx=self.get_vpc_peering_connection(vpc_peering_connection_id)
|
||||||
if vpc_peering_connection_id
|
if vpc_peering_connection_id
|
||||||
|
@ -21,6 +21,7 @@ class RouteTables(BaseResponse):
|
|||||||
gateway_id = self._get_param("GatewayId")
|
gateway_id = self._get_param("GatewayId")
|
||||||
instance_id = self._get_param("InstanceId")
|
instance_id = self._get_param("InstanceId")
|
||||||
nat_gateway_id = self._get_param("NatGatewayId")
|
nat_gateway_id = self._get_param("NatGatewayId")
|
||||||
|
transit_gateway_id = self._get_param("TransitGatewayId")
|
||||||
interface_id = self._get_param("NetworkInterfaceId")
|
interface_id = self._get_param("NetworkInterfaceId")
|
||||||
pcx_id = self._get_param("VpcPeeringConnectionId")
|
pcx_id = self._get_param("VpcPeeringConnectionId")
|
||||||
|
|
||||||
@ -31,6 +32,7 @@ class RouteTables(BaseResponse):
|
|||||||
gateway_id=gateway_id,
|
gateway_id=gateway_id,
|
||||||
instance_id=instance_id,
|
instance_id=instance_id,
|
||||||
nat_gateway_id=nat_gateway_id,
|
nat_gateway_id=nat_gateway_id,
|
||||||
|
transit_gateway_id=transit_gateway_id,
|
||||||
interface_id=interface_id,
|
interface_id=interface_id,
|
||||||
vpc_peering_connection_id=pcx_id,
|
vpc_peering_connection_id=pcx_id,
|
||||||
)
|
)
|
||||||
@ -198,6 +200,10 @@ DESCRIBE_ROUTE_TABLES_RESPONSE = """
|
|||||||
<natGatewayId>{{ route.nat_gateway.id }}</natGatewayId>
|
<natGatewayId>{{ route.nat_gateway.id }}</natGatewayId>
|
||||||
<state>active</state>
|
<state>active</state>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if route.transit_gateway %}
|
||||||
|
<transitGatewayId>{{ route.transit_gateway.id }}</transitGatewayId>
|
||||||
|
<state>active</state>
|
||||||
|
{% endif %}
|
||||||
</item>
|
</item>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</routeSet>
|
</routeSet>
|
||||||
|
@ -82,6 +82,7 @@ TestAccAWSRouteTable_vgwRoutePropagation
|
|||||||
TestAccAWSRouteTable_RequireRouteTarget
|
TestAccAWSRouteTable_RequireRouteTarget
|
||||||
TestAccAWSRouteTable_disappears_SubnetAssociation
|
TestAccAWSRouteTable_disappears_SubnetAssociation
|
||||||
TestAccAWSRouteTable_IPv4_To_NatGateway
|
TestAccAWSRouteTable_IPv4_To_NatGateway
|
||||||
|
TestAccAWSRouteTable_IPv4_To_TransitGateway
|
||||||
TestAccAWSRouteTable_disappears
|
TestAccAWSRouteTable_disappears
|
||||||
TestAccAWSRouteTable_basic
|
TestAccAWSRouteTable_basic
|
||||||
TestAccAwsEc2ManagedPrefixList
|
TestAccAwsEc2ManagedPrefixList
|
Loading…
x
Reference in New Issue
Block a user