View a markdown version of this page

AWS::PricingPlanManager::Subscription - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

This is the new Amazon CloudFormation Template Reference Guide. Please update your bookmarks and links. For help getting started with CloudFormation, see the Amazon CloudFormation User Guide.

AWS::PricingPlanManager::Subscription

Creates a flat-rate pricing plan subscription that applies a fixed monthly rate to the associated resources instead of usage-based charges. Currently, CloudFront is the only supported plan family.

The service creates paid-tier subscriptions in PENDING_APPROVAL status. Billing does not start until you approve the subscription through a separate ApprovePaidSubscription API call — Amazon CloudFormation does not approve the subscription automatically. The service activates free-tier subscriptions immediately.

When you delete an active subscription, the cancellation is scheduled for the end of the current billing period. When you delete a subscription in PENDING_APPROVAL status, the service removes it immediately with no further charges.

Syntax

To declare this entity in your Amazon CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::PricingPlanManager::Subscription", "Properties" : { "PlanFamily" : String, "PlanTier" : String, "ResourceArns" : [ String, ... ], "UsageLevel" : String } }

YAML

Type: AWS::PricingPlanManager::Subscription Properties: PlanFamily: String PlanTier: String ResourceArns: - String UsageLevel: String

Properties

PlanFamily

The pricing plan family. Use CloudFront.

Required: Yes

Type: String

Allowed values: CloudFront

Update requires: Replacement

PlanTier

The plan tier. Valid values:

FREE

No cost. The service activates free-tier subscriptions immediately.

PRO

Paid tier billed at a flat monthly rate.

BUSINESS

Paid tier billed at a flat monthly rate.

PREMIUM

Paid tier billed at a flat monthly rate. Supports additional usage levels.

Upgrades take effect immediately. Downgrades are scheduled for the end of the current billing period:

  • Features exclusive to your current tier become unavailable immediately after you request the downgrade.

  • Billing remains at the current tier until the effective date.

  • While a downgrade is scheduled, CurrentPlanTier reports the tier you are being billed for.

Required: Yes

Type: String

Update requires: No interruption

ResourceArns

The ARNs of resources to associate with the subscription. For Amazon CloudFront plans, you must include a CloudFront distribution ARN and an Amazon WAF web ACL ARN. You can optionally include an Amazon Route 53 hosted zone ARN or a CloudFront KeyValueStore ARN.

Required: Yes

Type: Array of String

Minimum: 1

Maximum: 10

Update requires: No interruption

UsageLevel

The usage level within the plan tier. Valid values depend on the plan family and tier. For Amazon CloudFront Premium plans, valid values are:

DEFAULT

The base usage level.

CF_PREMIUM_L2 through CF_PREMIUM_L6

Increasing usage levels, each supporting higher traffic volumes.

If you omit this property during an update, the usage level resets to the default level — it is not left unchanged. To preserve the current usage level, always specify it explicitly.

Required: No

Type: String

Allowed values: DEFAULT | CF_PREMIUM_L2 | CF_PREMIUM_L3 | CF_PREMIUM_L4 | CF_PREMIUM_L5 | CF_PREMIUM_L6 | CF_PREMIUM_L7

Update requires: No interruption

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the subscription ARN. For example:

arn:aws:pricingplanmanager::111122223333:subscription:sub_35GHLKfG8y9CsMkHV8EXAMPLE

For more information about using the Ref function, see Ref.

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

Arn

The ARN of the subscription. For example:

arn:aws:pricingplanmanager::111122223333:subscription:sub_35GHLKfG8y9CsMkHV8EXAMPLE

CreatedAt

The date and time when the subscription was created, in ISO 8601 format.

CurrentPlanTier

The plan tier currently active on the subscription. This value diverges from PlanTier when a downgrade is scheduled — CurrentPlanTier reports the tier you are being billed for, while PlanTier reflects the requested tier.

Status

