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,
          },
        }
      );
Keine Antworten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen