StateMachine DefinitionUri doesn't accept local files
See original GitHub issueDescription:
Based on the official documentation the description of DefinitionUri is as follows:
DefinitionUri
The Amazon S3 URI or local file path of the state machine definition written in Amazon States Language.
If a local file path is provided, the template must go through the workflow that includes the sam deploy or sam package command, in order for the definition to be transformed properly.
One of Definition or DefinitionUri must be provided.
Type: String | S3Location
An example is even included:
MySampleStateMachine:
Type: AWS::Serverless::StateMachine
Properties:
DefinitionUri: statemachine/my_state_machine.asl.json
Role: arn:aws:iam::123456123456:role/service-role/my-sample-role
DefinitionSubstitutions:
MyFunctionArn: !GetAtt MyFunction.Arn
MyDDBTable: !Ref TransactionTable
However, local files do not seem to be actually supported (by brief look at the feature commits) and using it results in Resource is invalid. 'DefinitionUri' is not a valid S3 Uri of the form 's3://bucket/key' with optional versionId query parameter.
error message.
Having the StateMachine definition in a separate local file (possibly JSON definition and YML template) would be most useful, unlike linking separately uploaded S3 file.
Steps to reproduce the issue:
- Use
AWS::Serverless::StateMachine
resource. - Define a local path as it’s
DefinitionUri
.
Observed result: Resource is invalid. ‘DefinitionUri’ is not a valid S3 Uri of the form ‘s3://bucket/key’ with optional versionId query parameter.
Expected result: Successful deployment.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (2 by maintainers)
Ok
Type: AWS::StepFunctions::StateMachine
should beType: AWS::Serverless::StateMachine
.They are different. The first is the Cloudformation type, the second is the SAM type.
I don’t have this error any more. And it’s now an allowed key. Maybe it’s something else. I’m on the same SAM version 1.13.2 SAM CLI
https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-statemachine.html