Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create Lambda in CloudFormation with unknown ImageUri property

I'm building my infrastructure on AWS with CLoudFormation and I want to create a Lambda Function that pull the code image from ECR. So I added to my CloudFormation template one Lambda resource depending on a ECR repository resource. The problem is that Lambda template requires the "imageUri" properties, but actually I don't know it because the image does not exists and the ECR repository is not created yet.

Should I first create an ECR and push the image and only then edit the whole CLoudformation template adding the Lambda resource?

Honestly I don't like this approach since I prefer my whole infrastructure would be built before any software work.

like image 457
mostr Avatar asked Sep 15 '26 14:09

mostr


1 Answers

No, it's not possible. The best you could get is to build a 'hello world' type container and use that in the lambda. You can then update the lambda when you've written the real thing.

like image 119
matt helliwell Avatar answered Sep 17 '26 17:09

matt helliwell