Skip to main content

transit_gateway_metering_policies

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

Overview

Nametransit_gateway_metering_policies
TypeResource
Idaws.ec2.transit_gateway_metering_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
middlebox_attachment_idsstringThe IDs of the middlebox attachments associated with the metering policy.
statestringThe state of the transit gateway metering policy.
tagsstringThe tags assigned to the transit gateway metering policy.
transit_gateway_idstringThe ID of the transit gateway associated with the metering policy.
transit_gateway_metering_policy_idstringThe ID of the transit gateway metering policy.
update_effective_atstringThe date and time when the metering policy update becomes effective.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_transit_gateway_metering_policiesselectregionTransitGatewayMeteringPolicyIds, Filter, MaxResults, NextToken, DryRunDescribes one or more transit gateway metering policies.
create_transit_gateway_metering_policyinsertTransitGatewayId, regionMiddleboxAttachmentId, TagSpecifications, DryRunCreates a metering policy for a transit gateway to track and measure network traffic.
modify_transit_gateway_metering_policyupdateTransitGatewayMeteringPolicyId, regionAddMiddleboxAttachmentId, RemoveMiddleboxAttachmentId, DryRunModifies a transit gateway metering policy.
delete_transit_gateway_metering_policydeleteTransitGatewayMeteringPolicyId, regionDryRunDeletes 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
TransitGatewayIdstringThe ID of the transit gateway for which to create the metering policy.
TransitGatewayMeteringPolicyIdstringThe ID of the transit gateway metering policy to delete.
regionstringAWS region (default: us-east-1)
AddMiddleboxAttachmentIdarrayThe IDs of middlebox attachments to add to the metering policy.
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 describing transit gateway metering policies.
MaxResultsintegerThe maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.
MiddleboxAttachmentIdarrayThe IDs of the middlebox attachments to include in the metering policy.
NextTokenstringThe token for the next page of results.
RemoveMiddleboxAttachmentIdarrayThe IDs of middlebox attachments to remove from the metering policy.
TagSpecificationsarrayThe tags to assign to the metering policy.
TransitGatewayMeteringPolicyIdsarrayThe IDs of the transit gateway metering policies to describe.

SELECT examples

Describes one or more transit gateway metering policies.

SELECT
middlebox_attachment_ids,
state,
tags,
transit_gateway_id,
transit_gateway_metering_policy_id,
update_effective_at
FROM aws.ec2.transit_gateway_metering_policies
WHERE region = '{{ region }}' -- required
AND TransitGatewayMeteringPolicyIds = '{{ TransitGatewayMeteringPolicyIds }}'
AND Filter = '{{ Filter }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
AND DryRun = '{{ DryRun }}'
;

INSERT examples

Creates a metering policy for a transit gateway to track and measure network traffic.

INSERT INTO aws.ec2.transit_gateway_metering_policies (
TransitGatewayId,
region,
MiddleboxAttachmentId,
TagSpecifications,
DryRun
)
SELECT
'{{ TransitGatewayId }}',
'{{ region }}',
'{{ MiddleboxAttachmentId }}',
'{{ TagSpecifications }}',
'{{ DryRun }}'
RETURNING
middlebox_attachment_ids,
state,
tags,
transit_gateway_id,
transit_gateway_metering_policy_id,
update_effective_at
;

UPDATE examples

Modifies a transit gateway metering policy.

UPDATE aws.ec2.transit_gateway_metering_policies
SET
-- No updatable properties
WHERE
TransitGatewayMeteringPolicyId = '{{ TransitGatewayMeteringPolicyId }}' --required
AND region = '{{ region }}' --required
AND AddMiddleboxAttachmentId = '{{ AddMiddleboxAttachmentId}}'
AND RemoveMiddleboxAttachmentId = '{{ RemoveMiddleboxAttachmentId}}'
AND DryRun = {{ DryRun}}
RETURNING
middlebox_attachment_ids,
state,
tags,
transit_gateway_id,
transit_gateway_metering_policy_id,
update_effective_at;

DELETE examples

Deletes a transit gateway metering policy.

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