route_table#

State module for managing EC2 Route Table.

hub.exec.boto3.client.ec2.associate_route_table hub.exec.boto3.client.ec2.create_route_table hub.exec.boto3.client.ec2.delete_route_table hub.exec.boto3.client.ec2.describe_route_tables hub.exec.boto3.client.ec2.disassociate_route_table resource = await hub.tool.boto3.resource.create(ctx, “ec2”, “RouteTable”, name) hub.tool.boto3.resource.exec(resource, associate_with_subnet, *args, **kwargs) hub.tool.boto3.resource.exec(resource, create_route, *args, **kwargs) hub.tool.boto3.resource.exec(resource, create_tags, *args, **kwargs) hub.tool.boto3.resource.exec(resource, delete, *args, **kwargs)

async idem_aws.states.aws.ec2.route_table.present(hub, ctx, name: str, vpc_id: str, resource_id: str = None, routes: List[Route] = None, tags: Dict[str, Any] = None) Dict[str, Any][source]#

Creates a route table for the specified VPC.

For more information, see Route tables in the Amazon Virtual Private Cloud User Guide.

Parameters:
  • name (str) – An Idem name to identify the route table resource.

  • resource_id (str, Optional) – AWS Route Table ID.

  • vpc_id (str) – AWS VPC ID.

  • routes (list[dict[str, Any]], Optional) –

    The network interfaces to associate with the instance. If you specify a network interface, you must specify any security groups and subnets as part of the network interface. Defaults to None.

    • DestinationCidrBlock (str, Optional):

      The IPv4 CIDR address block used for the destination match. Routing decisions are based on the most specific match. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to 100.68.0.0/18. Defaults to None.

    • DestinationIpv6CidrBlock (str, Optional):

      The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match. Defaults to None.

    • EgressOnlyInternetGatewayId (str, Optional):

      [IPv6 traffic only] The ID of an egress-only internet gateway. Defaults to None.

    • GatewayId (str, Optional):

      The ID of an internet gateway or virtual private gateway attached to your VPC. Defaults to None.

    • InstanceId (str, Optional):

      The ID of a NAT instance in your VPC. The operation fails if you specify an instance ID unless exactly one network interface is attached. Defaults to None.

    • InstanceOwnerId (str, Optional): T

      he ID of Amazon Web Services account that owns the instance. Defaults to None.

    • NatGatewayId (str, Optional):

      [IPv4 traffic only] The ID of a NAT gateway. Defaults to None.

    • (TransitGatewayId, str, Optional):

      The ID of a transit gateway. Defaults to None.

    • LocalGatewayId (str, Optional):

      The ID of the local gateway. Defaults to None.

    • CarrierGatewayId (str, Optional):

      The ID of the carrier gateway. You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone. Defaults to None.

    • NetworkInterfaceId (str, Optional):

      The ID of a network interface. Defaults to None.

    • VpcPeeringConnectionId (str, Optional):

      The ID of a VPC peering connection. Defaults to None.

    • CoreNetworkArn (str, Optional):

      The Amazon Resource Name (ARN) of the core network. Defaults to None.

  • 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 route table. 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:
[route_table-resource-name]:
  aws.ec2.route_table.present:
    - vpc_id: 'string'
    - resource_id: 'string'
    - routes:
      - DestinationCidrBlock: 'string'
        GatewayId: 'string'
    - tags:
      - Key: 'string'
        Value: 'string'
Returns:

Dict[str, Any]

Examples

test_route-table:
  aws.ec2.route_table.present:
    - vpc_id: vpc-02850adfa9f6fc916
    - resource_id: route_table-3485hydfe5f6tb998
    - routes:
      - DestinationCidrBlock: 198.31.0.0/16
        GatewayId: local
    - tags:
      - Key: Name
        Value: route-table-association-test
async idem_aws.states.aws.ec2.route_table.absent(hub, ctx, name: str, resource_id: str = None) Dict[str, Any][source]#

Deletes the specified route table.

You must disassociate the route table from any subnets before you can delete it. You can’t delete the main route table.

Parameters:
  • name (str) – An Idem name to identify the route table resource.

  • resource_id (str, Optional) – AWS Route Table ID. Idem automatically considers this resource being absent if this field is not specified.

Request Syntax:
[route_table-resource-id]:
  aws.ec2.route_table.absent:
    - name: "string"
    - resource_id: "string"
Returns:

Dict[str, Any]

Examples

resource_is_absent:
  aws.ec2.route_table.absent:
    - name: value
async idem_aws.states.aws.ec2.route_table.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 of your route tables. Each subnet in your VPC must be associated with a route table. If a subnet is not explicitly associated with any route table, it is implicitly associated with the main route table. This command does not return the subnet ID for implicit associations. For more information, see Route tables in the Amazon Virtual Private Cloud User Guide.

Returns:

Dict[str, Any]

Examples

$ idem describe aws.ec2.route_table