Skip to main content

aws_ec2_network_insights_path Resource

Use the aws_ec2_network_insights_path InSpec audit resource to test properties of a single specific AWS EC2 path 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.

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 network insights path ID exists.

describe aws_ec2_network_insights_path(network_insights_path_id: 'NETWORK_INSIGHTS_PATH_ID') do
  it { should exist }
end

Parameters

network_insights_path_id (required)

The ID of the path.

Properties

network_insights_path_id
The ID of the path.
network_insights_path_arn
The Amazon Resource Name (ARN) of the path.
created_date
The timestamp when the path was created.
source
The Amazon Web Services resource that is the source of the path.
destination
The Amazon Web Services resource that is the destination of the path.
source_ip
The IP address of the Amazon Web Services resource that is the source of the path.
destination_ip
The IP address of the Amazon Web Services resource that is the destination of the path.
protocol
The protocol.
destination_port
The destination port.
tags
The tags associated with the path.

Examples

Ensure a network insights path ID is available.

describe aws_ec2_network_insights_path(network_insights_path_id: 'NETWORK_INSIGHTS_PATH_ID') do
  its('network_insights_path_id') { should eq 'NETWORK_INSIGHTS_PATH_ID' }
end

Ensure a network insights path ARN is available.

describe aws_ec2_network_insights_path(network_insights_path_id: 'NETWORK_INSIGHTS_PATH_ID') do
    its('network_insights_path_arn') { should eq '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_path(network_insights_path_id: 'NETWORK_INSIGHTS_PATH_ID') do
  it { should exist }
end

Use should_not to test the entity does not exist.

describe aws_ec2_network_insights_path(network_insights_path_id: 'NETWORK_INSIGHTS_PATH_ID') do
  it { should_not exist }
end

be_available

Use should to check if the entity is available.

describe aws_ec2_network_insights_path(network_insights_path_id: 'NETWORK_INSIGHTS_PATH_ID') do
  it { should be_available }
end

AWS Permissions

Your Principal will need the EC2:Client:DescribeNetworkInsightsPathsResult action with Effect set to Allow.

Edit this page on GitHub

Thank you for your feedback!

×