Hello. I created an elastic load balancer in python code. Now I imported such resource in another pulumi project with
opts=ResourceOptions(
import_= ....arn.....
)
Now I want to add a new created security group to the imported load balancer. How to do this ?....thanks so much
Hi Florian and thanks very much for your reply.
The overall scenario is as follows:
I have an ECS cluster and an ALB load balancer created with a pulumi stack for a microservice deployment.
Next we developed a new microservice with it's own code repository. My goal is to use the ALB and ECS already deployed with the first pulumi stack. Using remote stack reference I'm able to get reference for these existing resources but I'm a little struggle on how to set properties for them in the new pulumi stack. I.E. I want to add an security group to the existing ALB and a new task definition and service to the existing ECS. I prefer to continue manage the ALB and ECS resources with the first pulumi stack, the one that in origin created them along with the first microservice.
Is what I ask for doable ? or my overall design is wrong ?
Apologize for my poor experience on the matter....and thanks very much for your kindly support.
q
quick-house-41860
11/12/2024, 6:36 PM
If you wanna re-use the ALB and ECS cluster for multiple services I'd recommend moving those resources to their own stack.
Managing a single resource in multiple stacks is gonna be complex (you'll need to ignore the mutually exclusive changes in each repo) and will introduce tight coupling.
I'd recommend adding a single security group to the ALB in this central stack and exporting the security group ID.
In the application stacks you can import the ALB security group ID with cross stack references and then add the necessary security group rules for your applications.
r
rapid-keyboard-69273
11/12/2024, 6:40 PM
Clear. Thanks very much, Florian.
Kindly regards
Francesco