Class Subscription


  • public class Subscription
    extends com.pulumi.resources.CustomResource
    Resource for managing an AWS Pricing Plan Manager Subscription. A subscription applies a flat-rate pricing plan, such as an [Amazon CloudFront flat-rate plan](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/flat-rate-plans.html), to a set of AWS resources: you pay a fixed recurring fee for the covered resources instead of usage-based pricing. > Destroying this resource cancels the subscription. For active paid subscriptions, AWS schedules the cancellation to take effect at the end of the current billing period, so the subscription remains visible (and billed) in AWS until that date. Subscriptions in `PENDING_APPROVAL` status (and free-tier subscriptions) are deleted immediately. If a scheduled change (such as a downgrade) is pending, it is reverted automatically before the cancellation is requested. > While a distribution is covered by a subscription, CloudFront blocks removing or replacing its web ACL and blocks deleting the distribution — including after cancellation, until the cancellation takes effect at the end of the billing cycle. > Resources must meet the plan family's eligibility requirements or `CreateSubscription` fails with a `ValidationException`. For the `CloudFront` plan family, distributions using legacy cache settings (`forwardedValues`) are rejected as not eligible — use [cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/working-with-policies.html) instead. ## Example Usage ### Basic Usage
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.pricingplanmanager.Subscription;
     import com.pulumi.aws.pricingplanmanager.SubscriptionArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var example = new Subscription("example", SubscriptionArgs.builder()
                 .planFamily("CloudFront")
                 .planTier("PRO")
                 .resourceArns(            
                     exampleAwsCloudfrontDistribution.arn(),
                     exampleAwsWafv2WebAcl.arn())
                 .build());
     
         }
     }
     
     
    ### Manual Approval Paid-tier subscriptions created with `approvalMode = "MANUAL"` (the AWS default for paid tiers when `approvalMode` is not set) remain in `PENDING_APPROVAL` status, and billing does not start, until approved with a separate `ApprovePaidSubscription` API call.
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.pricingplanmanager.Subscription;
     import com.pulumi.aws.pricingplanmanager.SubscriptionArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var example = new Subscription("example", SubscriptionArgs.builder()
                 .approvalMode("MANUAL")
                 .planFamily("CloudFront")
                 .planTier("BUSINESS")
                 .resourceArns(            
                     exampleAwsCloudfrontDistribution.arn(),
                     exampleAwsWafv2WebAcl.arn())
                 .build());
     
         }
     }
     
     
    ## Import ### Identity Schema #### Required * `arn` (String) ARN of the Pricing Plan Manager Subscription. Using `pulumi import`, import Pricing Plan Manager Subscription using the `arn`. For example: ```sh $ pulumi import aws:pricingplanmanager/subscription:Subscription example arn:aws:pricingplanmanager::123456789012:subscription:sub_1a2B3c4D5e6F7g8H9i0JkLmNoPq ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> approvalMode()  
      com.pulumi.core.Output<java.lang.String> arn()  
      com.pulumi.core.Output<java.lang.String> etag()  
      static Subscription get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, SubscriptionState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.lang.String> planFamily()  
      com.pulumi.core.Output<java.lang.String> planTier()  
      com.pulumi.core.Output<java.util.List<java.lang.String>> resourceArns()  
      com.pulumi.core.Output<java.util.List<SubscriptionScheduledChange>> scheduledChanges()  
      com.pulumi.core.Output<java.lang.String> status()  
      com.pulumi.core.Output<java.lang.String> statusReason()  
      com.pulumi.core.Output<java.util.Optional<SubscriptionTimeouts>> timeouts()  
      com.pulumi.core.Output<java.lang.String> usageLevel()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Subscription

        public Subscription​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • Subscription

        public Subscription​(java.lang.String name,
                            SubscriptionArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • Subscription

        public Subscription​(java.lang.String name,
                            SubscriptionArgs args,
                            @Nullable
                            com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • approvalMode

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> approvalMode()
        Returns:
        Whether the subscription requires explicit approval before billing starts. Valid values: `MANUAL`, `IMMEDIATE`. If not set, AWS defaults to `MANUAL` for paid-tier subscriptions and `IMMEDIATE` for `FREE` tier subscriptions. With `MANUAL`, paid-tier subscriptions remain in `PENDING_APPROVAL` (unbilled, and unmodifiable) until approved with a separate `ApprovePaidSubscription` API call. This value is used only at creation time and is not returned by the AWS API. Changing this argument creates a new resource.
      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        ARN of the subscription.
      • etag

        public com.pulumi.core.Output<java.lang.String> etag()
        Returns:
        Entity tag of the subscription, used by AWS for optimistic concurrency control.
      • planFamily

        public com.pulumi.core.Output<java.lang.String> planFamily()
        Returns:
        Pricing plan family to subscribe to, such as `CloudFront`. Changing this argument creates a new resource.
      • planTier

        public com.pulumi.core.Output<java.lang.String> planTier()
        Returns:
        Tier level for the subscription, such as `FREE`, `PRO`, `BUSINESS`, or `PREMIUM`. Upgrades take effect immediately. Downgrades are scheduled by AWS to take effect at the end of the current billing period: until then AWS keeps billing the old tier and this argument reflects the desired (scheduled) tier, with the pending change exposed in `scheduledChange`. Raising the tier again before the downgrade takes effect reverts the pending change.
      • resourceArns

        public com.pulumi.core.Output<java.util.List<java.lang.String>> resourceArns()
        Returns:
        Set of ARNs of the AWS resources to include in the subscription, between 1 and 10 entries. For subscriptions in the `CloudFront` plan family, the resources must include exactly one CloudFront distribution and exactly one WAF web ACL, and can also include other supported resources such as Route 53 hosted zones (any tier) and CloudFront KeyValueStores (paid tiers only). Associated resources are protected by AWS while covered — for example, a hosted zone cannot be deleted until it is disassociated from the plan. The following arguments are optional:
      • scheduledChanges

        public com.pulumi.core.Output<java.util.List<SubscriptionScheduledChange>> scheduledChanges()
        Returns:
        Pending change that takes effect at the end of the current billing period, if any. See `scheduledChange` below.
      • status

        public com.pulumi.core.Output<java.lang.String> status()
        Returns:
        Current status of the subscription. Valid values: `PENDING_APPROVAL`, `ACTIVE`, `SYNC_IN_PROGRESS`, `FAILED`.
      • statusReason

        public com.pulumi.core.Output<java.lang.String> statusReason()
        Returns:
        Human-readable explanation of the current status, when available.
      • usageLevel

        public com.pulumi.core.Output<java.lang.String> usageLevel()
        Returns:
        Usage level within the plan tier. Specify `DEFAULT` for the base configuration, or a higher level if the plan tier supports it. If omitted on an update, the usage level is reset to the plan tier's default.
      • get

        public static Subscription get​(java.lang.String name,
                                       com.pulumi.core.Output<java.lang.String> id,
                                       @Nullable
                                       SubscriptionState state,
                                       @Nullable
                                       com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.