aws_ec2_network_insights_analysis Resource
Use the aws_ec2_network_insights_analysis
InSpec audit resource to test properties of a single specific AWS EC2 network insights analysis.
The AWS::EC2::NetworkInsightsAnalysis
resource specifies a network insights analysis.
For additional information, including details on parameters and properties, see the AWS documentation on AWS EC2 Network Insights Analysis.
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 network insights analysis ID exists.
describe aws_ec2_network_insights_analysis(network_insights_analysis_id: 'NETWORK_INSIGHTS_ANALYSIS_ID') do
it { should exist }
end
Parameters
network_insights_analysis_id
(required)The ID of the network insights analysis.
Properties
network_insights_analysis_id
- The ID of the network insights analysis.
network_insights_analysis_arn
- The Amazon Resource Name (ARN) of the network insights analysis.
network_insights_path_id
- The ID of the path.
filter_in_arns
- The Amazon Resource Names (ARN) of the Amazon Web Services resources that the path must traverse.
start_date
- The time the analysis started.
status
- The status of the network insights analysis.
status_message
- The status message, if the status is failed.
network_path_found
- Indicates whether the destination is reachable from the source.
forward_path_components
- The components in the path from source to destination.
return_path_components
- The components in the path from destination to source.
explanations
- The explanations.
alternate_path_hints
- Potential intermediate components.
tags
- The tags of the insights analysis.
Examples
Ensure a Network Insights Analysis Id is available.
describe aws_ec2_network_insights_analysis(network_insights_analysis_id: 'NETWORK_INSIGHTS_ANALYSIS_ID') do
its('network_insights_analysis_id') { should eq 'NETWORK_INSIGHTS_ANALYSIS_ID' }
end
Ensure that the Network Insights Path Id is available.
describe aws_ec2_network_insights_analysis(network_insights_analysis_id: 'NETWORK_INSIGHTS_ANALYSIS_ID') do
its('network_insights_path_id') { should eq 'NETWORK_INSIGHTS_PATH_ID' }
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 describe
method returns at least one result.
exist
Use should
to test that the entity exists.
describe aws_ec2_network_insights_analysis(network_insights_analysis_id: 'NETWORK_INSIGHTS_ANALYSIS_ID') do
it { should exist }
end
Use should_not
to test the entity does not exist.
describe aws_ec2_network_insights_analysis(network_insights_analysis_id: 'NETWORK_INSIGHTS_ANALYSIS_ID') do
it { should_not exist }
end
be_available
Use should
to check if the entity is available.
describe aws_ec2_network_insights_analysis(network_insights_analysis_id: 'NETWORK_INSIGHTS_ANALYSIS_ID') do
it { should be_available }
end
AWS Permissions
Your Principal will need the EC2:Client:DescribeNetworkInsightsAnalysesResult
action with Effect
set to Allow
.
Was this page helpful?