transit_gateway_metering_policy_entries
Creates, updates, deletes, gets or lists a transit_gateway_metering_policy_entries resource.
Overview
| Name | transit_gateway_metering_policy_entries |
| Type | Resource |
| Id | aws.ec2.transit_gateway_metering_policy_entries |
Fields
The following fields are returned by SELECT queries:
- get_transit_gateway_metering_policy_entries
| Name | Datatype | Description |
|---|---|---|
metered_account | string | The Amazon Web Services account ID to which the metered traffic is attributed. |
metering_policy_rule | string | The metering policy rule that defines traffic matching criteria. |
policy_rule_number | string | The rule number of the metering policy entry. |
state | string | The state of the metering policy entry. |
update_effective_at | string | The date and time when the metering policy entry update becomes effective. |
updated_at | string | The date and time when the metering policy entry was last updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_transit_gateway_metering_policy_entries | select | TransitGatewayMeteringPolicyId, region | Filter, MaxResults, NextToken, DryRun | Retrieves the entries for a transit gateway metering policy. |
create_transit_gateway_metering_policy_entry | insert | TransitGatewayMeteringPolicyId, PolicyRuleNumber, MeteredAccount, region | SourceTransitGatewayAttachmentId, SourceTransitGatewayAttachmentType, SourceCidrBlock, SourcePortRange, DestinationTransitGatewayAttachmentId, DestinationTransitGatewayAttachmentType, DestinationCidrBlock, DestinationPortRange, Protocol, DryRun | Creates an entry in a transit gateway metering policy to define traffic measurement rules. |
delete_transit_gateway_metering_policy_entry | delete | TransitGatewayMeteringPolicyId, PolicyRuleNumber, region | DryRun | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
MeteredAccount | string | The Amazon Web Services account ID to which the metered traffic should be attributed. |
PolicyRuleNumber | integer | The rule number of the metering policy entry to delete. |
TransitGatewayMeteringPolicyId | string | The ID of the transit gateway metering policy containing the entry to delete. |
region | string | AWS region (default: us-east-1) |
DestinationCidrBlock | string | The destination CIDR block for traffic matching. |
DestinationPortRange | string | The destination port range for traffic matching. |
DestinationTransitGatewayAttachmentId | string | The ID of the destination transit gateway attachment for traffic matching. |
DestinationTransitGatewayAttachmentType | string | The 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. |
DryRun | boolean | Checks 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. |
Filter | array | One or more filters to apply when retrieving metering policy entries. |
MaxResults | integer | The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value. |
NextToken | string | The token for the next page of results. |
Protocol | string | The protocol for traffic matching (1, 6, 17, etc.). |
SourceCidrBlock | string | The source CIDR block for traffic matching. |
SourcePortRange | string | The source port range for traffic matching. |
SourceTransitGatewayAttachmentId | string | The ID of the source transit gateway attachment for traffic matching. |
SourceTransitGatewayAttachmentType | string | The 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
- get_transit_gateway_metering_policy_entries
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
- create_transit_gateway_metering_policy_entry
- Manifest
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
;
# Description fields are for documentation purposes
- name: transit_gateway_metering_policy_entries
props:
- name: TransitGatewayMeteringPolicyId
value: "{{ TransitGatewayMeteringPolicyId }}"
description: Required parameter for the transit_gateway_metering_policy_entries resource.
- name: PolicyRuleNumber
value: {{ PolicyRuleNumber }}
description: Required parameter for the transit_gateway_metering_policy_entries resource.
- name: MeteredAccount
value: "{{ MeteredAccount }}"
description: Required parameter for the transit_gateway_metering_policy_entries resource.
- name: region
value: "{{ region }}"
description: Required parameter for the transit_gateway_metering_policy_entries resource.
- name: SourceTransitGatewayAttachmentId
value: "{{ SourceTransitGatewayAttachmentId }}"
description: The ID of the source transit gateway attachment for traffic matching.
description: The ID of the source transit gateway attachment for traffic matching.
- name: SourceTransitGatewayAttachmentType
value: "{{ SourceTransitGatewayAttachmentType }}"
description: The 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.
description: The 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.
- name: SourceCidrBlock
value: "{{ SourceCidrBlock }}"
description: The source CIDR block for traffic matching.
description: The source CIDR block for traffic matching.
- name: SourcePortRange
value: "{{ SourcePortRange }}"
description: The source port range for traffic matching.
description: The source port range for traffic matching.
- name: DestinationTransitGatewayAttachmentId
value: "{{ DestinationTransitGatewayAttachmentId }}"
description: The ID of the destination transit gateway attachment for traffic matching.
description: The ID of the destination transit gateway attachment for traffic matching.
- name: DestinationTransitGatewayAttachmentType
value: "{{ DestinationTransitGatewayAttachmentType }}"
description: The 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.
description: The 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.
- name: DestinationCidrBlock
value: "{{ DestinationCidrBlock }}"
description: The destination CIDR block for traffic matching.
description: The destination CIDR block for traffic matching.
- name: DestinationPortRange
value: "{{ DestinationPortRange }}"
description: The destination port range for traffic matching.
description: The destination port range for traffic matching.
- name: Protocol
value: "{{ Protocol }}"
description: The protocol for traffic matching (1, 6, 17, etc.).
description: The protocol for traffic matching (1, 6, 17, etc.).
- name: DryRun
value: {{ DryRun }}
description: Checks 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.
description: Checks 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.
DELETE examples
- delete_transit_gateway_metering_policy_entry
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 }}'
;