aws_ec2_eip_association Resource
Use the aws_ec2_eip_association
InSpec audit resource to test properties of the singular resource of AWS Elastic IP association.
An Elastic IP (EIP) is uniquely identified by the public IPv4 address, for example association_id
.
association_id
(required)
The association ID for the address.
For additional information, including details on parameters and properties, see the AWS documentation on AWS Elastic IP association.
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
Verify that the association exists.
describe aws_ec2_eip_association(association_id: 'ASSOCIATION_ID') do
it { should exist }
end
Parameters
association_id
(required)The association ID for the address.
Properties
association_id
- The association ID for the address.
Examples
Check association ID whether it is correct or not.
describe aws_ec2_eip_association(association_id: 'ASSOCIATION_ID') do
its('ASSOCIATION_ID') { should eq "ASSOCIATION_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_eip_association(association_id: 'ASSOCIATION_ID') do
it { should exist }
end
Use should_not
to test the entity does not exist.
describe aws_ec2_eip_association(association_id: 'ASSOCIATION_ID') do
it { should_not exist }
end
be_available
Check if the entity is available.
describe aws_ec2_eip_association(association_id: 'ASSOCIATION_ID') do
it { should be_available }
end
AWS Permissions
Your Principal will need the EC2:Client:DescribeAddressesResult
action with Effect
set to Allow
.
See the Actions, Resources, and Condition Keys for Amazon EC2 documentation for additional information.