From f2293e03579b6d30e84e1052bd12dae2c1189795 Mon Sep 17 00:00:00 2001 From: Sami Kukkonen Date: Thu, 27 Jun 2019 16:40:07 +0300 Subject: [PATCH] fix(codepipeline-actions): set service as backing resource for EcsDeployAction (#3085) --- .../lib/ecs/deploy-action.ts | 1 + .../test/ecs/test.ecs-deploy-action.ts | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/ecs/deploy-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/ecs/deploy-action.ts index e8bd9a5bd12c0..70d4133af48f8 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/ecs/deploy-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/ecs/deploy-action.ts @@ -55,6 +55,7 @@ export class EcsDeployAction extends Action { provider: 'ECS', artifactBounds: deployArtifactBounds(), inputs: [determineInputArtifact(props)], + resource: props.service }); this.props = props; diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/ecs/test.ecs-deploy-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/ecs/test.ecs-deploy-action.ts index c668283c225b3..14ce73faf75d7 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/ecs/test.ecs-deploy-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/ecs/test.ecs-deploy-action.ts @@ -65,6 +65,21 @@ export = { test.done(); }, + + "sets the target service as the action's backing resource"(test: Test) { + const service = anyEcsService(); + const artifact = new codepipeline.Artifact('Artifact'); + + const action = new cpactions.EcsDeployAction({ + actionName: 'ECS', + service, + input: artifact + }); + + test.equal(action.actionProperties.resource, service); + + test.done(); + }, }, };