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(); + }, }, };