1. Packages
  2. CloudAMQP
  3. API Docs
  4. getAccountVpcs
CloudAMQP v3.16.0 published on Wednesday, Sep 27, 2023 by Pulumi

cloudamqp.getAccountVpcs

Explore with Pulumi AI

cloudamqp logo
CloudAMQP v3.16.0 published on Wednesday, Sep 27, 2023 by Pulumi

    Use this data source to retrieve basic information about all standalone VPCs available for an account. Uses the included apikey in provider configuration to determine which account to read from.

    Attributes reference

    All attributes reference are computed

    • id - The identifier for this data source. Set to na since there is no unique identifier.
    • vpcs - An array of VPCs. Each vpcs block consists of the fields documented below.

    The vpcs block consist of

    • id - The VPC identifier.
    • name - The VPC instance name.
    • region - The region the VPC is hosted in.
    • subnet - The VPC subnet.
    • tags - Optional tags set for the VPC.
    • vpc_name - VPC name given when hosted at the cloud provider.

    Dependency

    This data source depends on apikey set in the provider configuration.

    Example Usage

    Can be used in other resources/data sources when the VPC identifier is unknown, while other attributes are known. E.g. find correct VPC using the

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using CloudAmqp = Pulumi.CloudAmqp;
    
    return await Deployment.RunAsync(() => 
    {
        var myVpcName = "<your VPC name>";
    
        var vpcList = CloudAmqp.GetAccountVpcs.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["vpcId"] = .Where(vpc => vpc.Name == myVpcName).Select(vpc => 
            {
                return vpc;
            }).ToList()[0].Id,
        };
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-cloudamqp/sdk/v3/go/cloudamqp"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		myVpcName := "<your VPC name>"
    		vpcList, err := cloudamqp.GetAccountVpcs(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("vpcId", "TODO: For expression"[0].Id)
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_cloudamqp as cloudamqp
    
    my_vpc_name = "<your VPC name>"
    vpc_list = cloudamqp.get_account_vpcs()
    pulumi.export("vpcId", [vpc for vpc in vpc_list.vpcs if vpc.name == my_vpc_name][0].id)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as cloudamqp from "@pulumi/cloudamqp";
    
    const myVpcName = "<your VPC name>";
    const vpcList = cloudamqp.getAccountVpcs({});
    export const vpcId = vpcList.then(vpcList => .filter(vpc => vpc.name == myVpcName).map(vpc => (vpc))[0].id);
    

    Coming soon!

    Using getAccountVpcs

    function getAccountVpcs(opts?: InvokeOptions): Promise<GetAccountVpcsResult>
    def get_account_vpcs(opts: Optional[InvokeOptions] = None) -> GetAccountVpcsResult
    func GetAccountVpcs(ctx *Context, opts ...InvokeOption) (*GetAccountVpcsResult, error)

    > Note: This function is named GetAccountVpcs in the Go SDK.

    public static class GetAccountVpcs 
    {
        public static Task<GetAccountVpcsResult> InvokeAsync(InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAccountVpcsResult> getAccountVpcs(InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: cloudamqp:index/getAccountVpcs:getAccountVpcs
      arguments:
        # arguments dictionary

    getAccountVpcs Result

    The following output properties are available:

    Id string

    The provider-assigned unique ID for this managed resource.

    Vpcs List<Pulumi.CloudAmqp.Outputs.GetAccountVpcsVpc>
    Id string

    The provider-assigned unique ID for this managed resource.

    Vpcs []GetAccountVpcsVpc
    id String

    The provider-assigned unique ID for this managed resource.

    vpcs List<GetAccountVpcsVpc>
    id string

    The provider-assigned unique ID for this managed resource.

    vpcs GetAccountVpcsVpc[]
    id str

    The provider-assigned unique ID for this managed resource.

    vpcs Sequence[GetAccountVpcsVpc]
    id String

    The provider-assigned unique ID for this managed resource.

    vpcs List<Property Map>

    Supporting Types

    GetAccountVpcsVpc

    Id int
    Name string
    Region string
    Subnet string
    VpcName string
    Tags List<string>
    Id int
    Name string
    Region string
    Subnet string
    VpcName string
    Tags []string
    id Integer
    name String
    region String
    subnet String
    vpcName String
    tags List<String>
    id number
    name string
    region string
    subnet string
    vpcName string
    tags string[]
    id int
    name str
    region str
    subnet str
    vpc_name str
    tags Sequence[str]
    id Number
    name String
    region String
    subnet String
    vpcName String
    tags List<String>

    Package Details

    Repository
    CloudAMQP pulumi/pulumi-cloudamqp
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the cloudamqp Terraform Provider.

    cloudamqp logo
    CloudAMQP v3.16.0 published on Wednesday, Sep 27, 2023 by Pulumi