Skip to content

Commit eab8942

Browse files
authored
Merge pull request #5568 from ConnorKirk/add-codecommit-repository-to-cloudformation-package-command
Add CodeCommit Repository Resource to cloudformation package command
2 parents 9b940e8 + e6f1329 commit eab8942

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

awscli/customizations/cloudformation/artifact_exporter.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,20 @@ class GlueJobCommandScriptLocationResource(Resource):
506506
PROPERTY_NAME = "Command.ScriptLocation"
507507

508508

509+
class CodeCommitRepositoryS3Resource(ResourceWithS3UrlDict):
510+
"""
511+
Represents CodeCommit::Repository resource.
512+
"""
513+
RESOURCE_TYPE = "AWS::CodeCommit::Repository"
514+
PROPERTY_NAME = "Code.S3"
515+
BUCKET_NAME_PROPERTY = "Bucket"
516+
OBJECT_KEY_PROPERTY = "Key"
517+
VERSION_PROPERTY = "ObjectVersion"
518+
# Don't package the directory if S3 is omitted.
519+
PACKAGE_NULL_PROPERTY = False
520+
FORCE_ZIP = True
521+
522+
509523
RESOURCES_EXPORT_LIST = [
510524
ServerlessFunctionResource,
511525
ServerlessApiResource,
@@ -523,7 +537,8 @@ class GlueJobCommandScriptLocationResource(Resource):
523537
LambdaLayerVersionResource,
524538
GlueJobCommandScriptLocationResource,
525539
StepFunctionsStateMachineDefinitionResource,
526-
ServerlessStateMachineDefinitionResource
540+
ServerlessStateMachineDefinitionResource,
541+
CodeCommitRepositoryS3Resource
527542
]
528543

529544
METADATA_EXPORT_LIST = [

awscli/examples/cloudformation/_package_description.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ This command can upload local artifacts referenced in the following places:
2929
- ``Command.ScriptLocation`` property for the ``AWS::Glue::Job`` resource
3030
- ``DefinitionS3Location`` property for the ``AWS::StepFunctions::StateMachine`` resource
3131
- ``DefinitionUri`` property for the ``AWS::Serverless::StateMachine`` resource
32+
- ``S3`` property for the ``AWS::CodeCommit::Repository`` resource
3233

3334

3435
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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
AppSyncFunctionConfigurationResponseTemplateResource, \
2929
GlueJobCommandScriptLocationResource, \
3030
StepFunctionsStateMachineDefinitionResource, \
31-
ServerlessStateMachineDefinitionResource
31+
ServerlessStateMachineDefinitionResource, \
32+
CodeCommitRepositoryS3Resource
3233

3334

3435
VALID_CASES = [

0 commit comments

Comments
 (0)