Hi Team, I am looking for sample code - working on...
# aws
r
Hi Team, I am looking for sample code - working on selfservice-flatform application folder structure 1. vpc.py - creates vpc, route tables, subnets, security groups, nat gateway, Internetgateway. (this created as it is one time setup) 2. ec2.py. - Team creates ec2 instances when ever required from UI, challenge - how can i get VPC id in ec2.py file
g
Is this with the automation API (I'm assuming you're working from something like https://github.com/komalali/self-service-platyform based on your description)?
r
Thank you for responding, Correct. virtual_machines.py. - while creating ec2 instance subnet are not mentioned, but my use case i want to created in specified VPC, not in default VPC.
g
Gotcha. That example uses an inline program (in the
create_pulumi_program()
function), so you'd add the subnet as you would in any Pulumi program. For an example of what that would look like in a standard Pulumi program, try https://github.com/pulumi/examples/blob/master/aws-py-eks/vpc.py
r
Thank you
👍 1