Skip to content

Commit 042929e

Browse files
joel-awsjustindho
authored andcommitted
Support exporting DefinitionUri in AWS::Serverless::StateMachine resource
1 parent 23e4b4f commit 042929e

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

awscli/customizations/cloudformation/artifact_exporter.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,15 @@ class StepFunctionsStateMachineDefinitionResource(ResourceWithS3UrlDict):
426426
PACKAGE_NULL_PROPERTY = False
427427

428428

429+
class ServerlessStateMachineDefinitionResource(ResourceWithS3UrlDict):
430+
RESOURCE_TYPE = "AWS::Serverless::StateMachine"
431+
PROPERTY_NAME = "DefinitionUri"
432+
BUCKET_NAME_PROPERTY = "Bucket"
433+
OBJECT_KEY_PROPERTY = "Key"
434+
VERSION_PROPERTY = "Version"
435+
PACKAGE_NULL_PROPERTY = False
436+
437+
429438
class CloudFormationStackResource(Resource):
430439
"""
431440
Represents CloudFormation::Stack resource that can refer to a nested
@@ -513,7 +522,8 @@ class GlueJobCommandScriptLocationResource(Resource):
513522
ServerlessLayerVersionResource,
514523
LambdaLayerVersionResource,
515524
GlueJobCommandScriptLocationResource,
516-
StepFunctionsStateMachineDefinitionResource
525+
StepFunctionsStateMachineDefinitionResource,
526+
ServerlessStateMachineDefinitionResource
517527
]
518528

519529
METADATA_EXPORT_LIST = [

awscli/examples/cloudformation/_package_description.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ This command can upload local artifacts referenced in the following places:
2828
- ``TemplateURL`` property for the ``AWS::CloudFormation::Stack`` resource
2929
- ``Command.ScriptLocation`` property for the ``AWS::Glue::Job`` resource
3030
- ``DefinitionS3Location`` property for the ``AWS::StepFunctions::StateMachine`` resource
31+
- ``DefinitionUri`` property for the ``AWS::Serverless::StateMachine`` resource
3132

3233

3334
To specify a local artifact in your template, specify a path to a local file or folder,

tests/unit/customizations/cloudformation/test_artifact_exporter.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
AppSyncFunctionConfigurationRequestTemplateResource, \
2828
AppSyncFunctionConfigurationResponseTemplateResource, \
2929
GlueJobCommandScriptLocationResource, \
30-
StepFunctionsStateMachineDefinitionResource
30+
StepFunctionsStateMachineDefinitionResource, \
31+
ServerlessStateMachineDefinitionResource
3132

3233

3334
VALID_CASES = [
@@ -159,6 +160,12 @@ def test_is_invalid_s3_url(url):
159160
"Bucket": "foo", "Key": "bar", "Version": "baz"
160161
}
161162
},
163+
{
164+
"class": ServerlessStateMachineDefinitionResource,
165+
"expected_result": {
166+
"Bucket": "foo", "Key": "bar", "Version": "baz"
167+
}
168+
},
162169
]
163170

164171

0 commit comments

Comments
 (0)