@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:47.587Z") public class CfnUsagePlan extends CfnResource implements IInspectable
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();
Modifier and Type | Class and Description |
---|---|
static interface |
CfnUsagePlan.ApiStageProperty
API stage name of the associated API stage in a usage plan.
|
static class |
CfnUsagePlan.Builder
A fluent builder for
CfnUsagePlan . |
static interface |
CfnUsagePlan.QuotaSettingsProperty
`QuotaSettings` is a property of the [AWS::ApiGateway::UsagePlan](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html) resource that specifies a target for the maximum number of requests users can make to your REST APIs.
|
static interface |
CfnUsagePlan.ThrottleSettingsProperty
`ThrottleSettings` is a property of the [AWS::ApiGateway::UsagePlan](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html) resource that specifies the overall request rate (average requests per second) and burst capacity when users call your REST APIs.
|
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnUsagePlan(Construct scope,
java.lang.String id)
Create a new `AWS::ApiGateway::UsagePlan`.
|
|
CfnUsagePlan(Construct scope,
java.lang.String id,
CfnUsagePlanProps props)
Create a new `AWS::ApiGateway::UsagePlan`.
|
protected |
CfnUsagePlan(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnUsagePlan(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getApiStages()
The associated API stages of a usage plan.
|
java.lang.String |
getAttrId()
The ID for the usage plan.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.String |
getDescription()
The description of a usage plan.
|
java.lang.Object |
getQuota()
The target maximum number of permitted requests per a given unit time interval.
|
TagManager |
getTags()
The collection of tags.
|
java.lang.Object |
getThrottle()
A map containing method level throttling information for API stage in a usage plan.
|
java.lang.String |
getUsagePlanName()
The name of a usage plan.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setApiStages(IResolvable value)
The associated API stages of a usage plan.
|
void |
setApiStages(java.util.List<java.lang.Object> value)
The associated API stages of a usage plan.
|
void |
setDescription(java.lang.String value)
The description of a usage plan.
|
void |
setQuota(CfnUsagePlan.QuotaSettingsProperty value)
The target maximum number of permitted requests per a given unit time interval.
|
void |
setQuota(IResolvable value)
The target maximum number of permitted requests per a given unit time interval.
|
void |
setThrottle(CfnUsagePlan.ThrottleSettingsProperty value)
A map containing method level throttling information for API stage in a usage plan.
|
void |
setThrottle(IResolvable value)
A map containing method level throttling information for API stage in a usage plan.
|
void |
setUsagePlanName(java.lang.String value)
The name of a usage plan.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnUsagePlan(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnUsagePlan(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnUsagePlan(Construct scope, java.lang.String id, CfnUsagePlanProps props)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.props
- - resource properties.public CfnUsagePlan(Construct scope, java.lang.String id)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.public java.lang.String getAttrId()
For example: abc123
.
protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public TagManager getTags()
Each tag element is associated with a given resource.
public java.lang.Object getApiStages()
public void setApiStages(IResolvable value)
public void setApiStages(java.util.List<java.lang.Object> value)
public java.lang.String getDescription()
public void setDescription(java.lang.String value)
public java.lang.Object getQuota()
public void setQuota(IResolvable value)
public void setQuota(CfnUsagePlan.QuotaSettingsProperty value)
public java.lang.Object getThrottle()
public void setThrottle(IResolvable value)
public void setThrottle(CfnUsagePlan.ThrottleSettingsProperty value)
public java.lang.String getUsagePlanName()
public void setUsagePlanName(java.lang.String value)