Use the aws_regions InSpec audit resource to test properties of some or all AWS regions in bulk.
Note that this resource lists all AWS regions that are currently available to the caller.
An aws_regions resource block uses an optional filter to select a group of regions and then tests that group.
describe aws_regions.where { region_name: 'us-not-there-1' } do
it { should_not exist }
end
This resource does not expect any parameters.
See also the AWS documentation on Regions.
| Property | Description |
|---|---|
| region_names | The Names of the regions. |
| endpoints | The resolved endpoints of the regions. |
The following examples show how to use this InSpec audit resource.
describe aws_regions do
its('region_names') { should include 'eu-west-2' }
end
describe aws_regions do
its('endpoints') { should include 'ec2.eu-west-2.amazonaws.com' }
end
aws_regions.region_names.each do |aws_region_name|
describe aws_region(region_name: aws_region_name) do
it { should exist }
end
end
For a full list of available matchers, please visit our matchers page.
The control will pass if the describe returns at least one result.
it { should exist }
Your Principal will need the ec2:DescribeVpcs action with Effect set to Allow.
You can find detailed documentation at Actions, Resources, and Condition Keys for Amazon EC2.
© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/inspec/resources/aws_regions/