Skip to main content

aws_ecs_task_definitions Resource

Use the aws_ecs_task_definitions InSpec audit resource to test the properties of multiple ECS task definitions.

For additional information, including details on parameters and properties, see the AWS ECS task definition documentation.

Installation

This resource is available in the Chef InSpec AWS resource pack.

See the Chef InSpec documentation on cloud platforms for information on configuring your AWS environment for InSpec and creating an InSpec profile that uses the InSpec AWS resource pack.

Syntax

Ensure that a task definition ARNs exists.

describe aws_ecs_task_definitions do
  it { should exist }
end

Parameters

This resource does not require any parameters.

Properties

task_definition_arns
A list of ARNs to describe the task definition.

Examples

Ensure a task definition ARN is available.

describe aws_ecs_task_definitions do
  its('task_definition_arns') { should include 'arn:aws:ecs:REGION:AWS_ACCOUNT_ID:task-definition/TASK_DEFINITION_ID' }
end

Matchers

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 list_task_definitions method returns at least one result.

exist

Use should to test that the entity exists.

describe aws_ecs_task_definitions do
  it { should exist }
end

Use should_not to test the entity does not exist.

describe aws_ecs_task_definitions do
  it { should_not exist }
end

be_available

Use should to check if the task definition arns is available.

describe aws_ecs_task_definitions do
  it { should be_available }
end

AWS Permissions

Your Principal will need the ECS:Client:ListTaskDefinitionsResponse action with Effect set to Allow.

Edit this page on GitHub

Thank you for your feedback!

×









Search Results