github.com/andresvia/terraform@v0.6.15-0.20160412045437-d51c75946785/website/source/docs/providers/aws/r/api_gateway_api_key.html.markdown (about)

     1  ---
     2  layout: "aws"
     3  page_title: "AWS: aws_api_gateway_api_key"
     4  sidebar_current: "docs-aws-resource-api-gateway-api-key"
     5  description: |-
     6    Provides an API Gateway API Key.
     7  ---
     8  
     9  # aws\_api\_gateway\_api\_key
    10  
    11  Provides an API Gateway API Key.
    12  
    13  ## Example Usage
    14  
    15  ```
    16  resource "aws_api_gateway_rest_api" "MyDemoAPI" {
    17    name = "MyDemoAPI"
    18    description = "This is my API for demonstration purposes"
    19  }
    20  
    21  resource "aws_api_gateway_api_key" "MyDemoApiKey" {
    22    name = "demo"
    23  
    24    stage_key {
    25      rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}"
    26      stage_name = "${aws_api_gateway_deployment.MyDemoDeployment.stage_name}"
    27    }
    28  }
    29  
    30  resource "aws_api_gateway_deployment" "MyDemoDeployment" {
    31    rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}"
    32    stage_name = "test"
    33  }
    34  ```
    35  
    36  ## Argument Reference
    37  
    38  The following arguments are supported:
    39  
    40  * `name` - (Required) The name of the API key
    41  * `description` - (Required) The API key description
    42  * `enabled` - (Optional) Specifies whether the API key can be used by callers. Defaults to `true`.
    43  * `stage_key` - (Optional) A list of stage keys associated with the API key - see below
    44  
    45  `stage_key` block supports the following:
    46  
    47  * `rest_api_id` - (Required) The ID of the associated REST API.
    48  * `stage_name` - (Required) The name of the API Gateway stage.
    49  
    50  ## Attribute Reference
    51  
    52  The following attributes are exported:
    53  
    54  * `id` - The ID of the API key