diff --git a/awscli/customizations/cloudformation/artifact_exporter.py b/awscli/customizations/cloudformation/artifact_exporter.py index d385c435313b..d82535034783 100644 --- a/awscli/customizations/cloudformation/artifact_exporter.py +++ b/awscli/customizations/cloudformation/artifact_exporter.py @@ -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 @@ -513,7 +522,8 @@ class GlueJobCommandScriptLocationResource(Resource): ServerlessLayerVersionResource, LambdaLayerVersionResource, GlueJobCommandScriptLocationResource, - StepFunctionsStateMachineDefinitionResource + StepFunctionsStateMachineDefinitionResource, + ServerlessStateMachineDefinitionResource ] METADATA_EXPORT_LIST = [ diff --git a/awscli/examples/cloudformation/_package_description.rst b/awscli/examples/cloudformation/_package_description.rst index 30ff5971002b..fb119fc3d640 100644 --- a/awscli/examples/cloudformation/_package_description.rst +++ b/awscli/examples/cloudformation/_package_description.rst @@ -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, diff --git a/tests/unit/customizations/cloudformation/test_artifact_exporter.py b/tests/unit/customizations/cloudformation/test_artifact_exporter.py index 24ff54531c08..840e83ca7b4e 100644 --- a/tests/unit/customizations/cloudformation/test_artifact_exporter.py +++ b/tests/unit/customizations/cloudformation/test_artifact_exporter.py @@ -27,7 +27,8 @@ AppSyncFunctionConfigurationRequestTemplateResource, \ AppSyncFunctionConfigurationResponseTemplateResource, \ GlueJobCommandScriptLocationResource, \ - StepFunctionsStateMachineDefinitionResource + StepFunctionsStateMachineDefinitionResource, \ + ServerlessStateMachineDefinitionResource VALID_CASES = [ @@ -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" + } + }, ]