Class CfnUsagePlan
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.apigateway.CfnUsagePlan
- All Implemented Interfaces:
IInspectable,IUsagePlanRef,IEnvironmentAware,ITaggable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-13T16:09:57.802Z")
@Stability(Stable)
public class CfnUsagePlan
extends CfnResource
implements IInspectable, IUsagePlanRef, 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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAPI stage name of the associated API stage in a usage plan.static final classA fluent builder forCfnUsagePlan.static interfaceQuotaSettingsis a property of the AWS::ApiGateway::UsagePlan resource that specifies a target for the maximum number of requests users can make to your REST APIs.static interfaceThrottleSettingsis a property of the AWS::ApiGateway::UsagePlan resource that specifies the overall request rate (average requests per second) and burst capacity when users call your REST APIs.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.apigateway.IUsagePlanRef
IUsagePlanRef.Jsii$Default, IUsagePlanRef.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnUsagePlan(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnUsagePlan(software.amazon.jsii.JsiiObjectRef objRef) CfnUsagePlan(software.constructs.Construct scope, String id) Create a newAWS::ApiGateway::UsagePlan.CfnUsagePlan(software.constructs.Construct scope, String id, CfnUsagePlanProps props) Create a newAWS::ApiGateway::UsagePlan. -
Method Summary
Modifier and TypeMethodDescriptionstatic IUsagePlanReffromUsagePlanId(software.constructs.Construct scope, String id, String usagePlanId) Creates a new IUsagePlanRef from a usagePlanId.The associated API stages of a usage plan.The ID for the usage plan.The description of a usage plan.getQuota()The target maximum number of permitted requests per a given unit time interval.getTags()Tag Manager which manages the tags for this resource.The collection of tags.A map containing method level throttling information for API stage in a usage plan.The name of a usage plan.A reference to a UsagePlan resource.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetApiStages(List<Object> value) The associated API stages of a usage plan.voidsetApiStages(IResolvable value) The associated API stages of a usage plan.voidsetDescription(String value) The description of a usage plan.voidsetQuota(IResolvable value) The target maximum number of permitted requests per a given unit time interval.voidThe target maximum number of permitted requests per a given unit time interval.voidsetTagsRaw(List<CfnTag> value) The collection of tags.voidsetThrottle(IResolvable value) A map containing method level throttling information for API stage in a usage plan.voidA map containing method level throttling information for API stage in a usage plan.voidsetUsagePlanName(String value) The name of a usage plan.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
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) Create a newAWS::ApiGateway::UsagePlan.- 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) Create a newAWS::ApiGateway::UsagePlan.- 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
-
fromUsagePlanId
@Stability(Stable) @NotNull public static IUsagePlanRef fromUsagePlanId(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String usagePlanId) Creates a new IUsagePlanRef from a usagePlanId.- Parameters:
scope- This parameter is required.id- This parameter is required.usagePlanId- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- 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:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrId
The ID for the usage plan.For example:
abc123. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getTags
Tag Manager which manages the tags for this resource. -
getUsagePlanRef
A reference to a UsagePlan resource.- Specified by:
getUsagePlanRefin interfaceIUsagePlanRef
-
getApiStages
The associated API stages of a usage plan.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnUsagePlan.ApiStageProperty> -
setApiStages
The associated API stages of a usage plan. -
setApiStages
The associated API stages of a usage plan. -
getDescription
The description of a usage plan. -
setDescription
The description of a usage plan. -
getQuota
The target maximum number of permitted requests per a given unit time interval.Returns union: either
IResolvableorCfnUsagePlan.QuotaSettingsProperty -
setQuota
The target maximum number of permitted requests per a given unit time interval. -
setQuota
The target maximum number of permitted requests per a given unit time interval. -
getTagsRaw
The collection of tags. -
setTagsRaw
The collection of tags. -
getThrottle
A map containing method level throttling information for API stage in a usage plan.Returns union: either
IResolvableorCfnUsagePlan.ThrottleSettingsProperty -
setThrottle
A map containing method level throttling information for API stage in a usage plan. -
setThrottle
A map containing method level throttling information for API stage in a usage plan. -
getUsagePlanName
The name of a usage plan. -
setUsagePlanName
The name of a usage plan.
-