I am trying to create an EC2 instance from a custom vpc. I have vpc as Output. But i want to assign to string. Would appreciate help in this context.
Option 1:
const vpcId = args.network.vpc.id.apply(id => id); //type Output<string>; network extends awsx:Vpc
const mySubnet = aws.ec2.gtSubnet({
availabilityZone: 'ap-southeast-2a',
filters: [
{ name: "tag:Name", values: ["*private-0"]}
],
vpcId: vpcId; //Error: Type 'Output<string>' is not assignable to type 'string'
});
this.vm = new aws.ec2.Instance("ec2Instance", {
ami: amiId,
instanceType: instanceClass,
networkInterfaces: [{
networkInterfaceId: networkInterface.id,
deviceIndex: 0,
}]
});
Option 2:
const sg = new awsx.ec2.SecurityGroup("webserver-sg", { vpc }); //Here again I need vpcid string in the SecurityGroupArgs