Skip to main content

aws_ec2_eip_associations Resource

Use the aws_ec2_eip_associations InSpec audit resource to test properties of some or all AWS Elastic IP association.

This resource does not expect any parameters.

For additional information, including details on parameters and properties, see the AWS documentation on AWS Elastic IP association.


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.


Verify that the association exists.

describe aws_ec2_eip_associations do
  it { should exist }


This resource does not require any parameters.


The association ID for the address.

Field: association_id


Check association ID is available.

describe aws_ec2_eip_associations do
   its('association_ids') { should include "ASSOCIATION_ID" }


This InSpec audit resource has the following special matchers. For a full list of available matchers, please visit our Universal Matchers page.


The control will pass if the describe returns at least one result.

Use should to test that the entity exists.

describe aws_ec2_eip_associations do
  it { should exist }

Use should_not to test the entity does not exist.

describe aws_ec2_eip_associations do
  it { should_not exist }

AWS Permissions

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

You can find detailed documentation at Actions, Resources, and Condition Keys for Amazon EC2.

Edit this page on GitHub

Thank you for your feedback!


Search Results