Skip to content

Commit

Permalink
Merge pull request #5576 from joel-aws/package-serverless-states-defi…
Browse files Browse the repository at this point in the history
…nitionuri

Add AWS::Serverless::StateMachine resource to cloudformation package command
  • Loading branch information
justindho authored May 31, 2022
2 parents 23e4b4f + 042929e commit 9b940e8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
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

0 comments on commit 9b940e8

Please sign in to comment.