https://pulumi.com logo
#aws
Title
# aws
b

bland-painting-33593

01/23/2024, 5:53 PM
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

salmon-account-74572

01/23/2024, 6:05 PM
b

bland-painting-33593

01/23/2024, 6:07 PM
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

salmon-account-74572

01/23/2024, 6:44 PM
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

bland-painting-33593

01/23/2024, 6:46 PM
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

polite-summer-21990

01/24/2024, 8:19 AM
How are you handling the image uploads to ECR? Can you provide a link to an example that does that?
b

bland-painting-33593

01/24/2024, 2:56 PM
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

polite-summer-21990

01/24/2024, 6:34 PM
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

bland-painting-33593

01/24/2024, 6:37 PM
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