title | platform |
---|---|
About the aws_ec2_placement_group Resource |
aws |
Use the aws_ec2_placement_group
InSpec audit resource to test the properties of a single specific EC2 placement group.
describe aws_ec2_placement_group(group_id: 'GROUP_ID') do
it { should exist }
end
group_id
(required)
The ID of the placement group.
group_name
(required)
The name of the placement group.
For additional information, see the AWS documentation on EC2 placement groups.
Property | Description |
---|---|
group_name | The name of the placement group. |
state | The state of the placement group. |
strategy | The placement strategy. |
partition_count | The partition count of the placement group. |
group_id | The ID of the placement group. |
tags | The tags of the placement group. |
describe aws_ec2_placement_group(group_id: 'GROUP_ID') do
its('group_id') { should eq 'GROUP_ID' }
end
describe aws_ec2_placement_group(group_id: 'GROUP_ID') do
its('state') { should eq 'available' }
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_placement_group(group_id: 'GROUP_ID') do
it { should exist }
end
Use should_not
to test the entity does not exist.
describe aws_ec2_placement_group(group_id: 'GROUP_ID') do
it { should_not exist }
end
Check if the entity is available.
describe aws_ec2_placement_group(group_id: 'GROUP_ID') do
it { should be_available }
end
Your Principal will need the EC2:Client:DescribePlacementGroupsResult
action with Effect
set to Allow
.
See the Actions, Resources, and Condition Keys for Amazon EC2 documentation for additional information.