Skip to main content

subscriptions

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

Overview

Namesubscriptions
TypeResource
Idaws.pricing_plan_manager.subscriptions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
e_tagstringThe entity tag for concurrency control. Use this value in the If-Match header for subsequent operations on this subscription.
subscriptionobjectThe details of the requested subscription.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_subscriptionselectregionReturns the details of a flat-rate pricing subscription, including its current status, associated resources, and any pending scheduled changes.
list_subscriptionsselectregionReturns a summary of all flat-rate pricing subscriptions in the calling account.
create_subscriptioninsertregion, planFamily, planTier, resourceArnsCreates a flat-rate pricing subscription for the specified resources. When approvalMode is set to MANUAL, paid-tier subscriptions are created in PENDING_APPROVAL status and require a separate ApprovePaidSubscription call before billing starts. Free-tier subscriptions are always activated immediately regardless of approval mode. When approvalMode is set to IMMEDIATE or is not specified, the subscription is activated immediately.
associate_resources_to_subscriptionupdateIf-Match, region, arn, resourceArnsAdds one or more resources to an existing subscription. The subscription must be in an active state that is not pending other changes. For subscriptions in the CloudFront plan family, the associated resources must include exactly one Amazon CloudFront distribution and one AWS WAF web ACL. You can also include other supported resources, such as Amazon Route 53 hosted zones, and CloudFront KeyValueStores.
update_subscriptionupdateIf-Match, region, arn, planTierChanges the plan tier of an existing subscription. Upgrades take effect immediately. Downgrades are scheduled and the current tier remains unchanged until the end of the billing cycle (calendar month). You cannot update a subscription while a scheduled change is pending. To make a new change, first cancel the pending change using CancelSubscriptionChange. This operation replaces the plan tier value. If you omit the optional usageLevel field, it is reset to the default.
cancel_subscription_changeexecIf-Match, region, arnCancels a pending scheduled change on a subscription, such as a pending downgrade or cancellation. The subscription returns to its state before the change was scheduled. You cannot cancel a scheduled change close to its effective date. If the change is within the processing window, this operation returns an error.
disassociate_resources_from_subscriptionexecIf-Match, region, arn, resourceArnsRemoves one or more resources from an existing subscription. For subscriptions in the CloudFront plan family, the associated resources must always include exactly one Amazon CloudFront distribution and exactly one AWS WAF web ACL. You cannot remove these required resources.

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
If-MatchstringThe ETag value from a previous GetSubscription or ListSubscriptions response.
regionstringAWS region (default: us-east-1)

SELECT examples

Returns the details of a flat-rate pricing subscription, including its current status, associated resources, and any pending scheduled changes.

SELECT
e_tag,
subscription
FROM aws.pricing_plan_manager.subscriptions
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a flat-rate pricing subscription for the specified resources. When approvalMode is set to MANUAL, paid-tier subscriptions are created in PENDING_APPROVAL status and require a separate ApprovePaidSubscription call before billing starts. Free-tier subscriptions are always activated immediately regardless of approval mode. When approvalMode is set to IMMEDIATE or is not specified, the subscription is activated immediately.

INSERT INTO aws.pricing_plan_manager.subscriptions (
planFamily,
planTier,
usageLevel,
resourceArns,
approvalMode,
clientToken,
region
)
SELECT
'{{ planFamily }}' /* required */,
'{{ planTier }}' /* required */,
'{{ usageLevel }}',
'{{ resourceArns }}' /* required */,
'{{ approvalMode }}',
'{{ clientToken }}',
'{{ region }}'
RETURNING
e_tag,
subscription
;

UPDATE examples

Adds one or more resources to an existing subscription. The subscription must be in an active state that is not pending other changes. For subscriptions in the CloudFront plan family, the associated resources must include exactly one Amazon CloudFront distribution and one AWS WAF web ACL. You can also include other supported resources, such as Amazon Route 53 hosted zones, and CloudFront KeyValueStores.

UPDATE aws.pricing_plan_manager.subscriptions
SET
arn = '{{ arn }}',
resourceArns = '{{ resourceArns }}',
clientToken = '{{ clientToken }}'
WHERE
`If-Match` = '{{ If-Match }}' --required
AND region = '{{ region }}' --required
AND arn = '{{ arn }}' --required
AND resourceArns = '{{ resourceArns }}' --required
RETURNING
e_tag,
subscription;

Lifecycle Methods

Cancels a pending scheduled change on a subscription, such as a pending downgrade or cancellation. The subscription returns to its state before the change was scheduled. You cannot cancel a scheduled change close to its effective date. If the change is within the processing window, this operation returns an error.

EXEC aws.pricing_plan_manager.subscriptions.cancel_subscription_change
@If-Match='{{ If-Match }}' --required,
@region='{{ region }}' --required
@@json=
'{
"arn": "{{ arn }}",
"clientToken": "{{ clientToken }}"
}'
;