AWS CDK EcsDeployAction ปรับปรุงที่มีอยู่ Fargate บริการ

0

คำถาม

ฉัน deployng Fargate การบริการผ่า AWS CDK บอย่างง่ายดาย

ตอนนี้ฉันต้องการจะปรับปรุงบริการสำหรับตัวอย่างเป็นงานของภาพ.
-ลอตโซ่มีบางอพยายามจะย่อมทำเรื่องนี้โดยใช้@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: ...
    })
  ]
})

แต่มันไม่ดูเหมือนถูกต้องเพราะผมได้รับ typescript เกิดข้อผิดพลาด:

Property 'cluster' is missing in type 'IFargateService' but required in type 'IBaseService'

รู้บ้างมั้ย?

1

คำตอบที่ดีที่สุด

1

นั่นเป็นประเภท mismatch. EcsDeployActionProps หวังว่าการอุปกรณ์ประกอบที่ เป็นของประเภท IBaseService. แต่มันเริ่มการทำงานเข้ากันไม่ IFargateService จากประเภท fromFargateServiceArn.

โชคดีที่เกี่ยวข้องกัน ในรูปของไฟฟ้าสถิตย์ fromFargateServiceAttributes(ขอบเขตบัตรประชาชน attrs) จะคืนค่ากลับมาเป็นได้พูดถึงประเด็นสำคัญประเภท IBaseService คุณกำลังมองหาอยู่

2021-11-23 20:59:21

ขอบคุณ ฉันจะลองวิธีให้แน่ใจว่ามันจะได้ผล
andreav

ในภาษาอื่นๆ

หน้านี้อยู่ในภาษาอื่นๆ

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

ดังอยู่ในนี้หมวดหมู่

ดังคำถามอยู่ในนี้หมวดหมู่