aws_ec2_spot_fleets resource
Use the aws_ec2_spot_fleets InSpec audit resource to test properties of the plural AWS EC2 Spot Fleet.
The AWS::EC2::SpotFleet resource specifies a Spot Fleet request. A Spot Fleet request contains the configuration information to launch a fleet, or group, of instances.
For additional information, including details on parameters and properties, see the AWS documentation on AWS EC2 Spot Fleet..
Syntax
Ensure that spot fleets exists.
describe aws_ec2_spot_fleets do
it { should exist }
end
Parameters
This resource does not require any parameters.
Properties
activity_statuses- The progress of the Spot Fleet request.
Field:
activity_statuscreate_times- The creation date and time of the request.
Field:
create_timespot_fleet_request_configs- The configs of the Spot Fleet request.
Field:
spot_fleet_request_configspot_fleet_request_ids- The ID of the Spot Fleet request.
Field:
spot_fleet_request_idspot_fleet_request_states- The state of the Spot Fleet request.
Field:
spot_fleet_request_state- The tags for a Spot Fleet resource.
Field:
tags
Examples
Ensure an activity status is there:
describe aws_ec2_spot_fleets do
its('activity_statuses') { should include 'error' }
end
Ensure that the state is active:
describe aws_ec2_spot_fleets do
its('spot_fleet_request_states') { should include 'available' }
end
Matchers
For a full list of available matchers, see 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_spot_fleets do
it { should exist }
end
Use should_not to test the entity does not exist.
describe aws_ec2_spot_fleets do
it { should_not exist }
end
AWS Permissions
Your AWS principal will need the EC2:Client:DescribeSpotFleetRequestsResponse action with Effect set to Allow.