aws_network_manager_customer_gateway_associations Resource
Use the aws_network_manager_customer_gateway_associations
InSpec audit resource to test properties of multiple AWS Network Manager customer gateway associations.
The AWS::NetworkManager::CustomerGatewayAssociation
resource specifies an association between a customer gateway, a device, and optionally, a link.
For additional information, including details on parameters and properties, see the AWS documentation on AWS Network Manager Customer Gateway Association..
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 customer gateway association exists.
describe aws_network_manager_customer_gateway_associations(global_network_id: "GLOBAL_NETWORK_ID") do
it { should exist }
end
Parameters
global_network_id
(required)-
The ID of the global network.
Properties
customer_gateway_arns
- The Amazon Resource Name (ARN) of the customer gateway.
-
Field:
customer_gateway_arn
global_network_ids
- The ID of the global network.
-
Field:
global_network_id
device_ids
- The ID of the device.
-
Field:
device_id
link_ids
- The ID of the link.
-
Field:
link_id
states
- The association state.
-
Field:
state
Examples
Ensure a customer gateway arn is available.
describe aws_network_manager_customer_gateway_association(global_network_id: 'GLOBAL_NETWORK_ID') do
its('customer_gateway_arns') { should include 'CustomerGatewayARN' }
end
Ensure that the state is active
.
describe aws_network_manager_customer_gateway_association(global_network_id: 'GLOBAL_NETWORK_ID') do
its('states') { should include 'AVAILABLE' }
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_network_manager_customer_gateway_association(global_network_id: 'GLOBAL_NETWORK_ID') do
it { should exist }
end
Use should_not
to test the entity does not exist.
describe aws_network_manager_customer_gateway_association(global_network_id: "dummy") do
it { should_not exist }
end
AWS Permissions
Your Principal will need the NetworkManager:Client:GetCustomerGatewayAssociationsResponse
action with Effect
set to Allow
.
Was this page helpful?