aws_network_manager_customer_gateway_association resource
Use the aws_network_manager_customer_gateway_association
InSpec audit resource to test properties of a single specific AWS Network Manager customer gateway association.
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..
Syntax
Ensure that the customer gateway association exists.
describe aws_network_manager_customer_gateway_association(global_network_id: 'GLOBAL_NETWORK_ID', customer_gateway_arn: 'CUSTOMER_GATEWAY_ARN') do
it { should exist }
end
Parameters
global_network_id
(required)The ID of the global network.
customer_gateway_arn
(required)The Amazon Resource Name (ARN) of the customer gateway.
Properties
customer_gateway_arn
- The Amazon Resource Name (ARN) of the customer gateway.
global_network_id
- The ID of the global network.
device_id
- The ID of the device.
link_id
- The ID of the link.
state
- The association state.
Examples
Ensure a customer gateway arn is available:
describe aws_network_manager_customer_gateway_association(global_network_id: 'GLOBAL_NETWORK_ID', customer_gateway_arn: 'CUSTOMER_GATEWAY_ARN') do
its('customer_gateway_arn') { should eq 'CustomerGatewayARN' }
end
Ensure that the state is active
:
describe aws_network_manager_customer_gateway_association(global_network_id: 'GLOBAL_NETWORK_ID', customer_gateway_arn: 'CUSTOMER_GATEWAY_ARN') do
its('state') { should eq 'AVAILABLE' }
end
Matchers
For a full list of available matchers, see our Universal Matchers page.This resource has the following special matchers.
exist
Use should
to test that the entity exists.
describe aws_network_manager_customer_gateway_association(global_network_id: 'GLOBAL_NETWORK_ID', customer_gateway_arn: 'CUSTOMER_GATEWAY_ARN') 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: 'GLOBAL_NETWORK_ID', customer_gateway_arn: 'CUSTOMER_GATEWAY_ARN') do
it { should_not exist }
end
be_available
Use should
to check if the entity is available.
describe aws_network_manager_customer_gateway_association(global_network_id: 'GLOBAL_NETWORK_ID', customer_gateway_arn: 'CUSTOMER_GATEWAY_ARN') do
it { should be_available }
end
AWS Permissions
Your AWS principal will need the NetworkManager:Client:GetCustomerGatewayAssociationsResponse
action with Effect
set to Allow
.