Search code examples
dockeramazon-ecspulumi

Using image from private docker registry in pulumi on ECS


I want to use pulumi to set up ECS with an image from a private docker registry (GitLab). Is there a way to specify the secret in the container defintion?

I'm trying to set up a new ECS cluster (awsx.ecs.Cluster) with a Service (awsx.ecs.EC2Service) running a Task with a container (awsx.ecs.Container). The image for the container is stored in a Gitlab private docker registry.

In the AWS console I would've created a Task with a container and selected Private repository authentication. This allows setting an arn to a secret in secrets manager containing credentials as described in Private Registry Authentication for Tasks.

I haven't found a way to set this in pulumi though.


Solution

  • then you would need to do it like you normally would in kubernetes.

    Create a docker registry secret (set its type to kubernetes.io/dockerconfigjson) and make pod reference that secret, so add imagepullsecrets to pod spec.

    FOr more details consult the link I've referenced