All of the ECS examples involve creating a new ECR...
# aws
b
All of the ECS examples involve creating a new ECR repository and a new image, with things like const image = new awsx.ecr.Image. What is the best way to set a constant to an existing image that's already in ECR from our existing dev pipelines? Is there an example of that I'm just missing?
Do I just do const imageURI = 'uri:xxx'?
s
b
oh! Perfect. We use a lot of Parameters from Parameter store. Is there a good example of pulling those into the task definition? I am searching around for "ValueFrom" and see where support was merged in, but also failing to find an example
Actually, it feels like everything is fairly different between aws and awsx and aws-native in regard to task definitions. The pulumi new created a mix of aws and awsx. Which is preferred for doing a detailed, complex Fargate task definition? It looks like just pushing the task definition inside of the new awsx.ecs.FargateService is a bit messy, versus just first invoking a new taskdefinition constant...but the awsx docs don't have an example of doing that, only the aws ones.
s
Generally speaking, you can mix-and-match between AWS (Classic) and AWSX. AWS will give you greater flexibility at the cost of some additional complexity, whereas AWSX attempts to provide constructs for the most frequently used configurations. Only you can say if the AWSX configuration will suit your particular requirements. 🙂 Based on what you're saying, I'd probably go with AWS for your task definition, but that's just me.
b
Hmm, ok. It's interesting that awsx has a Fargate-specific task definition endpoint. I did find one example from a cached AI response here. I'm trying to follow that: https://www.pulumi.com/ai/answers/7c544b70-7139-4004-ac49-6dd2f11eb174
p
How are you handling the image uploads to ECR? Can you provide a link to an example that does that?
b
We're in the process of going from bespoke console-built systems to IaC, so as of right now, our Bitbucket Pipelines test, build, and upload the image directly to ECR, so I only need Pulumi to build the infrastructure that uses that image
All of those pipelines are long-established and not changing anytime soon 😉
But here's the relevant part of our pipeline :)
p
ah okay!
I also didn't find a sane way for this... so I had to roll my own shell glue 😞
using terraform_data 😞
b
Gotcha. Yeah, Dev has been pushing to ECR for a while now, so I'm just adapting the infrastructure to use that for now. There are some examples out there for Pulumi to have the /app in a subdirectory under the pulumi code and then have pulumi up do it, but we're not there