EC2 / Client / create_transit_gateway_policy_table_entry

create_transit_gateway_policy_table_entry

EC2.Client.create_transit_gateway_policy_table_entry(**kwargs)

Creates an entry in a transit gateway policy table to route matching traffic to a specified route table.

See also: AWS API Documentation

Request Syntax

response = client.create_transit_gateway_policy_table_entry(
    TransitGatewayPolicyTableId='string',
    PolicyRuleNumber='string',
    PolicyRule={
        'SourceCidrBlock': 'string',
        'SourcePortRange': 'string',
        'DestinationCidrBlock': 'string',
        'DestinationPortRange': 'string',
        'Protocol': 'string',
        'MetaData': {
            'MetaDataKey': 'string',
            'MetaDataValue': 'string'
        }
    },
    TargetRouteTableId='string',
    DryRun=True|False
)
Parameters:
  • TransitGatewayPolicyTableId (string) –

    [REQUIRED]

    The ID of the transit gateway policy table.

  • PolicyRuleNumber (string) –

    [REQUIRED]

    The rule number for the policy table entry. Lower rule numbers are evaluated first and take precedence.

  • PolicyRule (dict) –

    The matching criteria for the policy table entry.

    • SourceCidrBlock (string) –

      The source CIDR block for the policy rule.

    • SourcePortRange (string) –

      The source port or port range for the policy rule. You can specify a port range only when Protocol is 6 (TCP) or 17 (UDP); for all other protocols, this value must be *.

    • DestinationCidrBlock (string) –

      The destination CIDR block for the policy rule.

    • DestinationPortRange (string) –

      The destination port or port range for the policy rule. You can specify a port range only when Protocol is 6 (TCP) or 17 (UDP); for all other protocols, this value must be *.

    • Protocol (string) –

      The protocol for the policy rule. Valid values are 1 (ICMP), 6 (TCP), 17 (UDP), 47 (GRE), or * for all protocols.

    • MetaData (dict) –

      The metadata key-value pair for the policy rule.

      • MetaDataKey (string) –

        The key of the metadata pair for the policy rule.

      • MetaDataValue (string) –

        The value of the metadata pair for the policy rule.

  • TargetRouteTableId (string) –

    [REQUIRED]

    The ID of the transit gateway route table to use for traffic matching this rule.

  • DryRun (boolean) – Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Return type:

dict

Returns:

Response Syntax

{
    'TransitGatewayPolicyTableEntry': {
        'PolicyRuleNumber': 'string',
        'PolicyRule': {
            'SourceCidrBlock': 'string',
            'SourcePortRange': 'string',
            'DestinationCidrBlock': 'string',
            'DestinationPortRange': 'string',
            'Protocol': 'string',
            'MetaData': {
                'MetaDataKey': 'string',
                'MetaDataValue': 'string'
            }
        },
        'TargetRouteTableId': 'string',
        'State': 'active'|'deleted'
    }
}

Response Structure

  • (dict) –

    • TransitGatewayPolicyTableEntry (dict) –

      Describes a transit gateway policy table entry

      • PolicyRuleNumber (string) –

        The rule number for the transit gateway policy table entry.

      • PolicyRule (dict) –

        The policy rule associated with the transit gateway policy table.

        • SourceCidrBlock (string) –

          The source CIDR block for the transit gateway policy rule.

        • SourcePortRange (string) –

          The source port or port range for the transit gateway policy rule.

        • DestinationCidrBlock (string) –

          The destination CIDR block for the transit gateway policy rule.

        • DestinationPortRange (string) –

          The destination port or port range for the transit gateway policy rule.

        • Protocol (string) –

          The protocol used by the transit gateway policy rule.

        • MetaData (dict) –

          The meta data tags used for the transit gateway policy rule.

          • MetaDataKey (string) –

            The key name for the transit gateway policy rule meta data tag.

          • MetaDataValue (string) –

            The value of the key for the transit gateway policy rule meta data tag.

      • TargetRouteTableId (string) –

        The ID of the target route table.

      • State (string) –

        The state of the transit gateway policy table entry.