aws_api_gateway_documentation_parts Resource
Use the aws_api_gateway_documentation_parts
InSpec audit resource to test properties of multiple documentation parts for an AWS API Gateway.
The AWS::ApiGateway::DocumentationParts
resource creates a documentation part for an API.
For additional information, including details on parameters and properties, see the AWS ApiGateway Documentation Part documentation.
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 documentation part exists.
describe aws_api_gateway_documentation_parts(rest_api_id: 'REST_API_ID') do
it { should exist }
end
Parameters
rest_api_id
(required)-
The string identifier of the associated REST API.
Properties
ids
- The identifier for the documentation part resource.
types
- The type of API entity to which the documentation content applies.
paths
- The URL path of the target.
methods
- The HTTP verb of a method.
status_codes
- The HTTP status code of a response.
names
- The name of the targeted API entity.
properties
- A content map of API-specific key-value pairs describing the targeted API entity.
Examples
Ensure that the documentation part ID exists.
describe aws_api_gateway_documentation_parts(rest_api_id: 'REST_API_ID') do
its('ids') { should include 'DOCUMENTATION_PART_ID' }
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_api_gateway_documentation_parts(rest_api_id: 'REST_API_ID') do
it { should exist }
end
Use should_not
to test the entity does not exist.
describe aws_api_gateway_documentation_parts(rest_api_id: 'REST_API_ID') do
it { should_not exist }
end
be_available
Use should
to check if the documentation part is available.
describe aws_api_gateway_documentation_parts(rest_api_id: 'REST_API_ID') do
it { should be_available }
end
AWS Permissions
Your Principal will need the APIGateway:Client::DocumentationParts
action with Effect
set to Allow
.
Was this page helpful?