Provides an API Gateway API Key.
resource "aws_api_gateway_api_key" "example" {
name = "example"
}
This resource supports the following arguments:
name
- (Required) Name of the API key.customer_id
- (Required) An Amazon Web Services Marketplace customer identifier, when integrating with the Amazon Web Services SaaS Marketplace.description
- (Optional) API key description. Defaults to "Managed by Terraform".enabled
- (Optional) Whether the API key can be used by callers. Defaults to true
.value
- (Optional) Value of the API key. If specified, the value must be an alphanumeric string between 20 and 128 characters. If not specified, it will be automatically generated by AWS on creation.tags
- (Optional) Key-value map of resource tags. If configured with a provider default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.This resource exports the following attributes in addition to the arguments above:
id
- ID of the API keycreated_date
- Creation date of the API keylast_updated_date
- Last update date of the API keyarn
- ARNtags_all
- Map of tags assigned to the resource, including those inherited from the provider default_tags
configuration block.In Terraform v1.5.0 and later, use an import
block to import API Gateway Keys using the id
. For example:
import {
to = aws_api_gateway_api_key.example
id = "8bklk8bl1k3sB38D9B3l0enyWT8c09B30lkq0blk"
}
Using terraform import
, import API Gateway Keys using the id
. For example:
% terraform import aws_api_gateway_api_key.example 8bklk8bl1k3sB38D9B3l0enyWT8c09B30lkq0blk