CfnApiKeyPropsMixin

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

Bases: Mixin

The AWS::ApiGateway::ApiKey resource creates a unique key that you can distribute to clients who are executing API Gateway Method resources that require an API key.

To specify which API key clients must use, map the API key with the RestApi and Stage resources that include the methods that require a key.

See:

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

CloudformationResource:

AWS::ApiGateway::ApiKey

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_api_key_props_mixin = apigateway_mixins.CfnApiKeyPropsMixin(apigateway_mixins.CfnApiKeyMixinProps(
    customer_id="customerId",
    description="description",
    enabled=False,
    generate_distinct_id=False,
    name="name",
    stage_keys=[apigateway_mixins.CfnApiKeyPropsMixin.StageKeyProperty(
        rest_api_id="restApiId",
        stage_name="stageName"
    )],
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    value="value"
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

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

Parameters:
  • props (Union[CfnApiKeyMixinProps, 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 = ['customerId', 'description', 'enabled', 'generateDistinctId', 'name', 'stageKeys', 'tags', 'value']

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

StageKeyProperty

class CfnApiKeyPropsMixin.StageKeyProperty(*, rest_api_id=None, stage_name=None)

Bases: object

StageKey is a property of the AWS::ApiGateway::ApiKey resource that specifies the stage to associate with the API key. This association allows only clients with the key to make requests to methods in that stage.

Parameters:
  • rest_api_id (Optional[str]) – The string identifier of the associated RestApi.

  • stage_name (Optional[str]) – The stage name associated with the stage key.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-apikey-stagekey.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

stage_key_property = apigateway_mixins.CfnApiKeyPropsMixin.StageKeyProperty(
    rest_api_id="restApiId",
    stage_name="stageName"
)

Attributes

rest_api_id

The string identifier of the associated RestApi.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-apikey-stagekey.html#cfn-apigateway-apikey-stagekey-restapiid

stage_name

The stage name associated with the stage key.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-apikey-stagekey.html#cfn-apigateway-apikey-stagekey-stagename