// fargate
const ecsService = new patterns.ApplicationLoadBalancedFargateService(this, 'Service', {
cluster: cluster, // Required
publicLoadBalancer: true,
taskImageOptions: {
image: ecs.ContainerImage.fromRegistry('nginx')
}
});
// codepipeline artifact
const sourceOutput = new codepipeline.Artifact();
// pipeline
const pipeline = new codepipeline.Pipeline(this, 'Pipeline');
// pipeline stage: Source
pipeline.addStage({
stageName: 'Source',
actions: [
new codepipeline_actions.EcrSourceAction({
actionName: 'ecr_push',
repository: repository,
output: sourceOutput
})
]
});
// pipeline stage: Deploy
pipeline.addStage({
stageName: 'Deploy',
actions: [
new codepipeline_actions.EcsDeployAction({
actionName: 'Deploy',
input: sourceOutput,
service: ecsService
})
]
});使用patterns ApplicationLoadBalancedFargateService创建fagate服务
但是,codepipeline_actions EcsDeployAction props service required type ecs.BaseService
如何解决这个问题?返回到从scrath构建fargae服务?
任何建议都将不胜感激!
发布于 2020-06-13 15:15:54
ApplicationLoadBalancedFargateService更高级别的模式有一个在实例上公开的service属性。ecsService.service的类型是实现IBaseService接口的FargateService。如果您将代码更改为:
pipeline.addStage({
stageName: 'Deploy',
actions: [
new codepipeline_actions.EcsDeployAction({
actionName: 'Deploy',
input: sourceOutput,
service: ecsService.service, // <-
})
]
});https://stackoverflow.com/questions/58848332
复制相似问题