aws_batch_job_queue Resource
Use the aws_batch_job_queue
InSpec audit resource to test the properties of a single AWS Batch job queue.
For additional information, including details on parameters and properties, see the AWS Batch job queues documentation.
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 job_queue name exists.
describe aws_batch_job_queue(job_queue_name: 'JOB_QUEUE_NAME') do
it { should exist }
end
Parameters
job_queue_name
(required)The name of the job queue.
Properties
job_queue_name
- The name of the job queue.
job_queue_arn
- The ARN of the job queue.
state
- The state of the job queue.
status
- The status of the job queue.
status_reason
- The status_reason of the job queue.
priority
- The priority of the job queue.
compute_environment_order (order)
- The order of the compute environment of the job queue.
compute_environment_order (compute_environment)
- The ARN of the compute environment of the job queue.
tags
- The tags of the job queue.
Examples
Ensure a job queue name is available.
describe aws_batch_job_queue(job_queue_name: 'JOB_QUEUE_NAME') do
its('job_queue_name') { should eq 'JOB_QUEUE_NAME' }
end
Ensure that the state is ENABLED
or DISABLED
.
describe aws_batch_job_queue(job_queue_name: 'JOB_QUEUE_NAME') do
its('state') { should eq 'ENABLED' }
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_batch_job_queue(job_queue_name: 'JOB_QUEUE_NAME') do
it { should exist }
end
Use should_not
to test the entity does not exist.
describe aws_batch_job_queue(job_queue_name: 'JOB_QUEUE_NAME') do
it { should_not exist }
end
be_available
Use should
to check if the job_queue name is available.
describe aws_batch_job_queue(job_queue_name: 'JOB_QUEUE_NAME') do
it { should be_available }
end
AWS Permissions
Your Principal will need the Batch:Client:DescribeJobQueuesResponse
action with Effect
set to Allow
.