quiet-football-73782
01/17/2024, 8:06 PMsecurity_group = ec2.SecurityGroup(f'dbSecurityGroup',
description=f'Enable MySQL access.',
ingress=ingress_rules)
...
db_instance = rds.Instance("database",
...,
vpc_security_group_ids=[security_group.id])
And that in practice works fine.
But I am structuring my project with a bunch of services and each has its own script.
So I would like to directly refer the securityGroupId from within the rds script, without passing it as an argument when calling such script.
The only option to retrieve that id I found so far is to access the StackReference, which seems a bit odd, as I am already on that stack.
security_group_id = pulumi.StackReference(".../.../...").get_output("securityGroupId")
(☝️ also works fine)
Is there a way to directly access it without using stackreference?
pulumi.get_stack() does not have an get output module, and I couldn't find anything that would work as such.
Thank youquiet-football-73782
01/17/2024, 8:43 PM