Class CfnUsagePlan

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-18T17:54:11.834Z") @Stability(Stable) public class CfnUsagePlan extends CfnResource implements IInspectable, ITaggable
The AWS::ApiGateway::UsagePlan resource creates a usage plan for deployed APIs.

A usage plan sets a target for the throttling and quota limits on individual client API keys. For more information, see Creating and Using API Usage Plans in Amazon API Gateway in the API Gateway Developer Guide .

In some cases clients can exceed the targets that you set. Don’t rely on usage plans to control costs. Consider using AWS Budgets to monitor costs and AWS WAF to manage API requests.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.apigateway.*;
 CfnUsagePlan cfnUsagePlan = CfnUsagePlan.Builder.create(this, "MyCfnUsagePlan")
         .apiStages(List.of(ApiStageProperty.builder()
                 .apiId("apiId")
                 .stage("stage")
                 .throttle(Map.of(
                         "throttleKey", ThrottleSettingsProperty.builder()
                                 .burstLimit(123)
                                 .rateLimit(123)
                                 .build()))
                 .build()))
         .description("description")
         .quota(QuotaSettingsProperty.builder()
                 .limit(123)
                 .offset(123)
                 .period("period")
                 .build())
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .throttle(ThrottleSettingsProperty.builder()
                 .burstLimit(123)
                 .rateLimit(123)
                 .build())
         .usagePlanName("usagePlanName")
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnUsagePlan

      protected CfnUsagePlan(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnUsagePlan

      protected CfnUsagePlan(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnUsagePlan

      @Stability(Stable) public CfnUsagePlan(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable CfnUsagePlanProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties.
    • CfnUsagePlan

      @Stability(Stable) public CfnUsagePlan(@NotNull software.constructs.Construct scope, @NotNull String id)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrId

      @Stability(Stable) @NotNull public String getAttrId()
      The ID for the usage plan.

      For example: abc123 .

    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getApiStages

      @Stability(Stable) @Nullable public Object getApiStages()
      The associated API stages of a usage plan.
    • setApiStages

      @Stability(Stable) public void setApiStages(@Nullable IResolvable value)
      The associated API stages of a usage plan.
    • setApiStages

      @Stability(Stable) public void setApiStages(@Nullable List<Object> value)
      The associated API stages of a usage plan.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      The description of a usage plan.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      The description of a usage plan.
    • getQuota

      @Stability(Stable) @Nullable public Object getQuota()
      The target maximum number of permitted requests per a given unit time interval.
    • setQuota

      @Stability(Stable) public void setQuota(@Nullable IResolvable value)
      The target maximum number of permitted requests per a given unit time interval.
    • setQuota

      @Stability(Stable) public void setQuota(@Nullable CfnUsagePlan.QuotaSettingsProperty value)
      The target maximum number of permitted requests per a given unit time interval.
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
      The collection of tags.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable List<CfnTag> value)
      The collection of tags.
    • getThrottle

      @Stability(Stable) @Nullable public Object getThrottle()
      A map containing method level throttling information for API stage in a usage plan.
    • setThrottle

      @Stability(Stable) public void setThrottle(@Nullable IResolvable value)
      A map containing method level throttling information for API stage in a usage plan.
    • setThrottle

      @Stability(Stable) public void setThrottle(@Nullable CfnUsagePlan.ThrottleSettingsProperty value)
      A map containing method level throttling information for API stage in a usage plan.
    • getUsagePlanName

      @Stability(Stable) @Nullable public String getUsagePlanName()
      The name of a usage plan.
    • setUsagePlanName

      @Stability(Stable) public void setUsagePlanName(@Nullable String value)
      The name of a usage plan.