@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:36.139Z") @Stability(value=Stable) 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
`ApiStage` is a property of the [AWS::ApiGateway::UsagePlan](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html) resource that specifies which stages and APIs to associate with 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.
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnUsagePlan(software.constructs.Construct scope,
String id)
Create a new `AWS::ApiGateway::UsagePlan`.
|
|
CfnUsagePlan(software.constructs.Construct scope,
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 |
|---|---|
Object |
getApiStages()
The API stages to associate with this usage plan.
|
String |
getAttrId()
The ID for the usage plan.
|
protected Map<String,Object> |
getCfnProperties() |
String |
getDescription()
A description of the usage plan.
|
Object |
getQuota()
Configures the number of requests that users can make within a given interval.
|
TagManager |
getTags()
An array of arbitrary tags (key-value pairs) to associate with the usage plan.
|
Object |
getThrottle()
Configures the overall request rate (average requests per second) and burst capacity.
|
String |
getUsagePlanName()
A name for the usage plan.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setApiStages(IResolvable value)
The API stages to associate with this usage plan.
|
void |
setApiStages(List<Object> value)
The API stages to associate with this usage plan.
|
void |
setDescription(String value)
A description of the usage plan.
|
void |
setQuota(CfnUsagePlan.QuotaSettingsProperty value)
Configures the number of requests that users can make within a given interval.
|
void |
setQuota(IResolvable value)
Configures the number of requests that users can make within a given interval.
|
void |
setThrottle(CfnUsagePlan.ThrottleSettingsProperty value)
Configures the overall request rate (average requests per second) and burst capacity.
|
void |
setThrottle(IResolvable value)
Configures the overall request rate (average requests per second) and burst capacity.
|
void |
setUsagePlanName(String value)
A name for the usage plan.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnUsagePlan(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnUsagePlan(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnUsagePlan(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@Nullable
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.@Stability(value=Stable)
public CfnUsagePlan(@NotNull
software.constructs.Construct scope,
@NotNull
String id)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrId()
For example: abc123 .
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public TagManager getTags()
@Stability(value=Stable) @Nullable public Object getApiStages()
@Stability(value=Stable)
public void setApiStages(@Nullable
IResolvable value)
@Stability(value=Stable)
public void setApiStages(@Nullable
List<Object> value)
@Stability(value=Stable) @Nullable public String getDescription()
@Stability(value=Stable)
public void setDescription(@Nullable
String value)
@Stability(value=Stable) @Nullable public Object getQuota()
@Stability(value=Stable)
public void setQuota(@Nullable
CfnUsagePlan.QuotaSettingsProperty value)
@Stability(value=Stable)
public void setQuota(@Nullable
IResolvable value)
@Stability(value=Stable) @Nullable public Object getThrottle()
@Stability(value=Stable)
public void setThrottle(@Nullable
CfnUsagePlan.ThrottleSettingsProperty value)
@Stability(value=Stable)
public void setThrottle(@Nullable
IResolvable value)
@Stability(value=Stable) @Nullable public String getUsagePlanName()
@Stability(value=Stable)
public void setUsagePlanName(@Nullable
String value)
Copyright © 2022. All rights reserved.