【发布时间】:2022-01-02 05:35:48
【问题描述】:
我正在通过 AWS CDK 轻松部署 Fargate 服务。
现在我需要更新一个服务,例如一个任务图像。
我正在尝试通过使用 @aws-cdk/aws-codepipeline 和操作 EcsDeployAction
我正在尝试导入和更新现有(以前部署的)fargate 服务,如下所示:
const pipeline = new codepipeline.Pipeline(this, 'MyPipeline')
// import an existing fargate service
const fargateService = ecs.FargateService.fromFargateServiceArn(
this,
"FargateService",
"MyFargateServiceARN"
);
// Deploy a new version according to what
const sourceStage = this.pipeline.addStage({
stageName: 'Deploy',
actions: [
new codepipeline_actions.EcsDeployAction({
actionName: "ECS-Service",
service: fargateService, <--- here the typescript error
input: ...
})
]
})
但这似乎不正确,因为我收到了打字稿错误:
Property 'cluster' is missing in type 'IFargateService' but required in type 'IBaseService'
有什么想法吗?
【问题讨论】:
标签: typescript aws-cdk aws-codepipeline aws-fargate