cloudamqp.getAccount
Explore with Pulumi AI
Use this data source to retrieve basic information about all instances 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 instance identifier is unknown, while other attributes are known. E.g. find correct instance from instance name
. Then iterate over instances to find the matching one and extract the instance identifier.
import * as pulumi from "@pulumi/pulumi";
import * as cloudamqp from "@pulumi/cloudamqp";
const instanceName = "<instance_name>";
const instanceList = cloudamqp.getAccount({});
export const instanceId = <nil>;
import pulumi
import pulumi_cloudamqp as cloudamqp
instance_name = "<instance_name>"
instance_list = cloudamqp.get_account()
pulumi.export("instanceId", <nil>)
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 {
_ := "<instance_name>";
_, err := cloudamqp.GetAccount(ctx, nil, nil);
if err != nil {
return err
}
ctx.Export("instanceId", <nil>)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using CloudAmqp = Pulumi.CloudAmqp;
return await Deployment.RunAsync(() =>
{
var instanceName = "<instance_name>";
var instanceList = CloudAmqp.GetAccount.Invoke();
return new Dictionary<string, object?>
{
["instanceId"] = <nil>,
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudamqp.CloudamqpFunctions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var instanceName = "<instance_name>";
final var instanceList = CloudamqpFunctions.getAccount();
ctx.export("instanceId", <nil>);
}
}
Coming soon!
Attributes reference
All attributes reference are computed
id
- The identifier for this data source. Set tona
since there is no unique identifier.instances
- An array of instances. Eachinstances
block consists of the fields documented below.
The instances
block consist of
id
- The instance identifier.name
- The name of the instance.plan
- The subscription plan used for the instance.region
- The region were the instanece is located in.tags
- Optional tags set for the instance.
Dependency
This data source depends on apikey set in the provider configuration.
Using getAccount
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 getAccount(opts?: InvokeOptions): Promise<GetAccountResult>
function getAccountOutput(opts?: InvokeOptions): Output<GetAccountResult>
def get_account(opts: Optional[InvokeOptions] = None) -> GetAccountResult
def get_account_output(opts: Optional[InvokeOptions] = None) -> Output[GetAccountResult]
func GetAccount(ctx *Context, opts ...InvokeOption) (*GetAccountResult, error)
func GetAccountOutput(ctx *Context, opts ...InvokeOption) GetAccountResultOutput
> Note: This function is named GetAccount
in the Go SDK.
public static class GetAccount
{
public static Task<GetAccountResult> InvokeAsync(InvokeOptions? opts = null)
public static Output<GetAccountResult> Invoke(InvokeOptions? opts = null)
}
public static CompletableFuture<GetAccountResult> getAccount(InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: cloudamqp:index/getAccount:getAccount
arguments:
# arguments dictionary
getAccount Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Instances
List<Pulumi.
Cloud Amqp. Outputs. Get Account Instance>
- Id string
- The provider-assigned unique ID for this managed resource.
- Instances
[]Get
Account Instance
- id String
- The provider-assigned unique ID for this managed resource.
- instances
List<Get
Account Instance>
- id string
- The provider-assigned unique ID for this managed resource.
- instances
Get
Account Instance[]
- id str
- The provider-assigned unique ID for this managed resource.
- instances
Sequence[Get
Account Instance]
- id String
- The provider-assigned unique ID for this managed resource.
- instances List<Property Map>
Supporting Types
GetAccountInstance
Package Details
- Repository
- CloudAMQP pulumi/pulumi-cloudamqp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
cloudamqp
Terraform Provider.