aws_api_gateway_vpc_links resource
Use the aws_api_gateway_vpc_links
InSpec audit resource to test multiple AWS API Gateway VPC link properties.
For additional information, including parameters and properties, see the AWS documentation on AWS APIGateway VPCLink.
Install
This resource is available in the Chef InSpec AWS resource pack.
For information on configuring your AWS environment for Chef InSpec and creating an InSpec profile that uses the InSpec AWS resource pack, see the Chef InSpec documentation on the AWS cloud platform.
Syntax
Ensure that a VPC link exists.
describe aws_api_gateway_vpc_links do
it { should exist }
end
Parameters
This resource does not require any parameters.
Properties
ids
- The identifier of the VPC link used to integrate to reference this VPC link.
Field:
id
names
- The name used to label and identify the VPC link.
Field:
name
descriptions
- The description of the VPC link.
Field:
description
target_arns
- The ARN of the network load balancer of the VPC targeted by the VPC link. The network load balancer must be owned by the same AWS account of the API owner.
Field:
target_arns
statuses
- The status of the VPC link. The valid values are
AVAILABLE
,PENDING
,DELETING
, orFAILED
. If the status isPENDING
, the API deployment waits, and if the status isDELETING
, the API deployment fails. Field:
status
status_messages
- A description about the VPC link status.
Field:
status_message
tags
- The collection of tags. Each tag element is associated with a given resource.
Field:
tags
Examples
Test to ensure a VPC link ID is available
describe aws_api_gateway_vpc_links do
its('ids') { should include 'VPC_LINK_ID' }
end
Test to ensure a VPC link name is available
describe aws_api_gateway_vpc_links do
its('names') { should include 'VPC_LINK_NAME' }
end
Test to verify the status as AVAILABLE
describe aws_api_gateway_vpc_links do
its('statuses') { should include 'AVAILABLE' }
end
Matchers
For a full list of available matchers, see our Universal Matchers page.The control passes if the get
method returns at least one result.
exist
Use should
to test that the entity exists.
describe aws_api_gateway_vpc_links do
it { should exist }
end
Use should_not
to test that the entity does not exist.
describe aws_api_gateway_vpc_links do
it { should_not exist }
end
AWS Permissions
Your Principal will need the APIGateway:Client:VpcLinks
action with Effect
set to Allow
.