aws_apigateway_api_keys resource
Use the aws_apigateway_api_keys InSpec audit resource to test properties of multiple AWS API Gateway API keys.
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.
For additional information, including details on parameters and properties, see the AWS documentation on AWS API Gateway API Key..
Syntax
Ensure that the API key exists.
describe aws_apigateway_api_keys do
it { should exist }
end
Parameters
This resource does not require any parameters.
Properties
ids- The identifier of the API Key.
Field:
idvalues- The value of the API Key.
Field:
valuenames- The name of the API Key.
Field:
namecustomer_ids- An AWS Marketplace customer identifier , when integrating with the AWS SaaS Marketplace.
Field:
customer_iddescriptions- The description of the API Key.
Field:
descriptionenabled- Specifies whether the API Key can be used by callers.
Field:
enabledcreated_dates- The timestamp when the API Key was created.
Field:
created_datelast_updated_dates- The timestamp when the API Key was last updated.
Field:
last_updated_datestage_keys- A list of Stage resources that are associated with the ApiKey resource.
Field:
stage_keys- The collection of tags.
Field:
tags
Examples
Ensure a ID is available:
describe aws_apigateway_api_keys do
its('ids') { should include 'API_ID' }
end
Ensure that the name is available:
describe aws_apigateway_api_keys do
its('names') { should include 'API_NAME' }
end
Matchers
For a full list of available matchers, see our Universal Matchers page.This resource has the following special matchers.
exist
Use should to test that the entity exists.
describe aws_apigateway_api_keys do
it { should exist }
end
Use should_not to test the entity does not exist.
describe aws_apigateway_api_keys do
it { should_not exist }
end
AWS Permissions
Your AWS principal will need the APIGateway:Client:ApiKeys action with Effect set to Allow.