Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.27.0 published on Monday, Aug 8, 2022 by Pulumi

getInstances

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(AliCloud.Dns.GetInstances.InvokeAsync(new AliCloud.Dns.GetInstancesArgs
        {
            Ids = 
            {
                "dns-cn-oew1npk****",
            },
        }));
        this.FirstInstanceId = example.Apply(example => example.Instances?[0]?.Id);
    }

    [Output("firstInstanceId")]
    public Output<string> FirstInstanceId { get; set; }
}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/dns"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := dns.GetInstances(ctx, &dns.GetInstancesArgs{
			Ids: []string{
				"dns-cn-oew1npk****",
			},
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("firstInstanceId", example.Instances[0].Id)
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.dns.DnsFunctions;
import com.pulumi.alicloud.actiontrail.inputs.GetInstancesArgs;
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 example = DnsFunctions.getInstances(GetInstancesArgs.builder()
            .ids("dns-cn-oew1npk****")
            .build());

        ctx.export("firstInstanceId", example.applyValue(getInstancesResult -> getInstancesResult.instances()[0].id()));
    }
}
import pulumi
import pulumi_alicloud as alicloud

example = alicloud.dns.get_instances(ids=["dns-cn-oew1npk****"])
pulumi.export("firstInstanceId", example.instances[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const example = pulumi.output(alicloud.dns.getInstances({
    ids: ["dns-cn-oew1npk****"],
}));

export const firstInstanceId = example.instances[0].id;
variables:
  example:
    Fn::Invoke:
      Function: alicloud:dns:getInstances
      Arguments:
        ids:
          - dns-cn-oew1npk****
outputs:
  firstInstanceId: ${example.instances[0].id}

Using getInstances

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 getInstances(args: GetInstancesArgs, opts?: InvokeOptions): Promise<GetInstancesResult>
function getInstancesOutput(args: GetInstancesOutputArgs, opts?: InvokeOptions): Output<GetInstancesResult>
def get_instances(domain_type: Optional[str] = None,
                  ids: Optional[Sequence[str]] = None,
                  lang: Optional[str] = None,
                  output_file: Optional[str] = None,
                  user_client_ip: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetInstancesResult
def get_instances_output(domain_type: Optional[pulumi.Input[str]] = None,
                  ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                  lang: Optional[pulumi.Input[str]] = None,
                  output_file: Optional[pulumi.Input[str]] = None,
                  user_client_ip: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetInstancesResult]
func GetInstances(ctx *Context, args *GetInstancesArgs, opts ...InvokeOption) (*GetInstancesResult, error)
func GetInstancesOutput(ctx *Context, args *GetInstancesOutputArgs, opts ...InvokeOption) GetInstancesResultOutput

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

public static class GetInstances 
{
    public static Task<GetInstancesResult> InvokeAsync(GetInstancesArgs args, InvokeOptions? opts = null)
    public static Output<GetInstancesResult> Invoke(GetInstancesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetInstancesResult> getInstances(GetInstancesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: alicloud:dns/getInstances:getInstances
  Arguments:
    # Arguments dictionary

The following arguments are supported:

DomainType string
Ids List<string>

A list of instance IDs.

Lang string
OutputFile string
UserClientIp string
DomainType string
Ids []string

A list of instance IDs.

Lang string
OutputFile string
UserClientIp string
domainType String
ids List<String>

A list of instance IDs.

lang String
outputFile String
userClientIp String
domainType string
ids string[]

A list of instance IDs.

lang string
outputFile string
userClientIp string
domain_type str
ids Sequence[str]

A list of instance IDs.

lang str
output_file str
user_client_ip str
domainType String
ids List<String>

A list of instance IDs.

lang String
outputFile String
userClientIp String

getInstances Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>

A list of instance IDs.

Instances List<Pulumi.AliCloud.Dns.Outputs.GetInstancesInstance>

A list of instances. Each element contains the following attributes:

DomainType string
Lang string
OutputFile string
UserClientIp string
Id string

The provider-assigned unique ID for this managed resource.

Ids []string

A list of instance IDs.

Instances []GetInstancesInstance

A list of instances. Each element contains the following attributes:

DomainType string
Lang string
OutputFile string
UserClientIp string
id String

The provider-assigned unique ID for this managed resource.

ids List<String>

A list of instance IDs.

instances List<GetInstancesInstance>

A list of instances. Each element contains the following attributes:

domainType String
lang String
outputFile String
userClientIp String
id string

The provider-assigned unique ID for this managed resource.

ids string[]

A list of instance IDs.

instances GetInstancesInstance[]

A list of instances. Each element contains the following attributes:

domainType string
lang string
outputFile string
userClientIp string
id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]

A list of instance IDs.

instances Sequence[GetInstancesInstance]

A list of instances. Each element contains the following attributes:

domain_type str
lang str
output_file str
user_client_ip str
id String

The provider-assigned unique ID for this managed resource.

ids List<String>

A list of instance IDs.

instances List<Property Map>

A list of instances. Each element contains the following attributes:

domainType String
lang String
outputFile String
userClientIp String

Supporting Types

GetInstancesInstance

DnsSecurity string

DNS security level.

Domain string
DomainNumbers string

Number of domain names bound.

Id string

Id of the instance.

InstanceId string

Id of the instance resource.

PaymentType string
VersionCode string

Paid package version.

VersionName string

Paid package version name.

DnsSecurity string

DNS security level.

Domain string
DomainNumbers string

Number of domain names bound.

Id string

Id of the instance.

InstanceId string

Id of the instance resource.

PaymentType string
VersionCode string

Paid package version.

VersionName string

Paid package version name.

dnsSecurity String

DNS security level.

domain String
domainNumbers String

Number of domain names bound.

id String

Id of the instance.

instanceId String

Id of the instance resource.

paymentType String
versionCode String

Paid package version.

versionName String

Paid package version name.

dnsSecurity string

DNS security level.

domain string
domainNumbers string

Number of domain names bound.

id string

Id of the instance.

instanceId string

Id of the instance resource.

paymentType string
versionCode string

Paid package version.

versionName string

Paid package version name.

dns_security str

DNS security level.

domain str
domain_numbers str

Number of domain names bound.

id str

Id of the instance.

instance_id str

Id of the instance resource.

payment_type str
version_code str

Paid package version.

version_name str

Paid package version name.

dnsSecurity String

DNS security level.

domain String
domainNumbers String

Number of domain names bound.

id String

Id of the instance.

instanceId String

Id of the instance resource.

paymentType String
versionCode String

Paid package version.

versionName String

Paid package version name.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.