https://pulumi.com logo
b

billions-lock-73409

03/27/2019, 3:51 PM
Any way to get the URI for a ECR image if it was created with
awsx.ecs.Image.fromDockerBuild
?
l

lemon-spoon-91807

03/27/2019, 4:58 PM
Let me see!
So, unless i'm confusing something. Here's what should work.
It's not elegant, but it's worth trying
bbiab
ok. sorry about that
so, you should be able to do something like this:
Copy code
const image = awsx.ecs.Image.fromDockerBuild(...);
const service = new awsx.ecs.FargateService(..., { image: image, ... });
const uri = image.image("", undefined);
that will give you an
Input<string>
which should be hte uri.
👍 1
b

billions-lock-73409

03/27/2019, 6:16 PM
Okay I’ll give it a shot, thanks!
l

lemon-spoon-91807

03/27/2019, 6:17 PM
it's basically the full image-id. but my undrstanding is that's the ECR uri as well...
b

billions-lock-73409

03/27/2019, 6:18 PM
gotcha, okay
l

lemon-spoon-91807

03/27/2019, 6:18 PM
or, at least, it will have the uri, along with possibly tag information as well, since it will be the unique image name.
b

billions-lock-73409

03/27/2019, 6:26 PM
Yeah looks like it has the URI and tag together, I’ll have to split it up and turn it into an ARN
l

lemon-spoon-91807

03/27/2019, 7:15 PM
is that ok?
we can try to expose the ECR if it's really critical
b

billions-lock-73409

03/28/2019, 1:47 PM
It seems a little convoluted to have to access it like that, but I understand the awsx library is supposed to be more opinionated, but some of the other AWSX resources do expose ARNs as an output
2 Views