CfnApiKeyPropsMixin

class aws_cdk.cfn_property_mixins.aws_apigateway.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.cfn_property_mixins import aws_apigateway as apigateway
import aws_cdk as cdk

# merge_strategy: cdk.IMergeStrategy

cfn_api_key_props_mixin = apigateway.CfnApiKeyPropsMixin(apigateway.CfnApiKeyMixinProps(
    customer_id="customerId",
    description="description",
    enabled=False,
    generate_distinct_id=False,
    name="name",
    stage_keys=[apigateway.CfnApiKeyPropsMixin.StageKeyProperty(
        rest_api_id="restApiId",
        stage_name="stageName"
    )],
    tags=[cdk.CfnTag(
        key="key",
        value="value"
    )],
    value="value"
),
    strategy=merge_strategy
)

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

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

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

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

None

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)

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.

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 (Union[str, IRestApiRef, None]) – The string identifier of the associated RestApi.

  • stage_name (Union[str, IStageRef, None]) – 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.cfn_property_mixins import aws_apigateway as apigateway

stage_key_property = apigateway.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