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.
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_idnetwork_interface_ids- The Amazon Web Services account ID.
Field:
network_interface_idaws_account_ids- The Amazon Web Service. Currently not supported.
Field:
aws_account_idstates- The state of the permission. String, one of “pending”, “granted”, “revoking”, “revoked”.
Field:
statestatus_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 AWS principal will need the EC2:Client:DescribeNetworkInterfacePermissionsResult action with Effect set to Allow.