title | platform |
---|---|
About the aws_ec2_network_interface_permission Resource |
aws |
Use the aws_ec2_network_interface_permission
InSpec audit resource to test the properties of a single specific AWS EC2 network interface permission.
Ensure that network interface permission ID exists.
describe aws_ec2_network_interface_permission(network_interface_permission_id: 'NETWORK_INTERFACE_PERMISSION_ID') do
it { should exist }
end
network_interface_permission_id
(required)
: The ID of the network interface permission.
For additional information, see the AWS documentation on AWS EC2 Network Interface Permission.
Property | Description |
---|---|
network_interface_permission_id | The ID of the network interface. |
network_interface_id | The Amazon Web Services account ID. |
aws_account_id | The Amazon Web Service. Currently not supported. |
state | The state of the permission. Valid values are: "pending", "granted", "revoking", "revoked". |
status_message | The status message of the permission state. |
describe aws_ec2_network_interface_permission(network_interface_permission_id: 'NETWORK_INTERFACE_PERMISSION_ID') do
its('network_interface_permission_id') { should eq 'NETWORK_INTERFACE_PERMISSION_ID' }
end
describe aws_ec2_network_interface_permission(network_interface_permission_id: 'NETWORK_INTERFACE_PERMISSION_ID') do
its('state') { should eq 'pending' }
end
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.
Use should
to test that the entity exists.
describe aws_ec2_network_interface_permission(network_interface_permission_id: 'NETWORK_INTERFACE_PERMISSION_ID') do
it { should exist }
end
Use should_not
to test the entity does not exist.
describe aws_ec2_network_interface_permission(network_interface_permission_id: 'NETWORK_INTERFACE_PERMISSION_ID') do
it { should_not exist }
end
Use should
to check if the entity is available.
describe aws_ec2_network_interface_permission(network_interface_permission_id: 'NETWORK_INTERFACE_PERMISSION_ID') do
it { should be_available }
end
Your Principal will need the EC2:Client:DescribeNetworkInterfacePermissionsResult
action with Effect
set to Allow
.