https://pulumi.com logo
#general
Title
# general
a

agreeable-refrigerator-25320

06/13/2019, 2:17 PM
Hi guys, someone knows how to deploy an existent ecr image to a new fargate instance using pulumi typescript
j

jolly-egg-4894

06/13/2019, 2:50 PM
Something along the lines of:
Copy code
const cloud = require("@pulumi/cloud");

let service = new cloud.Service("pulumi-nginx", {
    containers: {
        nginx: {
            image: "ecr_image_address_stuff",
            memory: 128,
            ports: [{ port: 80 }],
        },
    },
    replicas: 2,
});

// export just the hostname property of the container frontend
exports.url = service.defaultEndpoint.apply(e => `http://${e.hostname}`);
idk what else you need to do to give it permissions to access the ecr image I’d have to look into it further
p

proud-alarm-92546

06/13/2019, 3:03 PM
the big thing I discovered is that
image:
must be the full url (for ecr) -
<http://ecr.host.name/imagename:version|ecr.host.name/imagename:version>
so like
<http://111251075479.dkr.ecr.us-east-1.amazonaws.com/test-service2-ecr-015ef0d:latest|111251075479.dkr.ecr.us-east-1.amazonaws.com/test-service2-ecr-015ef0d:latest>
(if you don't make it latest, it'll stick to a single version...so you'd have to recreate the TD each time you deploy...)
(sorry for the delay, got sucked into another meeting)
a

agreeable-refrigerator-25320

06/13/2019, 3:19 PM
thanks a lot guys i will give it a try