transit_gateway#

State module for managing EC2 Transit gateway

async idem_aws.states.aws.ec2.transit_gateway.present(hub, ctx, name: str, resource_id: str = None, description: str = None, options: TransitGatewayRequestOptions = None, tags: Dict[str, Any] = None) Dict[str, Any][source]#

Creates a transit gateway.

You can use a transit gateway to interconnect your virtual private clouds (VPC) and on-premises networks. After the transit gateway enters the available state, you can attach your VPCs and VPN connections to the transit gateway. To attach your VPCs, use CreateTransitGatewayVpcAttachment. To attach a VPN connection, use CreateCustomerGateway to create a customer gateway and specify the ID of the customer gateway and the ID of the transit gateway in a call to CreateVpnConnection.

When you create a transit gateway, we create a default transit gateway route table and use it as the default association route table and the default propagation route table. You can use CreateTransitGatewayRouteTable to create additional transit gateway route tables. If you disable automatic route propagation, we do not create a default transit gateway route table. You can use EnableTransitGatewayRouteTablePropagation to propagate routes from a resource attachment to a transit gateway route table. If you disable automatic associations, you can use AssociateTransitGatewayRouteTable to associate a resource attachment with a transit gateway route table.

Parameters:
  • name (str) – An Idem name of the resource.

  • resource_id (str, Optional) – AWS Transit gateway id.

  • description (str, Optional) – description for the transit gateway to identify the resource

  • options (dict[str, Any], Optional) –

    The transit gateway options. Defaults to None.

    • AmazonSideAsn (int, Optional):

      A private Autonomous System Number (ASN) for the Amazon side of a BGP session. The range is 64512 to 65534 for 16-bit ASNs and 4200000000 to 4294967294 for 32-bit ASNs. The default is 64512.

    • AutoAcceptSharedAttachments (str, Optional):

      Enable or disable automatic acceptance of attachment requests. Disabled by default.

    • DefaultRouteTableAssociation (str, Optional):

      Enable or disable automatic association with the default association route table. Enabled by default.

    • DefaultRouteTablePropagation (str, Optional):

      Enable or disable automatic propagation of routes to the default propagation route table. Enabled by default.

    • VpnEcmpSupport (str, Optional):

      Enable or disable Equal Cost Multipath Protocol support. Enabled by default.

    • DnsSupport (str, Optional):

      Enable or disable DNS support. Enabled by default.

    • MulticastSupport (str, Optional):

      Indicates whether multicast is enabled on the transit gateway

    • TransitGatewayCidrBlocks (list[str], Optional):

      One or more IPv4 or IPv6 CIDR blocks for the transit gateway. Must be a size /24 CIDR block or larger for IPv4, or a size /64 CIDR block or larger for IPv6.

  • tags (dict or list, Optional) –

    Dict in the format of {tag-key: tag-value} or List of tags in the format of [{"Key": tag-key, "Value": tag-value}] to associate with the transit gateway. Each tag consists of a key name and an associated value. Defaults to None.

    • Key (str, Optional):

      The key of the tag. Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

    • Value (str, Optional):

      The value of the tag. Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters.

Request Syntax:
[transit-gateway-resource-name]:
  aws.ec2.transit_gateway.present:
    - resource_id: 'string'
    - description: 'string'
    - options:
        AmazonSideAsn: 'int'
        AutoAcceptSharedAttachments: 'string'
        DefaultRouteTableAssociation: 'string'
        DefaultRouteTablePropagation: 'string'
        VpnEcmpSupport: 'string'
        DnsSupport: 'string'
        MulticastSupport: 'string'
        TransitGatewayCidrBlocks:
          - 'string'
          - 'string'
    - tags:
      - Key: 'string'
        Value: 'string'
Returns:

Dict[str, Any]

Examples

tgw-02994a8dda824c337:
  aws.ec2.transit_gateway.present:
    - resource_id: tgw-02994a8dda824c337
    - description: test transit gateway
    - options:
        AmazonSideAsn: 64512
        AutoAcceptSharedAttachments: enable
        DefaultRouteTableAssociation: enable
        DefaultRouteTablePropagation: enable
        DnsSupport: enable
        MulticastSupport: disable
        TransitGatewayCidrBlocks:
        - 10.0.0.0/24
        - 198.0.0.0/16
        VpnEcmpSupport: enable
    - tags:
      - Key: BU
        Value: vRA-CS-GR
      - Key: Organization
        Value: vmw
      - Key: Name
        Value: transit-gateway-2
async idem_aws.states.aws.ec2.transit_gateway.absent(hub, ctx, name: str, resource_id: str = None) Dict[str, Any][source]#

Deletes the specified transit gateway.

Parameters:
  • name (str) – An Idem name of the transit gateway.

  • resource_id (str, Optional) – AWS Transit gateway id. Idem automatically considers this resource being absent if this field is not specified.

Returns:

Dict[str, Any]

Request Syntax:
[transit-gateway-resource-name]:
  aws.ec2.transit_gateway.absent:
    - name: 'string'
    - resource_id: 'string'

Examples

tgw-02994a8dda824c337:
  aws.ec2.transit_gateway.absent:
    - name: value
    - resource_id: tgw-02994a8dda824c337
async idem_aws.states.aws.ec2.transit_gateway.describe(hub, ctx) Dict[str, Dict[str, Any]][source]#

Describe the resource in a way that can be recreated/managed with the corresponding “present” function

Describes one or more transit gateways. By default, all transit gateways are described. Alternatively, you can filter the results.

Returns:

Dict[str, Any]

Examples

$ idem describe aws.ec2.transit_gateway
idem_aws.states.aws.ec2.transit_gateway.is_pending(hub, ret)[source]#