I have been attempting to create an EC2 instance in the default VPC and default subnet using Pulumi TypeScript, but unfortunately, I haven't had any success. In my script, I am trying to retrieve the default VPC ID and assign it as a string. However, I seem to be having trouble achieving this.
export const defaultvpc = new aws.ec2.DefaultVpc("default", {tags: {Name: "Default VPC",}}).id;
Although I am able to obtain the VPC ID in the 'defaultvpc' variable, I am struggling to use it as an argument in the 'getSubnetIds' function.
const subnetIds = aws.ec2.getSubnetIds({vpcId: defaultvpc})
If anyone has insights on how to successfully create an EC2 instance in the default VPC and default subnet, your assistance would be greatly appreciated.