AWS CDK EcsDeployAction 업데이트로 기존 Fargate 서비스

0

질문

나 deployng Fargate 서비스를 통해 AWS CDK 습니다.

지금 내가 필요로하는 서비스를 업데이트,인스턴스에 대한 작업은 이미지입니다.
I'm 하려고 사용하여 이 작업을 수행@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'

어떤 생각이 있으십니까?

1

최고의 응답

1

유형이 있 불일치가 발생할 수 있습니다. EcsDeployActionProps 기대하는 서비스 prop 의 유형 IBaseService. 하지만 그것을 얻기 호환되지 않는 IFargateService 에서 유형 fromFargateServiceArn.

다행히도,관련 정 fromFargateServiceAttributes(범위,id,attrs) 반환한 호환 유형 IBaseService 찾고 있습니다.

2021-11-23 20:59:21

감사합니다. 나는 이 방법을 시도한다.
andreav

다른 언어로

이 페이지는 다른 언어로되어 있습니다

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................