AWS Fundamentals Logo
AWS Fundamentals
AWS::ApiGateway::ApiKey

ApiGateway ApiKey

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.

Properties

8 configurable properties. Click a row to see details.

Filter:
PropertyTypeFlags
CustomerId
string
Description
string
Enabled
boolean
GenerateDistinctId
boolean
Create-onlyWrite-only
Name
string
Create-only
StageKeys
Array<StageKey>
Tags
Array<Tag>
Value
string
Create-only

Return Values

Values returned after the resource is created. Access these with Fn::GetAtt.

AttributeTypeDescription
APIKeyIdstring-

Sample CloudFormation Template

A minimal template with required properties and common optional ones.

template.yaml
AWSTemplateFormatVersion: "2010-09-09"
Description: Sample template for AWS::ApiGateway::ApiKey

Resources:
  MyResource:
    Type: AWS::ApiGateway::ApiKey
    Properties:
      Tags:
        - Key: Environment
          Value: Production
      Description: !Ref "AWS::StackName"
      Name: !Ref "AWS::StackName"

Required IAM Permissions

Permissions CloudFormation needs in your IAM role to manage this resource.

create

apigateway:POSTapigateway:GETapigateway:PUT

read

apigateway:GET

update

apigateway:GETapigateway:PATCHapigateway:PUTapigateway:DELETE

delete

apigateway:DELETEapigateway:GET

list

apigateway:GET

Get the ApiGateway Cheat Sheet

Everything you need to know about ApiGateway on one page. HD quality, print-friendly.

Download Free Infographic

Quick Facts

ServiceApiGateway
Properties9
Required0
TaggingSupported
Primary IDAPIKeyId

Supported Operations

CreateReadUpdateDeleteList

Immutable After Creation

These properties cannot be changed after the resource is created. Updating them triggers a replacement.

GenerateDistinctIdNameValue

External Links