Skip to main content

aws_api_gateway_documentation_version Resource

Use the aws_api_gateway_documentation_version InSpec audit resource to test properties of a single AWS API Gateway documentation version.

The AWS::ApiGateway::DocumentationVersion resource creates a documentation version for an API.

For additional information, including details on parameters and properties, see the AWS ApiGateway documentation version 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 version exists.

describe aws_api_gateway_documentation_version(rest_api_id: 'REST_API_ID', documentation_version: 'DOCUMENTATION_VERSION') do
  it { should exist }
end

Parameters

rest_api_id (required)

The string identifier of the associated RestApi.

documentation_version (required)

The identifier of the documentation version resource to get information about.

Properties

created_date
The date when the API documentation snapshot is created.
version
The version identifier of the API documentation snapshot.
description
The description of the API documentation snapshot.

Examples

Ensure that the documentation version ID exists.

describe aws_api_gateway_documentation_version(rest_api_id: 'REST_API_ID', documentation_version: 'DOCUMENTATION_VERSION') do
  its('version') { should eq 'VERSION' }
end

Check whether the API path exist for a documentation version.

describe aws_api_gateway_documentation_version(rest_api_id: 'REST_API_ID', documentation_version: 'DOCUMENTATION_VERSION') do
    its('description') { should eq 'DESCRIPTION' }
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_version(rest_api_id: 'REST_API_ID', documentation_version: 'DOCUMENTATION_VERSION') do
  it { should exist }
end

Use should_not to test the entity does not exist.

describe aws_api_gateway_documentation_version(rest_api_id: 'REST_API_ID', documentation_version: 'DOCUMENTATION_VERSION') do
  it { should_not exist }
end

be_available

Use should to check if the entity is available.

describe aws_api_gateway_documentation_version(rest_api_id: 'REST_API_ID', documentation_version: 'DOCUMENTATION_VERSION') do
  it { should be_available }
end

AWS Permissions

Your Principal will need the APIGateway:Client:DocumentationVersion action with Effect set to Allow.

Edit this page on GitHub.

Thank you for your feedback!

×









Search Results