AWS Tools for Windows PowerShell
Command Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Synopsis

Calls the AWS Step Functions CreateStateMachine API operation.

Syntax

New-SFNStateMachine
-Name <String>
-Definition <String>
-LoggingConfiguration_Destination <LogDestination[]>
-TracingConfiguration_Enabled <Boolean>
-LoggingConfiguration_IncludeExecutionData <Boolean>
-EncryptionConfiguration_KmsDataKeyReusePeriodSecond <Int32>
-EncryptionConfiguration_KmsKeyId <String>
-LoggingConfiguration_Level <LogLevel>
-Publish <Boolean>
-RoleArn <String>
-Tag <Tag[]>
-EncryptionConfiguration_Type <EncryptionType>
-Type <StateMachineType>
-VersionDescription <String>
-Select <String>
-PassThru <SwitchParameter>
-Force <SwitchParameter>
-ClientConfig <AmazonStepFunctionsConfig>

Description

Creates a state machine. A state machine consists of a collection of states that can do work (Task states), determine to which states to transition next (Choice states), stop an execution with an error (Fail states), and so on. State machines are specified using a JSON-based, structured language. For more information, see Amazon States Language in the Step Functions User Guide. If you set the publish parameter of this API action to true, it publishes version 1 as the first revision of the state machine. For additional control over security, you can encrypt your data using a customer-managed key for Step Functions state machines. You can configure a symmetric KMS key and data key reuse period when creating or updating a State Machine. The execution history and state machine definition will be encrypted with the key applied to the State Machine. This operation is eventually consistent. The results are best effort and may not reflect very recent updates and changes. CreateStateMachine is an idempotent API. Subsequent requests won’t create a duplicate resource if it was already created. CreateStateMachine's idempotency check is based on the state machine name, definition, type, LoggingConfiguration, TracingConfiguration, and EncryptionConfiguration The check is also based on the publish and versionDescription parameters. If a following request has a different roleArn or tags, Step Functions will ignore these differences and treat it as an idempotent request of the previous. In this case, roleArn and tags will not be updated, even if they are different.

Parameters

Amazon.PowerShell.Cmdlets.SFN.AmazonStepFunctionsClientCmdlet.ClientConfig
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Definition <String>
The Amazon States Language definition of the state machine. See Amazon States Language.
Required?True
Position?Named
Accept pipeline input?True (ByPropertyName)
-EncryptionConfiguration_KmsDataKeyReusePeriodSecond <Int32>
Maximum duration that Step Functions will reuse data keys. When the period expires, Step Functions will call GenerateDataKey. Only applies to customer managed keys.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesEncryptionConfiguration_KmsDataKeyReusePeriodSeconds
-EncryptionConfiguration_KmsKeyId <String>
An alias, alias ARN, key ID, or key ARN of a symmetric encryption KMS key to encrypt data. To specify a KMS key in a different Amazon Web Services account, you must use the key ARN or alias ARN.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-EncryptionConfiguration_Type <EncryptionType>
Encryption type
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
This parameter overrides confirmation prompts to force the cmdlet to continue its operation. This parameter should always be used with caution.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-LoggingConfiguration_Destination <LogDestination[]>
An array of objects that describes where your execution history events will be logged. Limited to size 1. Required, if your log level is not set to OFF.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesLoggingConfiguration_Destinations
-LoggingConfiguration_IncludeExecutionData <Boolean>
Determines whether execution data is included in your log. When set to false, data is excluded.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-LoggingConfiguration_Level <LogLevel>
Defines which category of execution history events are logged.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Name <String>
The name of the state machine. A name must not contain:
  • white space
  • brackets < > { } [ ]
  • wildcard characters ? *
  • special characters " # % \ ^ | ~ ` $ & , ; : /
  • control characters (U+0000-001F, U+007F-009F)
