CfnUsagePlanPropsMixin

class aws_cdk.mixins_preview.aws_apigateway.mixins.CfnUsagePlanPropsMixin(props, *, strategy=None)

Bases: Mixin

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html

CloudformationResource:

AWS::ApiGateway::UsagePlan

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview import mixins
from aws_cdk.mixins_preview.aws_apigateway import mixins as apigateway_mixins

cfn_usage_plan_props_mixin = apigateway_mixins.CfnUsagePlanPropsMixin(apigateway_mixins.CfnUsagePlanMixinProps(
    api_stages=[apigateway_mixins.CfnUsagePlanPropsMixin.ApiStageProperty(
        api_id="apiId",
        stage="stage",
        throttle={
            "throttle_key": apigateway_mixins.CfnUsagePlanPropsMixin.ThrottleSettingsProperty(
                burst_limit=123,
                rate_limit=123
            )
        }
    )],
    description="description",
    quota=apigateway_mixins.CfnUsagePlanPropsMixin.QuotaSettingsProperty(
        limit=123,
        offset=123,
        period="period"
    ),
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    throttle=apigateway_mixins.CfnUsagePlanPropsMixin.ThrottleSettingsProperty(
        burst_limit=123,
        rate_limit=123
    ),
    usage_plan_name="usagePlanName"
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::ApiGateway::UsagePlan.

Parameters:
  • props (Union[CfnUsagePlanMixinProps, Dict[str, Any]]) – L1 properties to apply.

  • strategy (Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['apiStages', 'description', 'quota', 'tags', 'throttle', 'usagePlanName']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

ApiStageProperty

class CfnUsagePlanPropsMixin.ApiStageProperty(*, api_id=None, stage=None, throttle=None)

Bases: object

API stage name of the associated API stage in a usage plan.

Parameters:
  • api_id (Optional[str]) – API Id of the associated API stage in a usage plan.

  • stage (Optional[str]) – API stage name of the associated API stage in a usage plan.

  • throttle (Union[IResolvable, Mapping[str, Union[IResolvable, ThrottleSettingsProperty, Dict[str, Any]]], None]) – Map containing method level throttling information for API stage in a usage plan.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-usageplan-apistage.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_apigateway import mixins as apigateway_mixins

api_stage_property = apigateway_mixins.CfnUsagePlanPropsMixin.ApiStageProperty(
    api_id="apiId",
    stage="stage",
    throttle={
        "throttle_key": apigateway_mixins.CfnUsagePlanPropsMixin.ThrottleSettingsProperty(
            burst_limit=123,
            rate_limit=123
        )
    }
)

Attributes

api_id

API Id of the associated API stage in a usage plan.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-usageplan-apistage.html#cfn-apigateway-usageplan-apistage-apiid

stage

API stage name of the associated API stage in a usage plan.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-usageplan-apistage.html#cfn-apigateway-usageplan-apistage-stage

throttle

Map containing method level throttling information for API stage in a usage plan.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-usageplan-apistage.html#cfn-apigateway-usageplan-apistage-throttle

QuotaSettingsProperty

class CfnUsagePlanPropsMixin.QuotaSettingsProperty(*, limit=None, offset=None, period=None)

Bases: object

QuotaSettings is 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.

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.

Parameters:
  • limit (Union[int, float, None]) – The target maximum number of requests that can be made in a given time period.

  • offset (Union[int, float, None]) – The number of requests subtracted from the given limit in the initial time period.

  • period (Optional[str]) – The time period in which the limit applies. Valid values are “DAY”, “WEEK” or “MONTH”.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-usageplan-quotasettings.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_apigateway import mixins as apigateway_mixins

quota_settings_property = apigateway_mixins.CfnUsagePlanPropsMixin.QuotaSettingsProperty(
    limit=123,
    offset=123,
    period="period"
)

Attributes

limit

The target maximum number of requests that can be made in a given time period.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-usageplan-quotasettings.html#cfn-apigateway-usageplan-quotasettings-limit

offset

The number of requests subtracted from the given limit in the initial time period.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-usageplan-quotasettings.html#cfn-apigateway-usageplan-quotasettings-offset

period

The time period in which the limit applies.

Valid values are “DAY”, “WEEK” or “MONTH”.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-usageplan-quotasettings.html#cfn-apigateway-usageplan-quotasettings-period

ThrottleSettingsProperty

class CfnUsagePlanPropsMixin.ThrottleSettingsProperty(*, burst_limit=None, rate_limit=None)

Bases: object

ThrottleSettings is 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.

Parameters:
  • burst_limit (Union[int, float, None]) – The API target request burst rate limit. This allows more requests through for a period of time than the target rate limit.

  • rate_limit (Union[int, float, None]) – The API target request rate limit.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-usageplan-throttlesettings.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_apigateway import mixins as apigateway_mixins

throttle_settings_property = apigateway_mixins.CfnUsagePlanPropsMixin.ThrottleSettingsProperty(
    burst_limit=123,
    rate_limit=123
)

Attributes

burst_limit

The API target request burst rate limit.

This allows more requests through for a period of time than the target rate limit.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-usageplan-throttlesettings.html#cfn-apigateway-usageplan-throttlesettings-burstlimit

rate_limit

The API target request rate limit.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-usageplan-throttlesettings.html#cfn-apigateway-usageplan-throttlesettings-ratelimit