

This is the new *Amazon CloudFormation Template Reference Guide*. Please update your bookmarks and links. For help getting started with CloudFormation, see the [Amazon CloudFormation User Guide](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/Welcome.html).

# AWS::ApiGateway::ApiKey StageKey
<a name="aws-properties-apigateway-apikey-stagekey"></a>

`StageKey` is a property of the [AWS::ApiGateway::ApiKey](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-apikey.html) 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.

## Syntax
<a name="aws-properties-apigateway-apikey-stagekey-syntax"></a>

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

### JSON
<a name="aws-properties-apigateway-apikey-stagekey-syntax.json"></a>

```
{
  "[RestApiId](#cfn-apigateway-apikey-stagekey-restapiid)" : String,
  "[StageName](#cfn-apigateway-apikey-stagekey-stagename)" : String
}
```

### YAML
<a name="aws-properties-apigateway-apikey-stagekey-syntax.yaml"></a>

```
  [RestApiId](#cfn-apigateway-apikey-stagekey-restapiid): String
  [StageName](#cfn-apigateway-apikey-stagekey-stagename): String
```

## Properties
<a name="aws-properties-apigateway-apikey-stagekey-properties"></a>

`RestApiId`  <a name="cfn-apigateway-apikey-stagekey-restapiid"></a>
The string identifier of the associated RestApi.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`StageName`  <a name="cfn-apigateway-apikey-stagekey-stagename"></a>
The stage name associated with the stage key.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## See also
<a name="aws-properties-apigateway-apikey-stagekey--seealso"></a>
+ [stageKeys](https://docs.amazonaws.cn/apigateway/latest/api/API_CreateApiKey.html#stageKeys) in the *Amazon API Gateway REST API Reference*

