https://pulumi.com logo
#general
Title
# general
f

full-dress-10026

09/24/2018, 10:57 PM
I was able to get the VPC id by doing this:
Copy code
let serviceSubnets = service.ecsService.networkConfiguration.apply(o => {
    if (o != null) {
        return o["subnets"];
    } else {
        throw new Error("No network configuration present on service. Cannot proceed.");
    }
});
let serviceFirstSubnet = serviceSubnets.apply(subnets => subnets[0]);
let serviceVpcId = aws.ec2.Subnet.get("subnet", serviceFirstSubnet).vpcId;
There must be a cleaner way to do this.