route#

async idem_aws.exec.aws.ec2.route.get(hub, ctx, *, name: str, route_table_id: str = None, destination_cidr_block: str = None, destination_ipv6_cidr_block: str = None, destination_prefix_list_id: str = None, resource_id: str = None) Dict[str, Any][source]#

Check if a route is attached to a route table. If resource_id is received as input search is done using only resource_id, If other parameters are specified they will be ignored. If resource_id is not specified then route_table_id and one of the destination should be specified. If more than one destination is specified search is done using only one destination in the priority order destination_cidr_block, destination_ipv6_cidr_block, destination_prefix_list_id

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

  • route_table_id (str, Optional) – The ID of the route table for the route.

  • destination_cidr_block (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.

  • destination_ipv6_cidr_block (str, Optional) – The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match. Defaults to None.

  • destination_prefix_list_id (str, Optional) – The ID of a prefix list used for the destination match. Defaults to None.

  • resource_id (str, Optional) – Unique identifier to identify the route in a route table. format of resource id is <route_table_id>/<destination_cidr_block or destination_ipv6_cidr_block or destination_prefix_list_id>

Returns

Dict[bool, list, dict or None]:

result(bool):

Whether the result of the function has been successful (True) or not (False).

comment(list):

A list of messages.

ret(dict or None):

The EC2 route in “present” format.

Examples

Calling this exec module function from the cli:

idem exec aws.ec2.route.get name="idem_name" resource_id="resource_id"

Calling this exec module function from within a state module in pure python:

async def state_function(hub, ctx, name, resource_id, **kwargs):
    ret = await hub.exec.aws.ec2.route.get(
        ctx, name=name, resource_id=resource_id
    )

Using in a state:

my_unmanaged_resource:
  exec.run:
    - path: aws.ec2.route.get
    - kwargs:
        name: my_resource
        resource_id: resource_id