aws_ec2_network_insights_paths resource
Use the aws_ec2_network_insights_paths InSpec audit resource to test properties of multiple AWS EC2 paths to analyze for reachability.
The AWS::EC2::NetworkInsightsPath resource specifies a path to analyze for reachability.
For additional information, including details on parameters and properties, see the AWS documentation on AWS EC2 network insights path.
Syntax
Ensure that network insights path ID exists.
describe aws_ec2_network_insights_paths do
it { should exist }
end
Parameters
This resource does not require any parameters.
Properties
network_insights_path_ids- The ID of the path.
Field:
network_insights_path_idnetwork_insights_path_arns- The Amazon Resource Name (ARN) of the path.
Field:
network_insights_path_arncreated_dates- The time stamp when the path was created.
Field:
created_datesources- The Amazon Web Services resource that is the source of the path.
Field:
sourcedestinations- The Amazon Web Services resource that is the destination of the path.
Field:
destinationsource_ips- The IP address of the Amazon Web Services resource that is the source of the path.
Field:
source_ipdestination_ips- The IP address of the Amazon Web Services resource that is the destination of the path.
Field:
destination_ipprotocols- The protocol.
Field:
protocoldestination_ports- The destination port.
Field:
destination_port- The tags associated with the path.
Field:
tags
Examples
Ensure a network insights path ID is available:
describe aws_ec2_network_insights_paths do
its('network_insights_path_ids') { should include 'NETWORK_INSIGHTS_PATH_ID' }
end
Ensure a network insights path ARN is available:
describe aws_ec2_network_insights_paths do
its('network_insights_path_arns') { should include 'NETWORK_INSIGHTS_PATH_ARN' }
end
Matchers
For a full list of available matchers, see our Universal Matchers page.The controls will pass if the describe method returns at least one result.
exist
Use should to test that the entity exists.
describe aws_ec2_network_insights_paths do
it { should exist }
end
Use should_not to test the entity does not exist.
describe aws_ec2_network_insights_paths do
it { should_not exist }
end
AWS Permissions
Your AWS principal will need the EC2:Client:DescribeNetworkInsightsPathsResult action with Effect set to Allow.