https://pulumi.com logo
Title
c

clean-oil-72875

10/16/2022, 1:48 AM
Hey, I have problem with update docker in ECS Fargate. I keep docker images in github registry, my fargate definitions
return new awsx.ecs.FargateService(`${getConfigValue(config, 'name')}-service`, {
        cluster: cluster,
        securityGroups: cluster.securityGroups,
        forceNewDeployment: true,
        assignPublicIp: false,
        taskDefinitionArgs: {
            containers: {
                migrations: {
                    image: containerImage,
                    essential: false,
                    memory: 512,
                    cpu: 1024,
                    environment: environment,
                    repositoryCredentials: {
                        credentialsParameter: credentialsParameter
                    },
                    command: [
                        'npm',
                        'run',
                        'migrate:deploy'
                    ]
                },
                seed: {
                    dependsOn: [ {
                        containerName: 'migrations',
                        condition: 'SUCCESS'
                    }],
                    image: containerImage,
                    essential: false,
                    memory: 512,
                    cpu: 1024,
                    environment: environment,
                    repositoryCredentials: {
                        credentialsParameter: credentialsParameter
                    },
                    command: [
                        'npm',
                        'run',
                        'prisma:seed'
                    ]
                },
                application: {
                    dependsOn: [ {
                        containerName: 'seed',
                        condition: 'SUCCESS'
                    }],
                    image: containerImage,
                    memory: parseInt(getConfigValue(config, 'aws-fargate-memory')),
                    cpu: parseInt(getConfigValue(config, 'aws-fargate-cpu')),
                    environment: environment,
                    portMappings: [ applicationListener ],
                    repositoryCredentials: {
                        credentialsParameter: credentialsParameter
                    },
                },
            },
            executionRole: createSercretCredientialsForGithubRegistry(config)
        },
        desiredCount: 1,
        deploymentMinimumHealthyPercent: 50,
        deploymentMaximumPercent: 200
    });
but, when i trying make "pulumi up" to deploy new service, pulumi dont do anything
Previewing update (xxxx)

View Live: ....

     Type                 Name                     Plan
     pulumi:pulumi:Stack  XXX-api-stage

Resources:
    77 unchanged

Do you want to perform this update?  [Use arrows to move, enter to select, type to filter]
  yes
> no
  details
e

echoing-dinner-19531

10/16/2022, 9:57 AM
Has
containerImage
changed?
c

clean-oil-72875

10/16/2022, 1:25 PM
https://docs.aws.amazon.com/cli/latest/reference/ecs/update-service.html
If your updated Docker image uses the same tag as what is in the existing task definition for your service (for example, my_image:latest ), you don't need to create a new revision of your task definition. You can update the service using the forceNewDeployment option. The new tasks launched by the deployment pull the current image/tag combination from your repository when they start.
b

billowy-army-68599

10/16/2022, 2:36 PM
@clean-oil-72875 that’s only applicable if you’re doing imperative actions. Pulumi is declarative, and as far as Pulumi is concerned, nothing has changed
c

clean-oil-72875

10/16/2022, 2:38 PM
i see, so the best solution would be fetch latest digest of docker image and set as containerImage?
b

billowy-army-68599

10/16/2022, 2:40 PM
yes exactly
c

clean-oil-72875

10/16/2022, 2:41 PM
pulumi has any adaption for working with ghcr packages?
b

billowy-army-68599

10/16/2022, 5:17 PM
what do you need exactly?