The status of the subscription. Valid values:

ACTIVE

The subscription is active and the pricing plan applies to the associated resources. Billing is at the subscription's plan rate.

PENDING_APPROVAL

The subscription is waiting for approval via ApprovePaidSubscription. The plan does not apply to the associated resources — usage is charged at pay-as-you-go rates until you approve the subscription. The subscription does not expire while pending approval.

SYNC_IN_PROGRESS

The service is applying a subscription change to the associated resources. This typically takes 2–5 minutes. You cannot modify the subscription while it is in this state.

FAILED

The subscription operation failed. Review the StatusReason attribute for details. Cancel the failed subscription and create a new one.

StatusReason

A human-readable explanation of why the subscription failed. Populated only when Status is FAILED. Empty for all other statuses.

UpdatedAt

The date and time when the subscription was last modified, in ISO 8601 format.

Examples

Associate existing resources with a free-tier subscription

The following example creates a FREE-tier CloudFront subscription that covers an existing CloudFront distribution and an existing WAFv2 web ACL, referenced directly by ARN. Replace the account ID, distribution ID, and web ACL name and ID with the values for your own resources. The web ACL ARN must be a CLOUDFRONT-scope (global) WAFv2 ARN in us-east-1.

YAML

AWSTemplateFormatVersion: '2010-09-09' Resources: Subscription: Type: AWS::PricingPlanManager::Subscription Properties: PlanFamily: CloudFront PlanTier: FREE UsageLevel: DEFAULT ResourceArns: - arn:aws:cloudfront::123456789012:distribution/EDFDVBD6EXAMPLE - arn:aws:wafv2:us-east-1:123456789012:global/webacl/example-web-acl/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111

Create a subscription together with its associated resources

The following example provisions a WAFv2 web ACL and a CloudFront distribution, then creates a FREE-tier subscription that references both. Because the subscription references the other resources, Amazon CloudFormation creates it last and deletes it first. Deploy this stack in us-east-1, because CLOUDFRONT-scope web ACLs exist only in that Region.

YAML

AWSTemplateFormatVersion: '2010-09-09' Resources: SampleWebAcl: Type: AWS::WAFv2::WebACL Properties: Name: !Sub 'ppm-sample-${AWS::StackName}' Scope: CLOUDFRONT DefaultAction: Allow: {} VisibilityConfig: SampledRequestsEnabled: false CloudWatchMetricsEnabled: false MetricName: ppmSample SampleDistribution: Type: AWS::CloudFront::Distribution Properties: DistributionConfig: Comment: !Sub 'PricingPlanManager sample - ${AWS::StackName}' Enabled: true # A WAFv2 web ACL is associated by ARN; the WAF Classic ID form is rejected. WebACLId: !GetAtt SampleWebAcl.Arn Origins: - Id: sample-origin DomainName: example.com CustomOriginConfig: OriginProtocolPolicy: http-only DefaultCacheBehavior: TargetOriginId: sample-origin ViewerProtocolPolicy: redirect-to-https # Managed CachingOptimized cache policy. CachePolicyId: 658327ea-f89d-4fab-a63d-7e88639e58f6 # The references below make this depend on both resources, so CloudFormation creates # the subscription last and removes it first. SampleSubscription: Type: AWS::PricingPlanManager::Subscription Properties: PlanFamily: CloudFront PlanTier: FREE UsageLevel: DEFAULT ResourceArns: - !Sub 'arn:${AWS::Partition}:cloudfront::${AWS::AccountId}:distribution/${SampleDistribution}' - !GetAtt SampleWebAcl.Arn

Associate a Route 53 hosted zone with a subscription

The following example extends the previous template with a Route 53 hosted zone and adds its ARN to the subscription's ResourceArns. A subscription can cover a distribution, a web ACL, and a hosted zone together.

YAML

