Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

AWS::ApiGateway::UsagePlanKey

Focus mode
AWS::ApiGateway::UsagePlanKey - AWS CloudFormation
Filter View

The AWS::ApiGateway::UsagePlanKey resource associates an API key with a usage plan. This association determines which users the usage plan is applied to.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::ApiGateway::UsagePlanKey", "Properties" : { "KeyId" : String, "KeyType" : String, "UsagePlanId" : String } }

YAML

Type: AWS::ApiGateway::UsagePlanKey Properties: KeyId: String KeyType: String UsagePlanId: String

Properties

KeyId

The Id of the UsagePlanKey resource.

Required: Yes

Type: String

Update requires: Replacement

KeyType

The type of a UsagePlanKey resource for a plan customer.

Required: Yes

Type: String

Allowed values: API_KEY

Update requires: Replacement

UsagePlanId

The Id of the UsagePlan resource representing the usage plan containing the UsagePlanKey resource representing a plan customer.

Required: Yes

Type: String

Update requires: Replacement

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the ID of the key and ID of the usage plan combined with a ":", such as 123abcdef:abc123.

For more information about using the Ref function, see Ref.

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

Id

The ID for the usage plan key. For example: abc123.

Examples

Create usage plan key

JSON

{ "usagePlanKey": { "Type": "AWS::ApiGateway::UsagePlanKey", "Properties": { "KeyId": { "Ref": "myApiKey" }, "KeyType": "API_KEY", "UsagePlanId": { "Ref": "myUsagePlan" } } } }

YAML

usagePlanKey: Type: 'AWS::ApiGateway::UsagePlanKey' Properties: KeyId: !Ref myApiKey KeyType: API_KEY UsagePlanId: !Ref myUsagePlan

See also

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.