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..
Installation
This resource is available in the Chef InSpec AWS resource pack.
See the Chef InSpec documentation on cloud platforms for information on configuring your AWS environment for InSpec and creating an InSpec profile that uses the InSpec AWS resource pack.
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:
id
values
- The value of the API Key.
-
Field:
value
names
- The name of the API Key.
-
Field:
name
customer_ids
- An AWS Marketplace customer identifier , when integrating with the AWS SaaS Marketplace.
-
Field:
customer_id
descriptions
- The description of the API Key.
-
Field:
description
enabled
- Specifies whether the API Key can be used by callers.
-
Field:
enabled
created_dates
- The timestamp when the API Key was created.
-
Field:
created_date
last_updated_dates
- The timestamp when the API Key was last updated.
-
Field:
last_updated_date
stage_keys
- A list of Stage resources that are associated with the ApiKey resource.
-
Field:
stage_keys
tags
- 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
This InSpec audit resource has the following special matchers. For a full list of available matchers, please visit our Universal Matchers page.
The controls will pass if the get
method returns at least one result.
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 Principal will need the APIGateway:Client:ApiKeys
action with Effect
set to Allow
.
Was this page helpful?