AWSTemplateFormatVersion: '2010-09-09' Resources: SampleWebAcl: Type: AWS::WAFv2::WebACL Properties: Name: !Sub 'ppm-sample-${AWS::StackName}' Scope: CLOUDFRONT DefaultAction: Allow: {} VisibilityConfig: SampledRequestsEnabled: false CloudWatchMetricsEnabled: false MetricName: ppmSample SampleDistribution: Type: AWS::CloudFront::Distribution Properties: DistributionConfig: Comment: !Sub 'PricingPlanManager sample - ${AWS::StackName}' Enabled: true # A WAFv2 web ACL is associated by ARN; the WAF Classic ID form is rejected. WebACLId: !GetAtt SampleWebAcl.Arn Origins: - Id: sample-origin DomainName: example.com CustomOriginConfig: OriginProtocolPolicy: http-only DefaultCacheBehavior: TargetOriginId: sample-origin ViewerProtocolPolicy: redirect-to-https # Managed CachingOptimized cache policy. CachePolicyId: 658327ea-f89d-4fab-a63d-7e88639e58f6 SampleHostedZone: Type: AWS::Route53::HostedZone Properties: Name: ppm-sample.example.com. # The references below make this depend on all three resources, so CloudFormation # creates the subscription last and removes it first. SampleSubscription: Type: AWS::PricingPlanManager::Subscription Properties: PlanFamily: CloudFront PlanTier: FREE UsageLevel: DEFAULT ResourceArns: - !Sub 'arn:${AWS::Partition}:cloudfront::${AWS::AccountId}:distribution/${SampleDistribution}' - !GetAtt SampleWebAcl.Arn - !Sub 'arn:${AWS::Partition}:route53:::hostedzone/${SampleHostedZone}'

Add a CloudFront KeyValueStore to a paid-tier subscription

A subscription associates exactly one distribution and one web ACL. A CloudFront KeyValueStore is optional, limited to one, and requires the PRO tier or higher. Paid tiers start in PENDING_APPROVAL and must be approved out of band before billing begins; Amazon CloudFormation never approves them.

YAML

AWSTemplateFormatVersion: '2010-09-09' Resources: SampleWebAcl: Type: AWS::WAFv2::WebACL Properties: Name: !Sub 'ppm-sample-${AWS::StackName}' Scope: CLOUDFRONT DefaultAction: Allow: {} VisibilityConfig: SampledRequestsEnabled: false CloudWatchMetricsEnabled: false MetricName: ppmSample SampleDistribution: Type: AWS::CloudFront::Distribution Properties: DistributionConfig: Comment: !Sub 'PricingPlanManager sample - ${AWS::StackName}' Enabled: true # A WAFv2 web ACL is associated by ARN; the WAF Classic ID form is rejected. WebACLId: !GetAtt SampleWebAcl.Arn Origins: - Id: sample-origin DomainName: example.com CustomOriginConfig: OriginProtocolPolicy: http-only DefaultCacheBehavior: TargetOriginId: sample-origin ViewerProtocolPolicy: redirect-to-https # Managed CachingOptimized cache policy. CachePolicyId: 658327ea-f89d-4fab-a63d-7e88639e58f6 SampleKeyValueStore: Type: AWS::CloudFront::KeyValueStore Properties: Name: !Sub 'ppmkvs-${AWS::StackName}' # A subscription associates exactly one distribution and one web ACL. A Key Value # Store is optional, limited to one, and requires the Pro tier or higher. Paid tiers # start in PENDING_APPROVAL and must be approved out of band before billing begins. SampleSubscription: Type: AWS::PricingPlanManager::Subscription Properties: PlanFamily: CloudFront PlanTier: PRO UsageLevel: DEFAULT ResourceArns: - !Sub 'arn:${AWS::Partition}:cloudfront::${AWS::AccountId}:distribution/${SampleDistribution}' - !GetAtt SampleWebAcl.Arn - !GetAtt SampleKeyValueStore.Arn