Hi everyone :slightly_smiling_face: I have a quest...
# general
Hi everyone 🙂 I have a question regarding the ECR. Assuming that I have a repository that sets up the infrastructure (including the aws ECR), how can I now create and push images to it from a different repo. I was looking at the
which has a function
but it does not allow a lot of configuration for the image. What is the standard for creating images and pushing them to an ECR. Appreciate if someone can point me in the right direction 🙂
if possible without the docker cli 😄
can do what you want - it does require the docker cli to be installed on the machine but you don't have to run the cli yourself https://www.pulumi.com/docs/reference/pkg/docker/image/
yeah awsx is pretty opinionated which can be fine sometimes, but if you want to do it yourself you're better off just using the base aws and docker resources directly
and i only have a c# example to give, but here is how you can create an AWS ECR repo and obtain credentials to pass to the pulumi.Docker.Image resource:
Copy code
var ecrRepo = new Pulumi.Aws.Ecr.Repository(...)

var ecrCreds = ecrRepo.RegistryId.Apply(registryId => Pulumi.Aws.Ecr.GetCredentials.InvokeAsync(
    new PulumiAws.Ecr.GetCredentialsArgs
        RegistryId = registryId,

var registry = ecrCreds.Apply(creds =>
    var decodedCredentials = Encoding.UTF8.GetString(Convert.FromBase64String(creds.AuthorizationToken)).Split(':');
    return new Pulumi.Docker.ImageRegistry
        Server = creds.ProxyEndpoint,
        Username = decodedCredentials[0],
        Password = decodedCredentials[1],

var dockerImage = new Pulumi.Docker.Image("image", new Pulumi.Docker.ImageArgs
    ImageName = Output.Format($"{ecrRepo.RepositoryUrl}:{your-tag-or-build-id}"),
    Registry = registry,
    Build = dockerContext (path to dockerfile or other options)
then you can stick
in your ECS task definition
re-reading your original question, it looks like you are creating the ECR Repo in a different process - so you might just need to modify what i have above to take in the ECR registry id / arn as an input or something and start from there
Hey @bumpy-grass-54508 thanks a lot for the answer. It looks like what I'd like to do yes. The only difference i see is that i need to export the
from the repository creating the ecrs. Then use that to get the credentials i guess
no problem! and yeah that should do the trick 👍