CreateSubscription
Creates a flat-rate pricing subscription for the specified resources.
Note
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.
Request Syntax
POST /v1/CreateSubscription HTTP/1.1
Content-type: application/json
{
"approvalMode": "string",
"clientToken": "string",
"planFamily": "string",
"planTier": "string",
"resourceArns": [ "string" ],
"usageLevel": "string"
}
URI Request Parameters
The request does not use any URI parameters.
Request Body
The request accepts the following data in JSON format.
- planFamily
-
The pricing plan family to subscribe to, such as
CloudFront.Type: String
Required: Yes
- planTier
-
The tier level for the subscription, such as
FREE,PRO,BUSINESS, orPREMIUM.Type: String
Required: Yes
- resourceArns
-
The ARNs of the Amazon 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 Amazon WAF web ACL. You can also include other supported resources, such as Amazon Route 53 hosted zones and CloudFront KeyValueStores.
Type: Array of strings
Array Members: Minimum number of 1 item. Maximum number of 10 items.
Required: Yes
- approvalMode
-
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.Type: String
Valid Values:
MANUAL | IMMEDIATERequired: No
- clientToken
-
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.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 64.
Required: No
- usageLevel
-
The usage level within the plan tier. Specify
DEFAULTfor the base configuration, or a higher level if your plan tier supports it.Type: String
Required: No
Response Syntax
HTTP/1.1 200
ETag: eTag
Content-type: application/json
{
"arn": "string",
"createdAt": "string",
"planFamily": "string",
"planTier": "string",
"resourceArns": [ "string" ],
"scheduledChange": {
"changeType": "string",
"effectiveDate": "string",
"planTier": "string",
"usageLevel": "string"
},
"status": "string",
"statusReason": "string",
"updatedAt": "string",
"usageLevel": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The response returns the following HTTP headers.
- eTag
-
The entity tag for concurrency control. Use this value in the
If-Matchheader for subsequent operations on this subscription.
The following data is returned in JSON format by the service.
- arn
-
The Amazon Resource Name (ARN) that uniquely identifies this subscription.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 2048.
- createdAt
-
The date and time when the subscription was created, in ISO 8601 format.
Type: Timestamp
- planFamily
-
The pricing plan family for the subscription, such as
CloudFront.Type: String
- planTier
-
The current tier level of the pricing plan, such as
FREE,PRO,BUSINESS, orPREMIUM.Type: String
- resourceArns
-
The ARNs of the Amazon resources covered by this subscription.
Type: Array of strings
Array Members: Minimum number of 1 item. Maximum number of 10 items.
- status
-
The current status of the subscription. For the list of possible values, see the
Statustype.Type: String
Valid Values:
PENDING_APPROVAL | ACTIVE | SYNC_IN_PROGRESS | FAILED - updatedAt
-
The date and time when the subscription was last modified, in ISO 8601 format.
Type: Timestamp
- scheduledChange
-
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.
Type: ScheduledChange object
- statusReason
-
A human-readable explanation of the current status, present when additional context is available.
Type: String
- usageLevel
-
The usage level within the plan tier. When present, indicates a specific capacity configuration beyond the base tier.
Type: String
Errors
For information about the errors that are common to all actions, see Common Error Types.
- AccessDeniedException
-
You do not have the required permissions to perform this operation. Verify that your IAM policy grants access to this action.
HTTP Status Code: 403
- ConflictException
-
The request conflicts with the current state of the resource. This typically occurs when the
ETagvalue in theIf-Matchheader does not match the current version of the subscription. Retrieve the latest version and retry.- resourceId
-
The identifier of the resource that has a conflicting state.
HTTP Status Code: 409
- InternalServerException
-
An unexpected error occurred on the server. Retry the request.
HTTP Status Code: 500
- ResourceNotFoundException
-
The specified subscription was not found. Verify that the ARN is correct and that the subscription belongs to your account.
- resourceId
-
The identifier of the resource that was not found.
HTTP Status Code: 404
- ServiceQuotaExceededException
-
The request would exceed a service limit. You have reached the maximum number of subscriptions allowed for your account.
HTTP Status Code: 402
- ThrottlingException
-
The request rate exceeds the allowed limit. Wait briefly and retry the request.
HTTP Status Code: 429
- ValidationException
-
The request failed a business rule validation. For example, the specified resource might already be associated with another subscription, or the subscription might not be in the required state for this operation.
- resourceId
-
The identifier of the resource that failed validation.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific Amazon SDKs, see the following: