aws_batch_job_definitions Resource
Use the aws_batch_job_definitions
InSpec audit resource to test properties of multiple AWS Batch job definitions.
The AWS::Batch::JobDefinition resource specifies the parameters for an AWS Batch job definition.
For additional information, including details on parameters and properties, see the AWS documentation on Batch Job Definition.
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 definition exists.
describe aws_batch_job_definitions do
it { should exist }
end
Parameters
This resource does not require any parameters.
Properties
job_definition_names
- The name of the job definition.
job_definition_arns
- The ARN of the job definition.
revisions
- The revision of the job definition.
statuses
- The status of the job definition.
types
- The type of the job definition.
parameters
- The parameter of the job definition.
tags
- The tags of the job definition.
propagate_tags
- Whether to propagate tags from the job definition to the ECS task.
platform_capabilities
- The platform capabilities required by the job definition.
Examples
Ensure a job definition name is available.
describe aws_batch_job_definitions do
its('job_definition_names') { should include 'JOB_DEFINITION_NAME' }
end
Ensure that the status is ACTIVE
.
describe aws_batch_job_definitions do
its('statuses') { should include 'ACTIVE' }
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_job_definitions do
it { should exist }
end
Use should_not
to test the entity does not exist.
describe aws_batch_job_definitions do
it { should_not exist }
end
be_available
Use should
to check if the job_definition name is available.
describe aws_batch_job_definitions do
it { should be_available }
end
AWS Permissions
Your Principal will need the Batch:Client:DescribeJobDefinitionsResponse
action with Effect
set to Allow
.