Skip to content

Commit

Permalink
use IService instead of BaseService
Browse files Browse the repository at this point in the history
  • Loading branch information
atsushi-ishibashi committed Feb 23, 2020
1 parent 9d11c4e commit 8be4b51
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface EcsDeployActionProps extends codepipeline.CommonAwsActionProps
/**
* The ECS Service to deploy.
*/
readonly service: ecs.BaseService;
readonly service: ecs.IService;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
},
},
};

Expand All @@ -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');
}

0 comments on commit 8be4b51

Please sign in to comment.