Menu
AWS CloudFormation
User Guide (API Version 2010-05-15)

AWS::ApiGateway::UsagePlanKey

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

Syntax

JSON

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

YAML

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

Properties

KeyId

The ID of the usage plan key.

Required: Yes

Type: String

Update requires: Replacement

KeyType

The type of usage plan key. Currently, the valid key type is API_KEY.

Required: Yes

Type: String

Update requires: Replacement

UsagePlanId

The value of the usage plan key.

Required: Yes

Type: String

Update requires: Replacement

Return Value

Ref

When the logical ID of this resource is provided to the Ref intrinsic function, Ref returns the resource name. For example:

Copy
{ "Ref": "MyProfile" }

For the IAM::InstanceProfile with the logical ID MyProfile, Ref returns the resource name.

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

Example

JSON

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

YAML

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