1. Registry
  2. Packages
  3. AWS
  4. API Docs
  5. ec2transitgateway
  6. PolicyTableEntry
Viewing docs for AWS v7.48.0
published on Tuesday, Sep 22, 2026 by Pulumi
aws logo aws logo
Viewing docs for AWS v7.48.0
published on Tuesday, Sep 22, 2026 by Pulumi

    Manages an EC2 Transit Gateway Policy Table Entry. Each entry defines a traffic matching rule within a Transit Gateway Policy Table that routes matching traffic to a specified transit gateway route table, enabling Policy-Based Routing (PBR).

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.ec2transitgateway.PolicyTableEntry("example", {
        transitGatewayPolicyTableId: exampleAwsEc2TransitGatewayPolicyTable.id,
        policyRuleNumber: "100",
        targetRouteTableId: exampleAwsEc2TransitGatewayRouteTable.id,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2transitgateway.PolicyTableEntry("example",
        transit_gateway_policy_table_id=example_aws_ec2_transit_gateway_policy_table["id"],
        policy_rule_number="100",
        target_route_table_id=example_aws_ec2_transit_gateway_route_table["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/ec2transitgateway"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ec2transitgateway.NewPolicyTableEntry(ctx, "example", &ec2transitgateway.PolicyTableEntryArgs{
    			TransitGatewayPolicyTableId: pulumi.Any(exampleAwsEc2TransitGatewayPolicyTable.Id),
    			PolicyRuleNumber:            pulumi.String("100"),
    			TargetRouteTableId:          pulumi.Any(exampleAwsEc2TransitGatewayRouteTable.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.Ec2TransitGateway.PolicyTableEntry("example", new()
        {
            TransitGatewayPolicyTableId = exampleAwsEc2TransitGatewayPolicyTable.Id,
            PolicyRuleNumber = "100",
            TargetRouteTableId = exampleAwsEc2TransitGatewayRouteTable.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ec2transitgateway.PolicyTableEntry;
    import com.pulumi.aws.ec2transitgateway.PolicyTableEntryArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new PolicyTableEntry("example", PolicyTableEntryArgs.builder()
                .transitGatewayPolicyTableId(exampleAwsEc2TransitGatewayPolicyTable.id())
                .policyRuleNumber("100")
                .targetRouteTableId(exampleAwsEc2TransitGatewayRouteTable.id())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:ec2transitgateway:PolicyTableEntry
        properties:
          transitGatewayPolicyTableId: ${exampleAwsEc2TransitGatewayPolicyTable.id}
          policyRuleNumber: 100
          targetRouteTableId: ${exampleAwsEc2TransitGatewayRouteTable.id}
    
    pulumi {
      required_providers {
        aws = {
          source = "pulumi/aws"
        }
      }
    }
    
    resource "aws_ec2transitgateway_policytableentry" "example" {
      transit_gateway_policy_table_id = exampleAwsEc2TransitGatewayPolicyTable.id
      policy_rule_number              = 100
      target_route_table_id           = exampleAwsEc2TransitGatewayRouteTable.id
    }
    

    Full Traffic Matching Rule

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.ec2transitgateway.PolicyTableEntry("example", {
        policyRule: {
            metadata: {
                key: "test",
                value: "test",
            },
            sourceCidrBlock: "10.0.1.0/24",
            sourcePortRange: "*",
            destinationCidrBlock: "10.0.2.0/24",
            destinationPortRange: "443",
            protocol: "6",
        },
        transitGatewayPolicyTableId: exampleAwsEc2TransitGatewayPolicyTable.id,
        policyRuleNumber: "200",
        targetRouteTableId: exampleAwsEc2TransitGatewayRouteTable.id,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2transitgateway.PolicyTableEntry("example",
        policy_rule={
            "metadata": {
                "key": "test",
                "value": "test",
            },
            "source_cidr_block": "10.0.1.0/24",
            "source_port_range": "*",
            "destination_cidr_block": "10.0.2.0/24",
            "destination_port_range": "443",
            "protocol": "6",
        },
        transit_gateway_policy_table_id=example_aws_ec2_transit_gateway_policy_table["id"],
        policy_rule_number="200",
        target_route_table_id=example_aws_ec2_transit_gateway_route_table["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/ec2transitgateway"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ec2transitgateway.NewPolicyTableEntry(ctx, "example", &ec2transitgateway.PolicyTableEntryArgs{
    			PolicyRule: &ec2transitgateway.PolicyTableEntryPolicyRuleArgs{
    				Metadata: &ec2transitgateway.PolicyTableEntryPolicyRuleMetadataArgs{
    					Key:   pulumi.String("test"),
    					Value: pulumi.String("test"),
    				},
    				SourceCidrBlock:      pulumi.String("10.0.1.0/24"),
    				SourcePortRange:      pulumi.String("*"),
    				DestinationCidrBlock: pulumi.String("10.0.2.0/24"),
    				DestinationPortRange: pulumi.String("443"),
    				Protocol:             pulumi.String("6"),
    			},
    			TransitGatewayPolicyTableId: pulumi.Any(exampleAwsEc2TransitGatewayPolicyTable.Id),
    			PolicyRuleNumber:            pulumi.String("200"),
    			TargetRouteTableId:          pulumi.Any(exampleAwsEc2TransitGatewayRouteTable.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.Ec2TransitGateway.PolicyTableEntry("example", new()
        {
            PolicyRule = new Aws.Ec2TransitGateway.Inputs.PolicyTableEntryPolicyRuleArgs
            {
                Metadata = new Aws.Ec2TransitGateway.Inputs.PolicyTableEntryPolicyRuleMetadataArgs
                {
                    Key = "test",
                    Value = "test",
                },
                SourceCidrBlock = "10.0.1.0/24",
                SourcePortRange = "*",
                DestinationCidrBlock = "10.0.2.0/24",
                DestinationPortRange = "443",
                Protocol = "6",
            },
            TransitGatewayPolicyTableId = exampleAwsEc2TransitGatewayPolicyTable.Id,
            PolicyRuleNumber = "200",
            TargetRouteTableId = exampleAwsEc2TransitGatewayRouteTable.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ec2transitgateway.PolicyTableEntry;
    import com.pulumi.aws.ec2transitgateway.PolicyTableEntryArgs;
    import com.pulumi.aws.ec2transitgateway.inputs.PolicyTableEntryPolicyRuleArgs;
    import com.pulumi.aws.ec2transitgateway.inputs.PolicyTableEntryPolicyRuleMetadataArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new PolicyTableEntry("example", PolicyTableEntryArgs.builder()
                .policyRule(PolicyTableEntryPolicyRuleArgs.builder()
                    .metadata(PolicyTableEntryPolicyRuleMetadataArgs.builder()
                        .key("test")
                        .value("test")
                        .build())
                    .sourceCidrBlock("10.0.1.0/24")
                    .sourcePortRange("*")
                    .destinationCidrBlock("10.0.2.0/24")
                    .destinationPortRange("443")
                    .protocol("6")
                    .build())
                .transitGatewayPolicyTableId(exampleAwsEc2TransitGatewayPolicyTable.id())
                .policyRuleNumber("200")
                .targetRouteTableId(exampleAwsEc2TransitGatewayRouteTable.id())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:ec2transitgateway:PolicyTableEntry
        properties:
          policyRule:
            metadata:
              key: test
              value: test
            sourceCidrBlock: 10.0.1.0/24
            sourcePortRange: '*'
            destinationCidrBlock: 10.0.2.0/24
            destinationPortRange: '443'
            protocol: '6'
          transitGatewayPolicyTableId: ${exampleAwsEc2TransitGatewayPolicyTable.id}
          policyRuleNumber: 200
          targetRouteTableId: ${exampleAwsEc2TransitGatewayRouteTable.id}
    
    pulumi {
      required_providers {
        aws = {
          source = "pulumi/aws"
        }
      }
    }
    
    resource "aws_ec2transitgateway_policytableentry" "example" {
      policy_rule = {
        metadata = {
          key   = "test"
          value = "test"
        }
        source_cidr_block      = "10.0.1.0/24"
        source_port_range      = "*"
        destination_cidr_block = "10.0.2.0/24"
        destination_port_range = "443"
        protocol               = "6"
      }
      transit_gateway_policy_table_id = exampleAwsEc2TransitGatewayPolicyTable.id
      policy_rule_number              = 200
      target_route_table_id           = exampleAwsEc2TransitGatewayRouteTable.id
    }
    

    Create PolicyTableEntry Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new PolicyTableEntry(name: string, args: PolicyTableEntryArgs, opts?: CustomResourceOptions);
    @overload
    def PolicyTableEntry(resource_name: str,
                         args: PolicyTableEntryArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def PolicyTableEntry(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         policy_rule_number: Optional[str] = None,
                         target_route_table_id: Optional[str] = None,
                         transit_gateway_policy_table_id: Optional[str] = None,
                         policy_rule: Optional[PolicyTableEntryPolicyRuleArgs] = None,
                         region: Optional[str] = None)
    func NewPolicyTableEntry(ctx *Context, name string, args PolicyTableEntryArgs, opts ...ResourceOption) (*PolicyTableEntry, error)
    public PolicyTableEntry(string name, PolicyTableEntryArgs args, CustomResourceOptions? opts = null)
    public PolicyTableEntry(String name, PolicyTableEntryArgs args)
    public PolicyTableEntry(String name, PolicyTableEntryArgs args, CustomResourceOptions options)
    
    type: aws:ec2transitgateway:PolicyTableEntry
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "aws_ec2transitgateway_policy_table_entry" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args PolicyTableEntryArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args PolicyTableEntryArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args PolicyTableEntryArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PolicyTableEntryArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PolicyTableEntryArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var policyTableEntryResource = new Aws.Ec2TransitGateway.PolicyTableEntry("policyTableEntryResource", new()
    {
        PolicyRuleNumber = "string",
        TargetRouteTableId = "string",
        TransitGatewayPolicyTableId = "string",
        PolicyRule = new Aws.Ec2TransitGateway.Inputs.PolicyTableEntryPolicyRuleArgs
        {
            DestinationCidrBlock = "string",
            DestinationPortRange = "string",
            Metadata = new Aws.Ec2TransitGateway.Inputs.PolicyTableEntryPolicyRuleMetadataArgs
            {
                Key = "string",
                Value = "string",
            },
            Protocol = "string",
            SourceCidrBlock = "string",
            SourcePortRange = "string",
        },
        Region = "string",
    });
    
    example, err := ec2transitgateway.NewPolicyTableEntry(ctx, "policyTableEntryResource", &ec2transitgateway.PolicyTableEntryArgs{
    	PolicyRuleNumber:            pulumi.String("string"),
    	TargetRouteTableId:          pulumi.String("string"),
    	TransitGatewayPolicyTableId: pulumi.String("string"),
    	PolicyRule: &ec2transitgateway.PolicyTableEntryPolicyRuleArgs{
    		DestinationCidrBlock: pulumi.String("string"),
    		DestinationPortRange: pulumi.String("string"),
    		Metadata: &ec2transitgateway.PolicyTableEntryPolicyRuleMetadataArgs{
    			Key:   pulumi.String("string"),
    			Value: pulumi.String("string"),
    		},
    		Protocol:        pulumi.String("string"),
    		SourceCidrBlock: pulumi.String("string"),
    		SourcePortRange: pulumi.String("string"),
    	},
    	Region: pulumi.String("string"),
    })
    
    resource "aws_ec2transitgateway_policy_table_entry" "policyTableEntryResource" {
      lifecycle {
        create_before_destroy = true
      }
      policy_rule_number              = "string"
      target_route_table_id           = "string"
      transit_gateway_policy_table_id = "string"
      policy_rule = {
        destination_cidr_block = "string"
        destination_port_range = "string"
        metadata = {
          key   = "string"
          value = "string"
        }
        protocol          = "string"
        source_cidr_block = "string"
        source_port_range = "string"
      }
      region = "string"
    }
    
    var policyTableEntryResource = new PolicyTableEntry("policyTableEntryResource", PolicyTableEntryArgs.builder()
        .policyRuleNumber("string")
        .targetRouteTableId("string")
        .transitGatewayPolicyTableId("string")
        .policyRule(PolicyTableEntryPolicyRuleArgs.builder()
            .destinationCidrBlock("string")
            .destinationPortRange("string")
            .metadata(PolicyTableEntryPolicyRuleMetadataArgs.builder()
                .key("string")
                .value("string")
                .build())
            .protocol("string")
            .sourceCidrBlock("string")
            .sourcePortRange("string")
            .build())
        .region("string")
        .build());
    
    policy_table_entry_resource = aws.ec2transitgateway.PolicyTableEntry("policyTableEntryResource",
        policy_rule_number="string",
        target_route_table_id="string",
        transit_gateway_policy_table_id="string",
        policy_rule={
            "destination_cidr_block": "string",
            "destination_port_range": "string",
            "metadata": {
                "key": "string",
                "value": "string",
            },
            "protocol": "string",
            "source_cidr_block": "string",
            "source_port_range": "string",
        },
        region="string")
    
    const policyTableEntryResource = new aws.ec2transitgateway.PolicyTableEntry("policyTableEntryResource", {
        policyRuleNumber: "string",
        targetRouteTableId: "string",
        transitGatewayPolicyTableId: "string",
        policyRule: {
            destinationCidrBlock: "string",
            destinationPortRange: "string",
            metadata: {
                key: "string",
                value: "string",
            },
            protocol: "string",
            sourceCidrBlock: "string",
            sourcePortRange: "string",
        },
        region: "string",
    });
    
    type: aws:ec2transitgateway:PolicyTableEntry
    properties:
        policyRule:
            destinationCidrBlock: string
            destinationPortRange: string
            metadata:
                key: string
                value: string
            protocol: string
            sourceCidrBlock: string
            sourcePortRange: string
        policyRuleNumber: string
        region: string
        targetRouteTableId: string
        transitGatewayPolicyTableId: string
    

    PolicyTableEntry Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The PolicyTableEntry resource accepts the following input properties:

    PolicyRuleNumber string
    Rule number for this entry. Changing this value forces a new resource. Lower numbers are evaluated first and take precedence. Enter an integer from 1 to 50,000. Leave gaps between numbers (for example, 100, 110, 120) so you can insert rules later without renumbering.
    TargetRouteTableId string
    ID of the transit gateway route table to use for traffic matching this rule.
    TransitGatewayPolicyTableId string

    EC2 Transit Gateway Policy Table identifier.

    The following arguments are optional:

    PolicyRule PolicyTableEntryPolicyRule
    Matching criteria for the policy table entry. See below.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    PolicyRuleNumber string
    Rule number for this entry. Changing this value forces a new resource. Lower numbers are evaluated first and take precedence. Enter an integer from 1 to 50,000. Leave gaps between numbers (for example, 100, 110, 120) so you can insert rules later without renumbering.
    TargetRouteTableId string
    ID of the transit gateway route table to use for traffic matching this rule.
    TransitGatewayPolicyTableId string

    EC2 Transit Gateway Policy Table identifier.

    The following arguments are optional:

    PolicyRule PolicyTableEntryPolicyRuleArgs
    Matching criteria for the policy table entry. See below.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    policy_rule_number string
    Rule number for this entry. Changing this value forces a new resource. Lower numbers are evaluated first and take precedence. Enter an integer from 1 to 50,000. Leave gaps between numbers (for example, 100, 110, 120) so you can insert rules later without renumbering.
    target_route_table_id string
    ID of the transit gateway route table to use for traffic matching this rule.
    transit_gateway_policy_table_id string

    EC2 Transit Gateway Policy Table identifier.

    The following arguments are optional:

    policy_rule object
    Matching criteria for the policy table entry. See below.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    policyRuleNumber String
    Rule number for this entry. Changing this value forces a new resource. Lower numbers are evaluated first and take precedence. Enter an integer from 1 to 50,000. Leave gaps between numbers (for example, 100, 110, 120) so you can insert rules later without renumbering.
    targetRouteTableId String
    ID of the transit gateway route table to use for traffic matching this rule.
    transitGatewayPolicyTableId String

    EC2 Transit Gateway Policy Table identifier.

    The following arguments are optional:

    policyRule PolicyTableEntryPolicyRule
    Matching criteria for the policy table entry. See below.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    policyRuleNumber string
    Rule number for this entry. Changing this value forces a new resource. Lower numbers are evaluated first and take precedence. Enter an integer from 1 to 50,000. Leave gaps between numbers (for example, 100, 110, 120) so you can insert rules later without renumbering.
    targetRouteTableId string
    ID of the transit gateway route table to use for traffic matching this rule.
    transitGatewayPolicyTableId string

    EC2 Transit Gateway Policy Table identifier.

    The following arguments are optional:

    policyRule PolicyTableEntryPolicyRule
    Matching criteria for the policy table entry. See below.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    policy_rule_number str
    Rule number for this entry. Changing this value forces a new resource. Lower numbers are evaluated first and take precedence. Enter an integer from 1 to 50,000. Leave gaps between numbers (for example, 100, 110, 120) so you can insert rules later without renumbering.
    target_route_table_id str
    ID of the transit gateway route table to use for traffic matching this rule.
    transit_gateway_policy_table_id str

    EC2 Transit Gateway Policy Table identifier.

    The following arguments are optional:

    policy_rule PolicyTableEntryPolicyRuleArgs
    Matching criteria for the policy table entry. See below.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    policyRuleNumber String
    Rule number for this entry. Changing this value forces a new resource. Lower numbers are evaluated first and take precedence. Enter an integer from 1 to 50,000. Leave gaps between numbers (for example, 100, 110, 120) so you can insert rules later without renumbering.
    targetRouteTableId String
    ID of the transit gateway route table to use for traffic matching this rule.
    transitGatewayPolicyTableId String

    EC2 Transit Gateway Policy Table identifier.

    The following arguments are optional:

    policyRule Property Map
    Matching criteria for the policy table entry. See below.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the PolicyTableEntry resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing PolicyTableEntry Resource

    Get an existing PolicyTableEntry resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: PolicyTableEntryState, opts?: CustomResourceOptions): PolicyTableEntry
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            policy_rule: Optional[PolicyTableEntryPolicyRuleArgs] = None,
            policy_rule_number: Optional[str] = None,
            region: Optional[str] = None,
            target_route_table_id: Optional[str] = None,
            transit_gateway_policy_table_id: Optional[str] = None) -> PolicyTableEntry
    func GetPolicyTableEntry(ctx *Context, name string, id IDInput, state *PolicyTableEntryState, opts ...ResourceOption) (*PolicyTableEntry, error)
    public static PolicyTableEntry Get(string name, Input<string> id, PolicyTableEntryState? state, CustomResourceOptions? opts = null)
    public static PolicyTableEntry get(String name, Output<String> id, PolicyTableEntryState state, CustomResourceOptions options)
    resources:  _:    type: aws:ec2transitgateway:PolicyTableEntry    get:      id: ${id}
    import {
      to = aws_ec2transitgateway_policy_table_entry.example
      id = "${id}"
    }
    
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    PolicyRule PolicyTableEntryPolicyRule
    Matching criteria for the policy table entry. See below.
    PolicyRuleNumber string
    Rule number for this entry. Changing this value forces a new resource. Lower numbers are evaluated first and take precedence. Enter an integer from 1 to 50,000. Leave gaps between numbers (for example, 100, 110, 120) so you can insert rules later without renumbering.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    TargetRouteTableId string
    ID of the transit gateway route table to use for traffic matching this rule.
    TransitGatewayPolicyTableId string

    EC2 Transit Gateway Policy Table identifier.

    The following arguments are optional:

    PolicyRule PolicyTableEntryPolicyRuleArgs
    Matching criteria for the policy table entry. See below.
    PolicyRuleNumber string
    Rule number for this entry. Changing this value forces a new resource. Lower numbers are evaluated first and take precedence. Enter an integer from 1 to 50,000. Leave gaps between numbers (for example, 100, 110, 120) so you can insert rules later without renumbering.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    TargetRouteTableId string
    ID of the transit gateway route table to use for traffic matching this rule.
    TransitGatewayPolicyTableId string

    EC2 Transit Gateway Policy Table identifier.

    The following arguments are optional:

    policy_rule object
    Matching criteria for the policy table entry. See below.
    policy_rule_number string
    Rule number for this entry. Changing this value forces a new resource. Lower numbers are evaluated first and take precedence. Enter an integer from 1 to 50,000. Leave gaps between numbers (for example, 100, 110, 120) so you can insert rules later without renumbering.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    target_route_table_id string
    ID of the transit gateway route table to use for traffic matching this rule.
    transit_gateway_policy_table_id string

    EC2 Transit Gateway Policy Table identifier.

    The following arguments are optional:

    policyRule PolicyTableEntryPolicyRule
    Matching criteria for the policy table entry. See below.
    policyRuleNumber String
    Rule number for this entry. Changing this value forces a new resource. Lower numbers are evaluated first and take precedence. Enter an integer from 1 to 50,000. Leave gaps between numbers (for example, 100, 110, 120) so you can insert rules later without renumbering.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    targetRouteTableId String
    ID of the transit gateway route table to use for traffic matching this rule.
    transitGatewayPolicyTableId String

    EC2 Transit Gateway Policy Table identifier.

    The following arguments are optional:

    policyRule PolicyTableEntryPolicyRule
    Matching criteria for the policy table entry. See below.
    policyRuleNumber string
    Rule number for this entry. Changing this value forces a new resource. Lower numbers are evaluated first and take precedence. Enter an integer from 1 to 50,000. Leave gaps between numbers (for example, 100, 110, 120) so you can insert rules later without renumbering.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    targetRouteTableId string
    ID of the transit gateway route table to use for traffic matching this rule.
    transitGatewayPolicyTableId string

    EC2 Transit Gateway Policy Table identifier.

    The following arguments are optional:

    policy_rule PolicyTableEntryPolicyRuleArgs
    Matching criteria for the policy table entry. See below.
    policy_rule_number str
    Rule number for this entry. Changing this value forces a new resource. Lower numbers are evaluated first and take precedence. Enter an integer from 1 to 50,000. Leave gaps between numbers (for example, 100, 110, 120) so you can insert rules later without renumbering.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    target_route_table_id str
    ID of the transit gateway route table to use for traffic matching this rule.
    transit_gateway_policy_table_id str

    EC2 Transit Gateway Policy Table identifier.

    The following arguments are optional:

    policyRule Property Map
    Matching criteria for the policy table entry. See below.
    policyRuleNumber String
    Rule number for this entry. Changing this value forces a new resource. Lower numbers are evaluated first and take precedence. Enter an integer from 1 to 50,000. Leave gaps between numbers (for example, 100, 110, 120) so you can insert rules later without renumbering.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    targetRouteTableId String
    ID of the transit gateway route table to use for traffic matching this rule.
    transitGatewayPolicyTableId String

    EC2 Transit Gateway Policy Table identifier.

    The following arguments are optional:

    Supporting Types

    PolicyTableEntryPolicyRule, PolicyTableEntryPolicyRuleArgs

    DestinationCidrBlock string
    Destination CIDR block to match. If not specified, all destination CIDR blocks are matched.
    DestinationPortRange string
    Destination port or port range to match (e.g., 443 or 1024-65535). Only valid when protocol is 6 (TCP) or 17 (UDP).
    Metadata PolicyTableEntryPolicyRuleMetadata
    Metadata key/value tag associated with the policy rule. See below.
    Protocol string
    Protocol number to match (e.g., 6 for TCP, 17 for UDP). If not specified, all protocols are matched.
    SourceCidrBlock string
    Source CIDR block to match. If not specified, all source CIDR blocks are matched.
    SourcePortRange string
    Source port or port range to match (e.g., 443 or 1024-65535). Only valid when protocol is 6 (TCP) or 17 (UDP).
    DestinationCidrBlock string
    Destination CIDR block to match. If not specified, all destination CIDR blocks are matched.
    DestinationPortRange string
    Destination port or port range to match (e.g., 443 or 1024-65535). Only valid when protocol is 6 (TCP) or 17 (UDP).
    Metadata PolicyTableEntryPolicyRuleMetadata
    Metadata key/value tag associated with the policy rule. See below.
    Protocol string
    Protocol number to match (e.g., 6 for TCP, 17 for UDP). If not specified, all protocols are matched.
    SourceCidrBlock string
    Source CIDR block to match. If not specified, all source CIDR blocks are matched.
    SourcePortRange string
    Source port or port range to match (e.g., 443 or 1024-65535). Only valid when protocol is 6 (TCP) or 17 (UDP).
    destination_cidr_block string
    Destination CIDR block to match. If not specified, all destination CIDR blocks are matched.
    destination_port_range string
    Destination port or port range to match (e.g., 443 or 1024-65535). Only valid when protocol is 6 (TCP) or 17 (UDP).
    metadata object
    Metadata key/value tag associated with the policy rule. See below.
    protocol string
    Protocol number to match (e.g., 6 for TCP, 17 for UDP). If not specified, all protocols are matched.
    source_cidr_block string
    Source CIDR block to match. If not specified, all source CIDR blocks are matched.
    source_port_range string
    Source port or port range to match (e.g., 443 or 1024-65535). Only valid when protocol is 6 (TCP) or 17 (UDP).
    destinationCidrBlock String
    Destination CIDR block to match. If not specified, all destination CIDR blocks are matched.
    destinationPortRange String
    Destination port or port range to match (e.g., 443 or 1024-65535). Only valid when protocol is 6 (TCP) or 17 (UDP).
    metadata PolicyTableEntryPolicyRuleMetadata
    Metadata key/value tag associated with the policy rule. See below.
    protocol String
    Protocol number to match (e.g., 6 for TCP, 17 for UDP). If not specified, all protocols are matched.
    sourceCidrBlock String
    Source CIDR block to match. If not specified, all source CIDR blocks are matched.
    sourcePortRange String
    Source port or port range to match (e.g., 443 or 1024-65535). Only valid when protocol is 6 (TCP) or 17 (UDP).
    destinationCidrBlock string
    Destination CIDR block to match. If not specified, all destination CIDR blocks are matched.
    destinationPortRange string
    Destination port or port range to match (e.g., 443 or 1024-65535). Only valid when protocol is 6 (TCP) or 17 (UDP).
    metadata PolicyTableEntryPolicyRuleMetadata
    Metadata key/value tag associated with the policy rule. See below.
    protocol string
    Protocol number to match (e.g., 6 for TCP, 17 for UDP). If not specified, all protocols are matched.
    sourceCidrBlock string
    Source CIDR block to match. If not specified, all source CIDR blocks are matched.
    sourcePortRange string
    Source port or port range to match (e.g., 443 or 1024-65535). Only valid when protocol is 6 (TCP) or 17 (UDP).
    destination_cidr_block str
    Destination CIDR block to match. If not specified, all destination CIDR blocks are matched.
    destination_port_range str
    Destination port or port range to match (e.g., 443 or 1024-65535). Only valid when protocol is 6 (TCP) or 17 (UDP).
    metadata PolicyTableEntryPolicyRuleMetadata
    Metadata key/value tag associated with the policy rule. See below.
    protocol str
    Protocol number to match (e.g., 6 for TCP, 17 for UDP). If not specified, all protocols are matched.
    source_cidr_block str
    Source CIDR block to match. If not specified, all source CIDR blocks are matched.
    source_port_range str
    Source port or port range to match (e.g., 443 or 1024-65535). Only valid when protocol is 6 (TCP) or 17 (UDP).
    destinationCidrBlock String
    Destination CIDR block to match. If not specified, all destination CIDR blocks are matched.
    destinationPortRange String
    Destination port or port range to match (e.g., 443 or 1024-65535). Only valid when protocol is 6 (TCP) or 17 (UDP).
    metadata Property Map
    Metadata key/value tag associated with the policy rule. See below.
    protocol String
    Protocol number to match (e.g., 6 for TCP, 17 for UDP). If not specified, all protocols are matched.
    sourceCidrBlock String
    Source CIDR block to match. If not specified, all source CIDR blocks are matched.
    sourcePortRange String
    Source port or port range to match (e.g., 443 or 1024-65535). Only valid when protocol is 6 (TCP) or 17 (UDP).

    PolicyTableEntryPolicyRuleMetadata, PolicyTableEntryPolicyRuleMetadataArgs

    Key string
    Metadata key name for the policy rule.
    Value string

    Metadata key value for the policy rule.

    Note: The EC2 API does not return policy rule metadata when describing transit gateway policy table entries, so Terraform cannot detect drift in metadata or recover its value when importing this resource. Configure metadata explicitly if you need it managed.

    Key string
    Metadata key name for the policy rule.
    Value string

    Metadata key value for the policy rule.

    Note: The EC2 API does not return policy rule metadata when describing transit gateway policy table entries, so Terraform cannot detect drift in metadata or recover its value when importing this resource. Configure metadata explicitly if you need it managed.

    key string
    Metadata key name for the policy rule.
    value string

    Metadata key value for the policy rule.

    Note: The EC2 API does not return policy rule metadata when describing transit gateway policy table entries, so Terraform cannot detect drift in metadata or recover its value when importing this resource. Configure metadata explicitly if you need it managed.

    key String
    Metadata key name for the policy rule.
    value String

    Metadata key value for the policy rule.

    Note: The EC2 API does not return policy rule metadata when describing transit gateway policy table entries, so Terraform cannot detect drift in metadata or recover its value when importing this resource. Configure metadata explicitly if you need it managed.

    key string
    Metadata key name for the policy rule.
    value string

    Metadata key value for the policy rule.

    Note: The EC2 API does not return policy rule metadata when describing transit gateway policy table entries, so Terraform cannot detect drift in metadata or recover its value when importing this resource. Configure metadata explicitly if you need it managed.

    key str
    Metadata key name for the policy rule.
    value str

    Metadata key value for the policy rule.

    Note: The EC2 API does not return policy rule metadata when describing transit gateway policy table entries, so Terraform cannot detect drift in metadata or recover its value when importing this resource. Configure metadata explicitly if you need it managed.

    key String
    Metadata key name for the policy rule.
    value String

    Metadata key value for the policy rule.

    Note: The EC2 API does not return policy rule metadata when describing transit gateway policy table entries, so Terraform cannot detect drift in metadata or recover its value when importing this resource. Configure metadata explicitly if you need it managed.

    Import

    Identity Schema

    Required

    • transitGatewayPolicyTableId (String) EC2 Transit Gateway Policy Table identifier.
    • policyRuleNumber (String) Rule number for this entry.

    Optional

    • accountId (String) AWS Account where this resource is managed.
    • region (String) Region where this resource is managed.

    Using pulumi import, import aws.ec2transitgateway.PolicyTableEntry using the composite identifier. For example:

    $ pulumi import aws:ec2transitgateway/policyTableEntry:PolicyTableEntry example tgw-ptb-000000000fffffff,100
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo aws logo
    Viewing docs for AWS v7.48.0
    published on Tuesday, Sep 22, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial