subscriptions
Creates, updates, deletes, gets or lists a subscriptions resource.
Overview
| Name | subscriptions |
| Type | Resource |
| Id | aws.pricing_plan_manager.subscriptions |
Fields
The following fields are returned by SELECT queries:
- get_subscription
- list_subscriptions
| Name | Datatype | Description |
|---|---|---|
e_tag | string | The entity tag for concurrency control. Use this value in the If-Match header for subsequent operations on this subscription. |
subscription | object | The details of the requested subscription. |
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) of a flat-rate pricing subscription. |
created_at | string (date-time) | The date and time when the subscription was created, in ISO 8601 format. |
e_tag | string | The entity tag for concurrency control. Pass this value in the If-Match header when making changes to this subscription. |
plan_family | string | The pricing plan family for the subscription, such as CloudFront. |
plan_tier | string | The current tier level of the pricing plan. |
resource_arns | array | A list of 1 to 10 AWS resource ARNs to include in the subscription. |
scheduled_change | object | A pending change that will take effect at the end of the current billing period, if any. |
status | string | The current status of the subscription. (PENDING_APPROVAL, ACTIVE, SYNC_IN_PROGRESS, FAILED) |
status_reason | string | A human-readable explanation of the current status, present when additional context is available. |
updated_at | string (date-time) | The date and time when the subscription was last modified, in ISO 8601 format. |
usage_level | string | The usage level within the plan tier. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_subscription | select | region | Returns the details of a flat-rate pricing subscription, including its current status, associated resources, and any pending scheduled changes. | |
list_subscriptions | select | region | Returns a summary of all flat-rate pricing subscriptions in the calling account. | |
create_subscription | insert | region, planFamily, planTier, resourceArns | 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. | |
associate_resources_to_subscription | update | If-Match, region, arn, resourceArns | 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_subscription | update | If-Match, region, arn, planTier | Changes 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_change | exec | If-Match, region, arn | 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. | |
disassociate_resources_from_subscription | exec | If-Match, region, arn, resourceArns | Removes 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.
| Name | Datatype | Description |
|---|---|---|
If-Match | string | The ETag value from a previous GetSubscription or ListSubscriptions response. |
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_subscription
- list_subscriptions
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
;
Returns a summary of all flat-rate pricing subscriptions in the calling account.
SELECT
arn,
created_at,
e_tag,
plan_family,
plan_tier,
resource_arns,
scheduled_change,
status,
status_reason,
updated_at,
usage_level
FROM aws.pricing_plan_manager.subscriptions
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_subscription
- Manifest
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
;
# Description fields are for documentation purposes
- name: subscriptions
props:
- name: region
value: "{{ region }}"
description: Required parameter for the subscriptions resource.
- name: planFamily
value: "{{ planFamily }}"
- name: planTier
value: "{{ planTier }}"
- name: usageLevel
value: "{{ usageLevel }}"
- name: resourceArns
value:
- "{{ resourceArns }}"
description: |
A list of 1 to 10 AWS resource ARNs to include in the subscription.
- name: approvalMode
value: "{{ approvalMode }}"
description: |
Determines whether a subscription requires explicit approval before billing starts.
valid_values: ['MANUAL', 'IMMEDIATE']
- name: clientToken
value: "{{ clientToken }}"
description: |
A unique, case-sensitive identifier that you provide to ensure a request is handled only once.
UPDATE examples
- associate_resources_to_subscription
- update_subscription
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;
Changes 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.
UPDATE aws.pricing_plan_manager.subscriptions
SET
arn = '{{ arn }}',
planTier = '{{ planTier }}',
usageLevel = '{{ usageLevel }}',
clientToken = '{{ clientToken }}'
WHERE
`If-Match` = '{{ If-Match }}' --required
AND region = '{{ region }}' --required
AND arn = '{{ arn }}' --required
AND planTier = '{{ planTier }}' --required
RETURNING
e_tag,
subscription;
Lifecycle Methods
- cancel_subscription_change
- disassociate_resources_from_subscription
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 }}"
}'
;
Removes 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.
EXEC aws.pricing_plan_manager.subscriptions.disassociate_resources_from_subscription
@If-Match='{{ If-Match }}' --required,
@region='{{ region }}' --required
@@json=
'{
"arn": "{{ arn }}",
"resourceArns": "{{ resourceArns }}",
"clientToken": "{{ clientToken }}"
}'
;