To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _.
Required?True
Position?1
Accept pipeline input?True (ByValue, ByPropertyName)
-PassThru <SwitchParameter>
Changes the cmdlet behavior to return the value passed to the Name parameter. The -PassThru parameter is deprecated, use -Select '^Name' instead. This parameter will be removed in a future version.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Publish <Boolean>
Set to true to publish the first version of the state machine during creation. The default is false.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-RoleArn <String>
The Amazon Resource Name (ARN) of the IAM role to use for this state machine.
Required?True
Position?Named
Accept pipeline input?True (ByPropertyName)
-Select <String>
Use the -Select parameter to control the cmdlet output. The default value is '*'. Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.StepFunctions.Model.CreateStateMachineResponse). Specifying the name of a property of type Amazon.StepFunctions.Model.CreateStateMachineResponse will result in that property being returned. Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Tag <Tag[]>
Tags to be added when creating a state machine.An array of key-value pairs. For more information, see Using Cost Allocation Tags in the Amazon Web Services Billing and Cost Management User Guide, and Controlling Access Using IAM Tags.Tags may only contain Unicode letters, digits, white space, or these symbols: _ . : / = + - @.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTags
-TracingConfiguration_Enabled <Boolean>
When set to true, X-Ray tracing is enabled.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
Determines whether a Standard or Express state machine is created. The default is STANDARD. You cannot update the type of a state machine once it has been created.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-VersionDescription <String>
Sets description about the state machine version. You can only set the description if the publish parameter is set to true. Otherwise, if you set versionDescription, but publish to false, this API action throws ValidationException.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)

Common Credential and Region Parameters

-AccessKey <String>
The AWS access key for the user account. This can be a temporary access key if the corresponding session token is supplied to the -SessionToken parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAK
-Credential <AWSCredentials>
An AWSCredentials object instance containing access and secret key information, and optionally a token for session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-EndpointUrl <String>
The endpoint to make the call against.Note: This parameter is primarily for internal AWS use and is not required/should not be specified for normal usage. The cmdlets normally determine which endpoint to call based on the region specified to the -Region parameter or set as default in the shell (via Set-DefaultAWSRegion). Only specify this parameter if you must direct the call to a specific custom endpoint.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-NetworkCredential <PSCredential>
Used with SAML-based authentication when ProfileName references a SAML role profile. Contains the network credentials to be supplied during authentication with the configured identity provider's endpoint. This parameter is not required if the user's default network identity can or should be used during authentication.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-ProfileLocation <String>
Used to specify the name and location of the ini-format credential file (shared with the AWS CLI and other AWS SDKs)If this optional parameter is omitted this cmdlet will search the encrypted credential file used by the AWS SDK for .NET and AWS Toolkit for Visual Studio first. If the profile is not found then the cmdlet will search in the ini-format credential file at the default location: (user's home directory)\.aws\credentials.If this parameter is specified then this cmdlet will only search the ini-format credential file at the location given.As the current folder can vary in a shell or during script execution it is advised that you use specify a fully qualified path instead of a relative path.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAWSProfilesLocation, ProfilesLocation
-ProfileName <String>
The user-defined name of an AWS credentials or SAML-based role profile containing credential information. The profile is expected to be found in the secure credential file shared with the AWS SDK for .NET and AWS Toolkit for Visual Studio. You can also specify the name of a profile stored in the .ini-format credential file used with the AWS CLI and other AWS SDKs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesStoredCredentials, AWSProfileName
-Region <Object>
The system name of an AWS region or an AWSRegion instance. This governs the endpoint that will be used when calling service operations. Note that the AWS resources referenced in a call are usually region-specific.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesRegionToCall
-SecretKey <String>
The AWS secret key for the user account. This can be a temporary secret key if the corresponding session token is supplied to the -SessionToken parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesSK, SecretAccessKey
-SessionToken <String>
The session token if the access and secret keys are temporary session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesST

Outputs

This cmdlet returns an Amazon.StepFunctions.Model.CreateStateMachineResponse object containing multiple properties. The object can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack.

Supported Version

AWS Tools for PowerShell: 2.x.y.z