1. Packages
  2. Packages
  3. AWS
  4. API Docs
  5. ec2transitgateway
  6. MeteringPolicyEntry
Viewing docs for AWS v7.27.0
published on Thursday, Apr 23, 2026 by Pulumi
aws logo
Viewing docs for AWS v7.27.0
published on Thursday, Apr 23, 2026 by Pulumi

    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

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.ec2transitgateway.MeteringPolicyEntry("example", {
        transitGatewayMeteringPolicyId: exampleAwsEc2TransitGatewayMeteringPolicy.transitGatewayMeteringPolicyId,
        policyRuleNumber: 100,
        meteredAccount: "source-attachment-owner",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2transitgateway.MeteringPolicyEntry("example",
        transit_gateway_metering_policy_id=example_aws_ec2_transit_gateway_metering_policy["transitGatewayMeteringPolicyId"],
        policy_rule_number=100,
        metered_account="source-attachment-owner")
    
    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.NewMeteringPolicyEntry(ctx, "example", &ec2transitgateway.MeteringPolicyEntryArgs{
    			TransitGatewayMeteringPolicyId: pulumi.Any(exampleAwsEc2TransitGatewayMeteringPolicy.TransitGatewayMeteringPolicyId),
    			PolicyRuleNumber:               pulumi.Int(100),
    			MeteredAccount:                 pulumi.String("source-attachment-owner"),
    		})
    		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.MeteringPolicyEntry("example", new()
        {
            TransitGatewayMeteringPolicyId = exampleAwsEc2TransitGatewayMeteringPolicy.TransitGatewayMeteringPolicyId,
            PolicyRuleNumber = 100,
            MeteredAccount = "source-attachment-owner",
        });
    
    });
    
    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.List;
    import java.util.ArrayList;
    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());
    
        }
    }
    
    resources:
      example:
        type: aws:ec2transitgateway:MeteringPolicyEntry
        properties:
          transitGatewayMeteringPolicyId: ${exampleAwsEc2TransitGatewayMeteringPolicy.transitGatewayMeteringPolicyId}
          policyRuleNumber: 100
          meteredAccount: source-attachment-owner
    

    Full Traffic Matching Rule

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.ec2transitgateway.MeteringPolicyEntry("example", {
        transitGatewayMeteringPolicyId: exampleAwsEc2TransitGatewayMeteringPolicy.transitGatewayMeteringPolicyId,
        policyRuleNumber: 200,
        meteredAccount: "destination-attachment-owner",
        sourceCidrBlock: "10.0.0.0/8",
        destinationCidrBlock: "172.16.0.0/12",
        protocol: "6",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2transitgateway.MeteringPolicyEntry("example",
        transit_gateway_metering_policy_id=example_aws_ec2_transit_gateway_metering_policy["transitGatewayMeteringPolicyId"],
        policy_rule_number=200,
        metered_account="destination-attachment-owner",
        source_cidr_block="10.0.0.0/8",
        destination_cidr_block="172.16.0.0/12",
        protocol="6")
    
    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.NewMeteringPolicyEntry(ctx, "example", &ec2transitgateway.MeteringPolicyEntryArgs{
    			TransitGatewayMeteringPolicyId: pulumi.Any(exampleAwsEc2TransitGatewayMeteringPolicy.TransitGatewayMeteringPolicyId),
    			PolicyRuleNumber:               pulumi.Int(200),
    			MeteredAccount:                 pulumi.String("destination-attachment-owner"),
    			SourceCidrBlock:                pulumi.String("10.0.0.0/8"),
    			DestinationCidrBlock:           pulumi.String("172.16.0.0/12"),
    			Protocol:                       pulumi.String("6"),
    		})
    		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.MeteringPolicyEntry("example", new()
        {
            TransitGatewayMeteringPolicyId = exampleAwsEc2TransitGatewayMeteringPolicy.TransitGatewayMeteringPolicyId,
            PolicyRuleNumber = 200,
            MeteredAccount = "destination-attachment-owner",
            SourceCidrBlock = "10.0.0.0/8",
            DestinationCidrBlock = "172.16.0.0/12",
            Protocol = "6",
        });
    
    });
    
    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.List;
    import java.util.ArrayList;
    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());
    
        }
    }
    
    resources:
      example:
        type: aws:ec2transitgateway:MeteringPolicyEntry
        properties:
          transitGatewayMeteringPolicyId: ${exampleAwsEc2TransitGatewayMeteringPolicy.transitGatewayMeteringPolicyId}
          policyRuleNumber: 200
          meteredAccount: destination-attachment-owner
          sourceCidrBlock: 10.0.0.0/8
          destinationCidrBlock: 172.16.0.0/12
          protocol: '6'
    

    Create MeteringPolicyEntry Resource

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

    Constructor syntax

    new MeteringPolicyEntry(name: string, args: MeteringPolicyEntryArgs, opts?: CustomResourceOptions);
    @overload
    def MeteringPolicyEntry(resource_name: str,
                            args: MeteringPolicyEntryArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def MeteringPolicyEntry(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            metered_account: Optional[str] = None,
                            transit_gateway_metering_policy_id: Optional[str] = None,
                            policy_rule_number: Optional[int] = None,
                            protocol: Optional[str] = None,
                            destination_transit_gateway_attachment_type: Optional[str] = None,
                            destination_transit_gateway_attachment_id: Optional[str] = None,
                            destination_cidr_block: Optional[str] = None,
                            region: Optional[str] = None,
                            source_cidr_block: Optional[str] = None,
                            source_port_range: Optional[str] = None,
                            source_transit_gateway_attachment_id: Optional[str] = None,
                            source_transit_gateway_attachment_type: Optional[str] = None,
                            timeouts: Optional[MeteringPolicyEntryTimeoutsArgs] = None,
                            destination_port_range: Optional[str] = None)
    func NewMeteringPolicyEntry(ctx *Context, name string, args MeteringPolicyEntryArgs, opts ...ResourceOption) (*MeteringPolicyEntry, error)
    public MeteringPolicyEntry(string name, MeteringPolicyEntryArgs args, CustomResourceOptions? opts = null)
    public MeteringPolicyEntry(String name, MeteringPolicyEntryArgs args)
    public MeteringPolicyEntry(String name, MeteringPolicyEntryArgs args, CustomResourceOptions options)
    
    type: aws:ec2transitgateway:MeteringPolicyEntry
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args MeteringPolicyEntryArgs
    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 MeteringPolicyEntryArgs
    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 MeteringPolicyEntryArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MeteringPolicyEntryArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MeteringPolicyEntryArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    MeteringPolicyEntry 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 MeteringPolicyEntry resource accepts the following input properties:

    MeteredAccount string
    The account to charge for matching traffic. Valid values are source-attachment-owner or destination-attachment-owner.
    PolicyRuleNumber int
    Rule number for this entry. Lower numbers have higher priority. Valid values are between 1 and 32766.
    TransitGatewayMeteringPolicyId string

    EC2 Transit Gateway Metering Policy identifier.

    The following arguments are optional:

    DestinationCidrBlock string
    Destination CIDR block to match. If not specified, all destination CIDR blocks are matched.
    DestinationPortRange string
    DestinationTransitGatewayAttachmentId string
    DestinationTransitGatewayAttachmentType string
    Protocol string
    Protocol number to match (e.g., 6 for TCP, 17 for UDP). If not specified, all protocols are matched.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    SourceCidrBlock string
    Source CIDR block to match. If not specified, all source CIDR blocks are matched.
    SourcePortRange string
    SourceTransitGatewayAttachmentId string
    SourceTransitGatewayAttachmentType string
    Timeouts MeteringPolicyEntryTimeouts
    MeteredAccount string
    The account to charge for matching traffic. Valid values are source-attachment-owner or destination-attachment-owner.
    PolicyRuleNumber int
    Rule number for this entry. Lower numbers have higher priority. Valid values are between 1 and 32766.
    TransitGatewayMeteringPolicyId string

    EC2 Transit Gateway Metering Policy identifier.

    The following arguments are optional:

    DestinationCidrBlock string
    Destination CIDR block to match. If not specified, all destination CIDR blocks are matched.
    DestinationPortRange string
    DestinationTransitGatewayAttachmentId string
    DestinationTransitGatewayAttachmentType string
    Protocol string
    Protocol number to match (e.g., 6 for TCP, 17 for UDP). If not specified, all protocols are matched.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    SourceCidrBlock string
    Source CIDR block to match. If not specified, all source CIDR blocks are matched.
    SourcePortRange string
    SourceTransitGatewayAttachmentId string
    SourceTransitGatewayAttachmentType string
    Timeouts MeteringPolicyEntryTimeoutsArgs
    meteredAccount String
    The account to charge for matching traffic. Valid values are source-attachment-owner or destination-attachment-owner.
    policyRuleNumber Integer
    Rule number for this entry. Lower numbers have higher priority. Valid values are between 1 and 32766.
    transitGatewayMeteringPolicyId String

    EC2 Transit Gateway Metering Policy identifier.

    The following arguments are optional:

    destinationCidrBlock String
    Destination CIDR block to match. If not specified, all destination CIDR blocks are matched.
    destinationPortRange String
    destinationTransitGatewayAttachmentId String
    destinationTransitGatewayAttachmentType String
    protocol String
    Protocol number to match (e.g., 6 for TCP, 17 for UDP). If not specified, all protocols are matched.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    sourceCidrBlock String
    Source CIDR block to match. If not specified, all source CIDR blocks are matched.
    sourcePortRange String
    sourceTransitGatewayAttachmentId String
    sourceTransitGatewayAttachmentType String
    timeouts MeteringPolicyEntryTimeouts
    meteredAccount string
    The account to charge for matching traffic. Valid values are source-attachment-owner or destination-attachment-owner.
    policyRuleNumber number
    Rule number for this entry. Lower numbers have higher priority. Valid values are between 1 and 32766.
    transitGatewayMeteringPolicyId string

    EC2 Transit Gateway Metering Policy identifier.

    The following arguments are optional:

    destinationCidrBlock string
    Destination CIDR block to match. If not specified, all destination CIDR blocks are matched.
    destinationPortRange string
    destinationTransitGatewayAttachmentId string
    destinationTransitGatewayAttachmentType string
    protocol string
    Protocol number to match (e.g., 6 for TCP, 17 for UDP). If not specified, all protocols are matched.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    sourceCidrBlock string
    Source CIDR block to match. If not specified, all source CIDR blocks are matched.
    sourcePortRange string
    sourceTransitGatewayAttachmentId string
    sourceTransitGatewayAttachmentType string
    timeouts MeteringPolicyEntryTimeouts
    metered_account str
    The account to charge for matching traffic. Valid values are source-attachment-owner or destination-attachment-owner.
    policy_rule_number int
    Rule number for this entry. Lower numbers have higher priority. Valid values are between 1 and 32766.
    transit_gateway_metering_policy_id str

    EC2 Transit Gateway Metering Policy identifier.

    The following arguments are optional:

    destination_cidr_block str
    Destination CIDR block to match. If not specified, all destination CIDR blocks are matched.
    destination_port_range str
    destination_transit_gateway_attachment_id str
    destination_transit_gateway_attachment_type str
    protocol str
    Protocol number to match (e.g., 6 for TCP, 17 for UDP). If not specified, all protocols are matched.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    source_cidr_block str
    Source CIDR block to match. If not specified, all source CIDR blocks are matched.
    source_port_range str
    source_transit_gateway_attachment_id str
    source_transit_gateway_attachment_type str
    timeouts MeteringPolicyEntryTimeoutsArgs
    meteredAccount String
    The account to charge for matching traffic. Valid values are source-attachment-owner or destination-attachment-owner.
    policyRuleNumber Number
    Rule number for this entry. Lower numbers have higher priority. Valid values are between 1 and 32766.
    transitGatewayMeteringPolicyId String

    EC2 Transit Gateway Metering Policy identifier.

    The following arguments are optional:

    destinationCidrBlock String
    Destination CIDR block to match. If not specified, all destination CIDR blocks are matched.
    destinationPortRange String
    destinationTransitGatewayAttachmentId String
    destinationTransitGatewayAttachmentType String
    protocol String
    Protocol number to match (e.g., 6 for TCP, 17 for UDP). If not specified, all protocols are matched.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    sourceCidrBlock String
    Source CIDR block to match. If not specified, all source CIDR blocks are matched.
    sourcePortRange String
    sourceTransitGatewayAttachmentId String
    sourceTransitGatewayAttachmentType String
    timeouts Property Map

    Outputs

    All input properties are implicitly available as output properties. Additionally, the MeteringPolicyEntry 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 str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing MeteringPolicyEntry Resource

    Get an existing MeteringPolicyEntry 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?: MeteringPolicyEntryState, opts?: CustomResourceOptions): MeteringPolicyEntry
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            destination_cidr_block: Optional[str] = None,
            destination_port_range: Optional[str] = None,
            destination_transit_gateway_attachment_id: Optional[str] = None,
            destination_transit_gateway_attachment_type: Optional[str] = None,
            metered_account: Optional[str] = None,
            policy_rule_number: Optional[int] = None,
            protocol: Optional[str] = None,
            region: Optional[str] = None,
            source_cidr_block: Optional[str] = None,
            source_port_range: Optional[str] = None,
            source_transit_gateway_attachment_id: Optional[str] = None,
            source_transit_gateway_attachment_type: Optional[str] = None,
            timeouts: Optional[MeteringPolicyEntryTimeoutsArgs] = None,
            transit_gateway_metering_policy_id: Optional[str] = None) -> MeteringPolicyEntry
    func GetMeteringPolicyEntry(ctx *Context, name string, id IDInput, state *MeteringPolicyEntryState, opts ...ResourceOption) (*MeteringPolicyEntry, error)
    public static MeteringPolicyEntry Get(string name, Input<string> id, MeteringPolicyEntryState? state, CustomResourceOptions? opts = null)
    public static MeteringPolicyEntry get(String name, Output<String> id, MeteringPolicyEntryState state, CustomResourceOptions options)
    resources:  _:    type: aws:ec2transitgateway:MeteringPolicyEntry    get:      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:
    DestinationCidrBlock string
    Destination CIDR block to match. If not specified, all destination CIDR blocks are matched.
    DestinationPortRange string
    DestinationTransitGatewayAttachmentId string
    DestinationTransitGatewayAttachmentType string
    MeteredAccount string
    The account to charge for matching traffic. Valid values are source-attachment-owner or destination-attachment-owner.
    PolicyRuleNumber int
    Rule number for this entry. Lower numbers have higher priority. Valid values are between 1 and 32766.
    Protocol string
    Protocol number to match (e.g., 6 for TCP, 17 for UDP). If not specified, all protocols are matched.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    SourceCidrBlock string
    Source CIDR block to match. If not specified, all source CIDR blocks are matched.
    SourcePortRange string
    SourceTransitGatewayAttachmentId string
    SourceTransitGatewayAttachmentType string
    Timeouts MeteringPolicyEntryTimeouts
    TransitGatewayMeteringPolicyId string

    EC2 Transit Gateway Metering Policy identifier.

    The following arguments are optional:

    DestinationCidrBlock string
    Destination CIDR block to match. If not specified, all destination CIDR blocks are matched.
    DestinationPortRange string
    DestinationTransitGatewayAttachmentId string
    DestinationTransitGatewayAttachmentType string
    MeteredAccount string
    The account to charge for matching traffic. Valid values are source-attachment-owner or destination-attachment-owner.
    PolicyRuleNumber int
    Rule number for this entry. Lower numbers have higher priority. Valid values are between 1 and 32766.
    Protocol string
    Protocol number to match (e.g., 6 for TCP, 17 for UDP). If not specified, all protocols are matched.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    SourceCidrBlock string
    Source CIDR block to match. If not specified, all source CIDR blocks are matched.
    SourcePortRange string
    SourceTransitGatewayAttachmentId string
    SourceTransitGatewayAttachmentType string
    Timeouts MeteringPolicyEntryTimeoutsArgs
    TransitGatewayMeteringPolicyId string

    EC2 Transit Gateway Metering Policy identifier.

    The following arguments are optional:

    destinationCidrBlock String
    Destination CIDR block to match. If not specified, all destination CIDR blocks are matched.
    destinationPortRange String
    destinationTransitGatewayAttachmentId String
    destinationTransitGatewayAttachmentType String
    meteredAccount String
    The account to charge for matching traffic. Valid values are source-attachment-owner or destination-attachment-owner.
    policyRuleNumber Integer
    Rule number for this entry. Lower numbers have higher priority. Valid values are between 1 and 32766.
    protocol String
    Protocol number to match (e.g., 6 for TCP, 17 for UDP). If not specified, all protocols are matched.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    sourceCidrBlock String
    Source CIDR block to match. If not specified, all source CIDR blocks are matched.
    sourcePortRange String
    sourceTransitGatewayAttachmentId String
    sourceTransitGatewayAttachmentType String
    timeouts MeteringPolicyEntryTimeouts
    transitGatewayMeteringPolicyId String

    EC2 Transit Gateway Metering Policy identifier.

    The following arguments are optional:

    destinationCidrBlock string
    Destination CIDR block to match. If not specified, all destination CIDR blocks are matched.
    destinationPortRange string
    destinationTransitGatewayAttachmentId string
    destinationTransitGatewayAttachmentType string
    meteredAccount string
    The account to charge for matching traffic. Valid values are source-attachment-owner or destination-attachment-owner.
    policyRuleNumber number
    Rule number for this entry. Lower numbers have higher priority. Valid values are between 1 and 32766.
    protocol string
    Protocol number to match (e.g., 6 for TCP, 17 for UDP). If not specified, all protocols are matched.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    sourceCidrBlock string
    Source CIDR block to match. If not specified, all source CIDR blocks are matched.
    sourcePortRange string
    sourceTransitGatewayAttachmentId string
    sourceTransitGatewayAttachmentType string
    timeouts MeteringPolicyEntryTimeouts
    transitGatewayMeteringPolicyId string

    EC2 Transit Gateway Metering Policy identifier.

    The following arguments are optional:

    destination_cidr_block str
    Destination CIDR block to match. If not specified, all destination CIDR blocks are matched.
    destination_port_range str
    destination_transit_gateway_attachment_id str
    destination_transit_gateway_attachment_type str
    metered_account str
    The account to charge for matching traffic. Valid values are source-attachment-owner or destination-attachment-owner.
    policy_rule_number int
    Rule number for this entry. Lower numbers have higher priority. Valid values are between 1 and 32766.
    protocol str
    Protocol number to match (e.g., 6 for TCP, 17 for UDP). If not specified, all protocols are matched.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    source_cidr_block str
    Source CIDR block to match. If not specified, all source CIDR blocks are matched.
    source_port_range str
    source_transit_gateway_attachment_id str
    source_transit_gateway_attachment_type str
    timeouts MeteringPolicyEntryTimeoutsArgs
    transit_gateway_metering_policy_id str

    EC2 Transit Gateway Metering Policy identifier.

    The following arguments are optional:

    destinationCidrBlock String
    Destination CIDR block to match. If not specified, all destination CIDR blocks are matched.
    destinationPortRange String
    destinationTransitGatewayAttachmentId String
    destinationTransitGatewayAttachmentType String
    meteredAccount String
    The account to charge for matching traffic. Valid values are source-attachment-owner or destination-attachment-owner.
    policyRuleNumber Number
    Rule number for this entry. Lower numbers have higher priority. Valid values are between 1 and 32766.
    protocol String
    Protocol number to match (e.g., 6 for TCP, 17 for UDP). If not specified, all protocols are matched.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    sourceCidrBlock String
    Source CIDR block to match. If not specified, all source CIDR blocks are matched.
    sourcePortRange String
    sourceTransitGatewayAttachmentId String
    sourceTransitGatewayAttachmentType String
    timeouts Property Map
    transitGatewayMeteringPolicyId String

    EC2 Transit Gateway Metering Policy identifier.

    The following arguments are optional:

    Supporting Types

    MeteringPolicyEntryTimeouts, MeteringPolicyEntryTimeoutsArgs

    Create string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    Delete string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    Create string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    Delete string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    create String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    delete String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    create string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    delete string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    create str
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    delete str
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    create String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    delete String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.

    Import

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

    $ pulumi import aws:ec2transitgateway/meteringPolicyEntry:MeteringPolicyEntry example tgw-policy-12345678,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
    Viewing docs for AWS v7.27.0
    published on Thursday, Apr 23, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.