Class PolicyTableEntry


  • public class PolicyTableEntry
    extends com.pulumi.resources.CustomResource
    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
     
     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());
     
         }
     }
     
     
    ### Full Traffic Matching Rule
     
     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());
     
         }
     }
     
     
    ## 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: ```sh $ pulumi import aws:ec2transitgateway/policyTableEntry:PolicyTableEntry example tgw-ptb-000000000fffffff,100 ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static PolicyTableEntry get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, PolicyTableEntryState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.util.Optional<PolicyTableEntryPolicyRule>> policyRule()  
      com.pulumi.core.Output<java.lang.String> policyRuleNumber()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.lang.String> targetRouteTableId()  
      com.pulumi.core.Output<java.lang.String> transitGatewayPolicyTableId()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PolicyTableEntry

        public PolicyTableEntry​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • PolicyTableEntry

        public PolicyTableEntry​(java.lang.String name,
                                PolicyTableEntryArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • PolicyTableEntry

        public PolicyTableEntry​(java.lang.String name,
                                PolicyTableEntryArgs args,
                                @Nullable
                                com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • policyRule

        public com.pulumi.core.Output<java.util.Optional<PolicyTableEntryPolicyRule>> policyRule()
        Returns:
        Matching criteria for the policy table entry. See below.
      • policyRuleNumber

        public com.pulumi.core.Output<java.lang.String> policyRuleNumber()
        Returns:
        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

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • targetRouteTableId

        public com.pulumi.core.Output<java.lang.String> targetRouteTableId()
        Returns:
        ID of the transit gateway route table to use for traffic matching this rule.
      • transitGatewayPolicyTableId

        public com.pulumi.core.Output<java.lang.String> transitGatewayPolicyTableId()
        Returns:
        EC2 Transit Gateway Policy Table identifier. The following arguments are optional:
      • get

        public static PolicyTableEntry get​(java.lang.String name,
                                           com.pulumi.core.Output<java.lang.String> id,
                                           @Nullable
                                           PolicyTableEntryState state,
                                           @Nullable
                                           com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.