From 8be4b51c221559fe019b94a0ea9e77cbe6d202e0 Mon Sep 17 00:00:00 2001 From: Atsushi Ishibashi Date: Mon, 24 Feb 2020 01:32:12 +0900 Subject: [PATCH] use IService instead of BaseService --- .../lib/ecs/deploy-action.ts | 2 +- .../test/ecs/test.ecs-deploy-action.ts | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) 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 245764f12bb56..aaf4d8b8f956b 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 @@ -39,7 +39,7 @@ export interface EcsDeployActionProps extends codepipeline.CommonAwsActionProps /** * The ECS Service to deploy. */ - readonly service: ecs.BaseService; + readonly service: ecs.IService; } /** 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 89902677ed82d..1a39e43ce07b0 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 @@ -80,6 +80,21 @@ export = { test.done(); }, + + 'can be created just by serviceArn'(test: Test) { + const service = anyIService(); + const artifact = new codepipeline.Artifact('Artifact'); + + test.doesNotThrow(() => { + new cpactions.EcsDeployAction({ + actionName: 'ECS', + service, + imageFile: artifact.atPath('imageFile.json'), + }); + }); + + test.done(); + }, }, }; @@ -98,3 +113,8 @@ function anyEcsService(): ecs.FargateService { taskDefinition, }); } + +function anyIService(): ecs.IService { + const stack = new cdk.Stack(); + return ecs.FargateService.fromFargateServiceArn(stack, 'FargateService', 'serviceArn'); +}