PricingPlanManager / Client / create_subscription
create_subscription¶
- PricingPlanManager.Client.create_subscription(**kwargs)¶
Creates a flat-rate pricing subscription for the specified resources.
Note
When
approvalModeis set toMANUAL, paid-tier subscriptions are created inPENDING_APPROVALstatus and require a separateApprovePaidSubscriptioncall before billing starts. Free-tier subscriptions are always activated immediately regardless of approval mode.When
approvalModeis set toIMMEDIATEor is not specified, the subscription is activated immediately.See also: AWS API Documentation
Request Syntax
response = client.create_subscription( planFamily='string', planTier='string', usageLevel='string', resourceArns=[ 'string', ], approvalMode='MANUAL'|'IMMEDIATE', clientToken='string' )
- Parameters:
planFamily (string) –
[REQUIRED]
The pricing plan family to subscribe to, such as
CloudFront.planTier (string) –
[REQUIRED]
The tier level for the subscription, such as
FREE,PRO,BUSINESS, orPREMIUM.usageLevel (string) – The usage level within the plan tier. Specify
DEFAULTfor the base configuration, or a higher level if your plan tier supports it.resourceArns (list) –
[REQUIRED]
The ARNs of the AWS resources to include in the subscription. Specify one or more supported resources.
Note
For subscriptions in the CloudFront plan family, the resources must include exactly one Amazon CloudFront distribution and exactly one AWS WAF web ACL. You can also include other supported resources, such as Amazon Route 53 hosted zones and CloudFront KeyValueStores.
(string) –
approvalMode (string) – Determines whether the subscription requires explicit approval before billing starts. Set to
MANUALto require a separateApprovePaidSubscriptioncall, orIMMEDIATEto activate the subscription right away. Defaults toIMMEDIATEif not specified.clientToken (string) –
A unique, case-sensitive identifier that you provide to ensure that the request is handled only once. If you send the same request with the same client token, the API returns the original response without creating a duplicate subscription.
This field is autopopulated if not provided.
- Return type:
dict
- Returns:
Response Syntax
{ 'subscription': { 'arn': 'string', 'planFamily': 'string', 'planTier': 'string', 'usageLevel': 'string', 'scheduledChange': { 'changeType': 'DOWNGRADE'|'CANCELLATION', 'effectiveDate': datetime(2015, 1, 1), 'planTier': 'string', 'usageLevel': 'string' }, 'status': 'PENDING_APPROVAL'|'ACTIVE'|'SYNC_IN_PROGRESS'|'FAILED', 'statusReason': 'string', 'resourceArns': [ 'string', ], 'createdAt': datetime(2015, 1, 1), 'updatedAt': datetime(2015, 1, 1) }, 'eTag': 'string' }
Response Structure
(dict) –
subscription (dict) –
The details of the newly created subscription.
arn (string) –
The Amazon Resource Name (ARN) that uniquely identifies this subscription.
planFamily (string) –
The pricing plan family for the subscription, such as
CloudFront.planTier (string) –
The current tier level of the pricing plan, such as
FREE,PRO,BUSINESS, orPREMIUM.usageLevel (string) –
The usage level within the plan tier. When present, indicates a specific capacity configuration beyond the base tier.
scheduledChange (dict) –
A pending change that will take effect at the end of the current billing period. This field is present only when a downgrade or cancellation is scheduled.
changeType (string) –
The type of pending change. Possible values are
DOWNGRADE(a tier change to a lower level) andCANCELLATION(subscription termination).effectiveDate (datetime) –
The date and time when the change takes effect, in ISO 8601 format. This value is populated after the change is confirmed by the billing system.
planTier (string) –
For downgrades, the tier level that the subscription will change to. Not present for cancellations.
usageLevel (string) –
For downgrades, the target usage level after the change takes effect.
status (string) –
The current status of the subscription. For the list of possible values, see the
Statustype.statusReason (string) –
A human-readable explanation of the current status, present when additional context is available.
resourceArns (list) –
The ARNs of the AWS resources covered by this subscription.
(string) –
createdAt (datetime) –
The date and time when the subscription was created, in ISO 8601 format.
updatedAt (datetime) –
The date and time when the subscription was last modified, in ISO 8601 format.
eTag (string) –
The entity tag for concurrency control. Use this value in the
If-Matchheader for subsequent operations on this subscription.
Exceptions