Follow the step-by-step instructions below to create a State Machine. Click on each step number to expand the section.
Create a state machine by using the AWS Step Functions console
To create a state machine, you use the AWS Step Functions console. Step Functions is a web service that lets you coordinate the components of distributed applications and microservices by using visual workflows. The Lambda functions are invoked when the state machine is run and reaches the Task state.
For this project, the state machine performs the following tasks:
Creates an AppStream 2.0 image builder.
Gets the status of the AppStream 2.0 image builder and fleet.
Sends a streaming URL.
Gets the AppStream 2.0 image name.
Creates an AppStream fleet and stack, and associates the fleet with a stack.
Stops the AppStream 2.0 fleet and image builder.
To create the state machine, perform the following steps:
Open the AWS Step Functions console at https://console.aws.amazon.com/states/.
Do one of the following:
If you haven’t created any State Machines functions, a Getting Started page displays. Choose Getting Started, and then choose State Machines.
If you have created a State Machines function, in the upper right corner of the State machines page, choose Create state machine.
On the Define State Machine page, keep Author from code snippet selected.
In the Type section, keep Standard selected.
In the State machine definition section, delete the placeholder code and paste the following code in the edit window.
• Replace <AWS-ACCOUNT-ID> with your AWS account number.
• Replace <REGION-CODE> with the AWS Region you chose. The value must be in all lowercase.
9. On the
Permissions section, select
Choose an existing role.
10. In the
Existing roles dropdown choose
examplecorp_eao_role, the IAM role that you created in Module 2.
Create state machine.
12. At the top of the page, in the
Details section, the
ARN of the state machine displays. Make a note of this ARN. This ARN is required later in the project and is formatted as arn:aws:states:<REGION-CODE>:<AWS_ACCOUNT-ID>:stateMachine:<STATE-MACHINE-NAME>