FEATURES OPEN SOURCE ABOUT DOCS LOGIN REGISTER

aws_api_gateway_api_key

Provides an API Gateway API Key.

Example Usage

resource "aws_api_gateway_rest_api" "MyDemoAPI" {
  name = "MyDemoAPI"
}

resource "aws_api_gateway_api_key" "MyDemoApiKey" {
  name = "demo"

  stage_key {
    rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}"
    stage_name = "${aws_api_gateway_deployment.MyDemoDeployment.stage_name}"
  }
}

resource "aws_api_gateway_deployment" "MyDemoDeployment" {
  rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}"
  stage_name = "test"
}

Argument Reference

The following arguments are supported:

stage_key block supports the following:

Attribute Reference

The following attributes are exported:

Import

API Gateway Keys can be imported using the id, e.g.

$ terraform import aws_api_gateway_api_key.my_demo_key 8bklk8bl1k3sB38D9B3l0enyWT8c09B30lkq0blk

See the source of this document at Terraform.io