Skip to main content

transit_gateway_metering_policy_entries

Creates, updates, deletes, gets or lists a transit_gateway_metering_policy_entries resource.

Overview

Nametransit_gateway_metering_policy_entries
TypeResource
Idaws.ec2.transit_gateway_metering_policy_entries

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
metered_accountstringThe Amazon Web Services account ID to which the metered traffic is attributed.
metering_policy_rulestringThe metering policy rule that defines traffic matching criteria.
policy_rule_numberstringThe rule number of the metering policy entry.
statestringThe state of the metering policy entry.
update_effective_atstringThe date and time when the metering policy entry update becomes effective.
updated_atstringThe date and time when the metering policy entry was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_transit_gateway_metering_policy_entriesselectTransitGatewayMeteringPolicyId, regionFilter, MaxResults, NextToken, DryRunRetrieves the entries for a transit gateway metering policy.
create_transit_gateway_metering_policy_entryinsertTransitGatewayMeteringPolicyId, PolicyRuleNumber, MeteredAccount, regionSourceTransitGatewayAttachmentId, SourceTransitGatewayAttachmentType, SourceCidrBlock, SourcePortRange, DestinationTransitGatewayAttachmentId, DestinationTransitGatewayAttachmentType, DestinationCidrBlock, DestinationPortRange, Protocol, DryRunCreates an entry in a transit gateway metering policy to define traffic measurement rules.
delete_transit_gateway_metering_policy_entrydeleteTransitGatewayMeteringPolicyId, PolicyRuleNumber, regionDryRunDeletes an entry from a transit gateway metering policy.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
MeteredAccountstringThe Amazon Web Services account ID to which the metered traffic should be attributed.
PolicyRuleNumberintegerThe rule number of the metering policy entry to delete.
TransitGatewayMeteringPolicyIdstringThe ID of the transit gateway metering policy containing the entry to delete.
regionstringAWS region (default: us-east-1)
DestinationCidrBlockstringThe destination CIDR block for traffic matching.
DestinationPortRangestringThe destination port range for traffic matching.
DestinationTransitGatewayAttachmentIdstringThe ID of the destination transit gateway attachment for traffic matching.
DestinationTransitGatewayAttachmentTypestringThe type of the destination transit gateway attachment for traffic matching. Note that the tgw-peering resource type has been deprecated. To configure metering policies for Connect, use the transport attachment type.
DryRunbooleanChecks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
FilterarrayOne or more filters to apply when retrieving metering policy entries.
MaxResultsintegerThe maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.
NextTokenstringThe token for the next page of results.
ProtocolstringThe protocol for traffic matching (1, 6, 17, etc.).
SourceCidrBlockstringThe source CIDR block for traffic matching.
SourcePortRangestringThe source port range for traffic matching.
SourceTransitGatewayAttachmentIdstringThe ID of the source transit gateway attachment for traffic matching.
SourceTransitGatewayAttachmentTypestringThe type of the source transit gateway attachment for traffic matching. Note that the tgw-peering resource type has been deprecated. To configure metering policies for Connect, use the transport attachment type.

SELECT examples

Retrieves the entries for a transit gateway metering policy.

SELECT
metered_account,
metering_policy_rule,
policy_rule_number,
state,
update_effective_at,
updated_at
FROM aws.ec2.transit_gateway_metering_policy_entries
WHERE TransitGatewayMeteringPolicyId = '{{ TransitGatewayMeteringPolicyId }}' -- required
AND region = '{{ region }}' -- required
AND Filter = '{{ Filter }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
AND DryRun = '{{ DryRun }}'
;

INSERT examples

Creates an entry in a transit gateway metering policy to define traffic measurement rules.

INSERT INTO aws.ec2.transit_gateway_metering_policy_entries (
TransitGatewayMeteringPolicyId,
PolicyRuleNumber,
MeteredAccount,
region,
SourceTransitGatewayAttachmentId,
SourceTransitGatewayAttachmentType,
SourceCidrBlock,
SourcePortRange,
DestinationTransitGatewayAttachmentId,
DestinationTransitGatewayAttachmentType,
DestinationCidrBlock,
DestinationPortRange,
Protocol,
DryRun
)
SELECT
'{{ TransitGatewayMeteringPolicyId }}',
'{{ PolicyRuleNumber }}',
'{{ MeteredAccount }}',
'{{ region }}',
'{{ SourceTransitGatewayAttachmentId }}',
'{{ SourceTransitGatewayAttachmentType }}',
'{{ SourceCidrBlock }}',
'{{ SourcePortRange }}',
'{{ DestinationTransitGatewayAttachmentId }}',
'{{ DestinationTransitGatewayAttachmentType }}',
'{{ DestinationCidrBlock }}',
'{{ DestinationPortRange }}',
'{{ Protocol }}',
'{{ DryRun }}'
RETURNING
metered_account,
metering_policy_rule,
policy_rule_number,
state,
update_effective_at,
updated_at
;

DELETE examples

Deletes an entry from a transit gateway metering policy.

DELETE FROM aws.ec2.transit_gateway_metering_policy_entries
WHERE TransitGatewayMeteringPolicyId = '{{ TransitGatewayMeteringPolicyId }}' --required
AND PolicyRuleNumber = '{{ PolicyRuleNumber }}' --required
AND region = '{{ region }}' --required
AND DryRun = '{{ DryRun }}'
;