1. Packages
  2. Cloudamqp Provider
  3. API Docs
  4. getAccountVpcs
CloudAMQP v3.21.0 published on Tuesday, Apr 8, 2025 by Pulumi

cloudamqp.getAccountVpcs

Explore with Pulumi AI

cloudamqp logo
CloudAMQP v3.21.0 published on Tuesday, Apr 8, 2025 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.

    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 name you gave your VPC. Then iterate over VPCs to find the matching one and extract the VPC identifier.

    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);
    
    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)
    
    Coming soon!
    
    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,
        };
    });
    
    Coming soon!
    
    Coming soon!
    

    Dependency

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

    Using getAccountVpcs

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

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

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

    public static class GetAccountVpcs 
    {
        public static Task<GetAccountVpcsResult> InvokeAsync(InvokeOptions? opts = null)
        public static Output<GetAccountVpcsResult> Invoke(InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAccountVpcsResult> getAccountVpcs(InvokeOptions options)
    public static Output<GetAccountVpcsResult> getAccountVpcs(InvokeOptions options)
    
    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>
    An array of VPCs. Each vpcs block consists of the fields documented below.
    Id string
    The provider-assigned unique ID for this managed resource.
    Vpcs []GetAccountVpcsVpc
    An array of VPCs. Each vpcs block consists of the fields documented below.
    id String
    The provider-assigned unique ID for this managed resource.
    vpcs List<GetAccountVpcsVpc>
    An array of VPCs. Each vpcs block consists of the fields documented below.
    id string
    The provider-assigned unique ID for this managed resource.
    vpcs GetAccountVpcsVpc[]
    An array of VPCs. Each vpcs block consists of the fields documented below.
    id str
    The provider-assigned unique ID for this managed resource.
    vpcs Sequence[GetAccountVpcsVpc]
    An array of VPCs. Each vpcs block consists of the fields documented below.
    id String
    The provider-assigned unique ID for this managed resource.
    vpcs List<Property Map>
    An array of VPCs. Each vpcs block consists of the fields documented below.

    Supporting Types

    GetAccountVpcsVpc

    Id int
    The VPC identifier.
    Name string
    The VPC instance name.
    Region string
    The region the VPC is hosted in.
    Subnet string
    The VPC subnet.
    VpcName string
    VPC name given when hosted at the cloud provider.
    Tags List<string>
    Optional tags set for the VPC.
    Id int
    The VPC identifier.
    Name string
    The VPC instance name.
    Region string
    The region the VPC is hosted in.
    Subnet string
    The VPC subnet.
    VpcName string
    VPC name given when hosted at the cloud provider.
    Tags []string
    Optional tags set for the VPC.
    id Integer
    The VPC identifier.
    name String
    The VPC instance name.
    region String
    The region the VPC is hosted in.
    subnet String
    The VPC subnet.
    vpcName String
    VPC name given when hosted at the cloud provider.
    tags List<String>
    Optional tags set for the VPC.
    id number
    The VPC identifier.
    name string
    The VPC instance name.
    region string
    The region the VPC is hosted in.
    subnet string
    The VPC subnet.
    vpcName string
    VPC name given when hosted at the cloud provider.
    tags string[]
    Optional tags set for the VPC.
    id int
    The VPC identifier.
    name str
    The VPC instance name.
    region str
    The region the VPC is hosted in.
    subnet str
    The VPC subnet.
    vpc_name str
    VPC name given when hosted at the cloud provider.
    tags Sequence[str]
    Optional tags set for the VPC.
    id Number
    The VPC identifier.
    name String
    The VPC instance name.
    region String
    The region the VPC is hosted in.
    subnet String
    The VPC subnet.
    vpcName String
    VPC name given when hosted at the cloud provider.
    tags List<String>
    Optional tags set for the VPC.

    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.21.0 published on Tuesday, Apr 8, 2025 by Pulumi