AWS::ApiGateway::ApiKey

The AWS::ApiGateway::ApiKey resource creates a unique key that you can
distribute to clients who are executing Amazon API Gateway (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.

A name for the API key. If you don't specify a name, AWS CloudFormation generates
a unique physical ID and uses that ID for the API key name. For more information,
see Name Type.

Important

If you specify a name, you cannot perform updates that require replacement of this
resource.
You can perform updates that require no or some interruption. If you must replace
the resource, specify a new name.

Return Value

Ref

Examples

The following example creates an API key and associates it with the Test
stage of the TestAPIDeployment deployment. To ensure that AWS CloudFormation creates the
stage and deployment (which are declared elsewhere in the same template) before the
API key,
the example adds an explicit dependency on the deployment and stage. Without this
dependency, AWS CloudFormation might create the API key first, which would cause the
association to fail
because the deployment and stage wouldn't exist.