hundreds-yacht-71603
01/09/2023, 6:42 PMminiature-musician-31262
01/09/2023, 6:46 PMhundreds-yacht-71603
01/09/2023, 6:49 PM// Note: Some resources are not yet supported by the Native AWS provider, so we are using both the Native
// and Classic provider in this example. The resources will be updated to use native resources as they are
// available in AWS's Cloud Control API.
const defaultVpc = aws.ec2.getVpcOutput({default: true});
const defaultVpcSubnets = aws.ec2.getSubnetIdsOutput({vpcId: defaultVpc.id});
miniature-musician-31262
01/09/2023, 7:05 PMhundreds-yacht-71603
01/09/2023, 7:08 PMlookupVpcArgs := &ec2.LookupVPCArgs{
VpcId: *pulumi.StringRef("vpc-0b966da8f364dfd1b"),
}
vpc, err := ec2.LookupVPC(ctx, lookupVpcArgs, nil)
if err != nil {
return nil, err
}
log.Printf("vpc: %v", spew.Sprint(vpc))
return nil, fmt.Errorf("I made a booboo!")
miniature-musician-31262
01/09/2023, 8:51 PMvpc, err := ec2.LookupVPC(ctx, &ec2.LookupVPCArgs{
VpcId: *pulumi.StringRef("vpc-abc123"),
})
if err != nil {
return err
}
<http://ctx.Log.Info|ctx.Log.Info>(*vpc.VpcId, &pulumi.LogArgs{})
for i := 0; i < len(vpc.CidrBlockAssociations); i++ {
<http://ctx.Log.Info|ctx.Log.Info>(vpc.CidrBlockAssociations[i], &pulumi.LogArgs{})
}