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.
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 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
orEXPRESS
. 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
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
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
.