Skip to main content

aws_stepfunctions_state_machines Resource

Use the aws_stepfunctions_state_machines InSpec audit resource to test properties of multiple Step Functions state machines.

A state machine consists of a collection of states that can do work (Task states), determine which states to transition next (Choice states), stop an execution with an error (Fail states), and so on.

For additional information, including details on parameters and properties, see the AWS documentation on Step Functions state machine.

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 state machine exists.

describe aws_stepfnctions_state_machines do
  it { should exist }
end

Parameters

This resource does not require any parameters.

Properties

state_machine_arns
The ARNs of the state machine.
names
The names of the state machine.
types
The type of the state machine. Valid values: STANDARD or EXPRESS.
creation_date
The creation dates of the state machine.

Examples

Ensure an state machine ARN is available.

describe aws_stepfunctions_state_machines do
  its('state_machine_arns') { should include 'STATE_MACHINE_ARN' }
end

Ensure a name is available.

describe aws_stepfunctions_state_machines do
    its('names') { should include 'STATE_MACHINE_NAME' }
end

Matchers

For a full list of available matchers, see our Universal Matchers page.

The controls will pass if the list method returns at least one result.

exist

Use should to test that the entity exists.

describe aws_stepfunctions_state_machines do
  it { should exist }
end

Use should_not to test the entity does not exist.

describe aws_stepfunctions_state_machines do
  it { should_not exist }
end

be_available

Use should to check if the state machine is available.

describe aws_stepfunctions_state_machines do
  it { should be_available }
end

AWS Permissions

Your Principal will need the States:Client:ListStateMachinesOutput action with Effect set to Allow.

Edit this page on GitHub

Thank you for your feedback!

×