Fargate - CDK - How to force new deployment

0

I use Fargate with CDK. I want the task to be updated when my source code changes, but it does not work.

Note: I can do it with cli, but I want to do it with cdk. Is there a known solution?

new ecrdeploy.ECRDeployment(this, `EcrDeployment`, {
      src: new ecrdeploy.DockerImageName(dockerImageAsset.imageUri),
      dest: new ecrdeploy.DockerImageName(
        `${accountId}.dkr.ecr.${region}.amazonaws.com/${ecrRepository.repositoryName}:latest`
   ),
});

const loadBalancedFargateService =
      new ecsPatterns.ApplicationLoadBalancedFargateService(
        this,
        `Example`,
        {
          cluster,
          memoryLimitMiB: 512,
          desiredCount: 1,
          cpu: 256,
          taskImageOptions: {
            containerPort: 3310,
            containerName: `container`,
            image: ecs.ContainerImage.fromEcrRepository(ecrRepository),
            environment: {
             ...
            },
          },
          taskSubnets: {
            subnets: props.vpc.privateSubnets,
          },
          loadBalancerName: `loadBalancer`,
          redirectHTTP: true,
          publicLoadBalancer: true,
          domainName: props.domainName,
          domainZone: hostedZone,
          certificate: certificate,
          assignPublicIp: true,
          circuitBreaker: {
            rollback: true,
          },
        }
      );
已提问 5 个月前179 查看次数
没有答案

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则