Skip to main content

aws_ec2_network_interface_permissions Resource

Use the aws_ec2_network_interface_permissions InSpec audit resource to test properties of multiple AWS EC2 network interface permission.

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 interface permission ID exists.

describe aws_ec2_network_interface_permissions do
  it { should exist }
end

For additional information, see the AWS documentation on AWS EC2 Network Interface Permissions.

Parameters

This resource does not require any parameters.

Properties

network_interface_permission_ids
The ID of the network interface.

Field: network_interface_permission_id

network_interface_ids
The Amazon Web Services account ID.

Field: network_interface_id

aws_account_ids
The Amazon Web Service. Currently not supported.

Field: aws_account_id

states
The state of the permission. String, one of “pending”, “granted”, “revoking”, “revoked”.

Field: state

status_messages
The status message of the permission state.

Field: status_message

Examples

Ensure a network interface permission ID is available.

describe aws_ec2_network_interface_permissions do
  its('network_interface_permission_ids') { should include 'NETWORK_INTERFACE_PERMISSION_ID' }
end

Ensure that the interface permission state is ‘pending’.

describe aws_ec2_network_interface_permissions do
    its('states') { should include 'pending' }
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_interface_permissions do
  it { should exist }
end

Use should_not to test the entity does not exist.

describe aws_ec2_network_interface_permissions do
  it { should_not exist }
end

be_available

Use should to check if the entity is available.

describe aws_ec2_network_interface_permissions do
  it { should be_available }
end

AWS Permissions

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

Edit this page on GitHub

Thank you for your feedback!

×