Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion awscli/customizations/cloudformation/artifact_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,15 @@ class StepFunctionsStateMachineDefinitionResource(ResourceWithS3UrlDict):
PACKAGE_NULL_PROPERTY = False


class ServerlessStateMachineDefinitionResource(ResourceWithS3UrlDict):
RESOURCE_TYPE = "AWS::Serverless::StateMachine"
PROPERTY_NAME = "DefinitionUri"
BUCKET_NAME_PROPERTY = "Bucket"
OBJECT_KEY_PROPERTY = "Key"
VERSION_PROPERTY = "Version"
PACKAGE_NULL_PROPERTY = False


class CloudFormationStackResource(Resource):
"""
Represents CloudFormation::Stack resource that can refer to a nested
Expand Down Expand Up @@ -513,7 +522,8 @@ class GlueJobCommandScriptLocationResource(Resource):
ServerlessLayerVersionResource,
LambdaLayerVersionResource,
GlueJobCommandScriptLocationResource,
StepFunctionsStateMachineDefinitionResource
StepFunctionsStateMachineDefinitionResource,
ServerlessStateMachineDefinitionResource
]

METADATA_EXPORT_LIST = [
Expand Down
1 change: 1 addition & 0 deletions awscli/examples/cloudformation/_package_description.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ This command can upload local artifacts referenced in the following places:
- ``TemplateURL`` property for the ``AWS::CloudFormation::Stack`` resource
- ``Command.ScriptLocation`` property for the ``AWS::Glue::Job`` resource
- ``DefinitionS3Location`` property for the ``AWS::StepFunctions::StateMachine`` resource
- ``DefinitionUri`` property for the ``AWS::Serverless::StateMachine`` resource


To specify a local artifact in your template, specify a path to a local file or folder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
AppSyncFunctionConfigurationRequestTemplateResource, \
AppSyncFunctionConfigurationResponseTemplateResource, \
GlueJobCommandScriptLocationResource, \
StepFunctionsStateMachineDefinitionResource
StepFunctionsStateMachineDefinitionResource, \
ServerlessStateMachineDefinitionResource


VALID_CASES = [
Expand Down Expand Up @@ -159,6 +160,12 @@ def test_is_invalid_s3_url(url):
"Bucket": "foo", "Key": "bar", "Version": "baz"
}
},
{
"class": ServerlessStateMachineDefinitionResource,
"expected_result": {
"Bucket": "foo", "Key": "bar", "Version": "baz"
}
},
]


Expand Down