aws_batch_compute_environments Resource
Use the aws_batch_compute_environments
InSpec audit resource to test properties of multiple AWS Batch compute environments.
For additional information, including details on parameters and properties, see the AWS documentation on Batch compute environment.
Install
This resource is available in the Chef InSpec AWS resource pack.
For information on configuring your AWS environment for Chef InSpec and creating an InSpec profile that uses the InSpec AWS resource pack, see the Chef InSpec documentation on the AWS cloud platform.
Syntax
Ensure that a compute environment exists.
describe aws_batch_compute_environments do
it { should exist }
end
Parameters
This resource does not require any parameters.
Properties
compute_environment_names
- The name of the compute environment.
compute_environment_arns
- The ARN of the compute environment.
ecs_cluster_arns
- The ECS cluster ARN of the compute environment.
tags
- The tags of the compute environment.
types
- The type of the compute environment.
states
- The state of the compute environment.
statuses
- The status of the compute environment.
status_reasons
- The status reason of the compute environment.
service_roles
- The service role of the compute environment.
Examples
Ensure a work group name is available.
describe aws_batch_compute_environments do
its('compute_environment_names') { should include 'COMPUTE_ENVIRONMENT_NAME' }
end
Ensure that the state is ENABLED
or DISABLED
.
describe aws_batch_compute_environments do
its('states') { should include 'ENABLED' }
end
Matchers
This InSpec audit resource has the following special matchers. For a full list of the 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_batch_compute_environments do
it { should exist }
end
Use should_not
to test the entity does not exist.
describe aws_batch_compute_environments do
it { should_not exist }
end
be_available
Use should
to check if the compute environments are available.
describe aws_batch_compute_environments do
it { should be_available }
end
AWS Permissions
Your Principal will need the Batch:Client:DescribeComputeEnvironmentsResponse
action with Effect
set to Allow
.