Class MeteringPolicyEntry


  • public class MeteringPolicyEntry
    extends com.pulumi.resources.CustomResource
    Manages an EC2 Transit Gateway Metering Policy Entry. Each entry defines a traffic matching rule within a Transit Gateway Metering Policy that determines which account is charged for matching traffic flows. ## 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.MeteringPolicyEntry;
     import com.pulumi.aws.ec2transitgateway.MeteringPolicyEntryArgs;
     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 MeteringPolicyEntry("example", MeteringPolicyEntryArgs.builder()
                 .transitGatewayMeteringPolicyId(exampleAwsEc2TransitGatewayMeteringPolicy.transitGatewayMeteringPolicyId())
                 .policyRuleNumber(100)
                 .meteredAccount("source-attachment-owner")
                 .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.MeteringPolicyEntry;
     import com.pulumi.aws.ec2transitgateway.MeteringPolicyEntryArgs;
     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 MeteringPolicyEntry("example", MeteringPolicyEntryArgs.builder()
                 .transitGatewayMeteringPolicyId(exampleAwsEc2TransitGatewayMeteringPolicy.transitGatewayMeteringPolicyId())
                 .policyRuleNumber(200)
                 .meteredAccount("destination-attachment-owner")
                 .sourceCidrBlock("10.0.0.0/8")
                 .destinationCidrBlock("172.16.0.0/12")
                 .protocol("6")
                 .build());
     
         }
     }
     
     
    ## Import Using `pulumi import`, import `aws.ec2transitgateway.MeteringPolicyEntry` using the composite identifier. For example: ```sh $ pulumi import aws:ec2transitgateway/meteringPolicyEntry:MeteringPolicyEntry example tgw-policy-12345678,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
    • Constructor Detail

      • MeteringPolicyEntry

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

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

        public MeteringPolicyEntry​(java.lang.String name,
                                   MeteringPolicyEntryArgs 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

      • destinationCidrBlock

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> destinationCidrBlock()
        Returns:
        Destination CIDR block to match. If not specified, all destination CIDR blocks are matched.
      • destinationPortRange

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> destinationPortRange()
        Returns:
        Destination port range to match. If not specified, all destination ports are matched.
      • destinationTransitGatewayAttachmentId

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> destinationTransitGatewayAttachmentId()
        Returns:
        Destination Transit Gateway attachment ID to match.
      • destinationTransitGatewayAttachmentType

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> destinationTransitGatewayAttachmentType()
        Returns:
        Destination attachment resource type to match. Valid values are `vpc`, `vpn`, `vpn-concentrator`, `direct-connect-gateway`, `connect`, `peering`, `tgw-peering`, `network-function`, `client-vpn`.
      • meteredAccount

        public com.pulumi.core.Output<java.lang.String> meteredAccount()
        Returns:
        The account to charge for matching traffic. Valid values are `source-attachment-owner`, `destination-attachment-owner`, or `transit-gateway-owner`.
      • policyRuleNumber

        public com.pulumi.core.Output<java.lang.Integer> policyRuleNumber()
        Returns:
        Rule number for this entry. Lower numbers have higher priority. Valid values are between `1` and `32766`.
      • protocol

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> protocol()
        Returns:
        Protocol number to match (e.g., `6` for TCP, `17` for UDP). If not specified, all protocols are matched.
      • 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.
      • sourceCidrBlock

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> sourceCidrBlock()
        Returns:
        Source CIDR block to match. If not specified, all source CIDR blocks are matched.
      • sourcePortRange

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> sourcePortRange()
        Returns:
        Source port range to match. If not specified, all source ports are matched.
      • sourceTransitGatewayAttachmentId

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> sourceTransitGatewayAttachmentId()
        Returns:
        Source Transit Gateway attachment ID to match.
      • sourceTransitGatewayAttachmentType

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> sourceTransitGatewayAttachmentType()
        Returns:
        Source attachment resource type to match. Valid values are `vpc`, `vpn`, `vpn-concentrator`, `direct-connect-gateway`, `connect`, `peering`, `tgw-peering`, `network-function`, `client-vpn`.
      • transitGatewayMeteringPolicyId

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

        public static MeteringPolicyEntry get​(java.lang.String name,
                                              com.pulumi.core.Output<java.lang.String> id,
                                              @Nullable
                                              MeteringPolicyEntryState 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.