1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. dns
  5. getInstances
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.dns.getInstances

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    DEPRECATED: This resource has been renamed to alicloud.dns.getAlidnsInstances from version 1.95.0.

    This data source provides a list of DNS instances in an Alibaba Cloud account according to the specified filters.

    NOTE: Available in 1.84.0+.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const example = alicloud.dns.getInstances({
        ids: ["dns-cn-oew1npk****"],
    });
    export const firstInstanceId = example.then(example => example.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)
    
    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
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = AliCloud.Dns.GetInstances.Invoke(new()
        {
            Ids = new[]
            {
                "dns-cn-oew1npk****",
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["firstInstanceId"] = example.Apply(getInstancesResult => getInstancesResult.Instances[0]?.Id),
        };
    });
    
    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.dns.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()));
        }
    }
    
    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
    File name where to save data source results (after running pulumi preview).
    UserClientIp string
    DomainType string
    Ids []string
    A list of instance IDs.
    Lang string
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    UserClientIp string
    domainType String
    ids List<String>
    A list of instance IDs.
    lang String
    outputFile String
    File name where to save data source results (after running pulumi preview).
    userClientIp String
    domainType string
    ids string[]
    A list of instance IDs.
    lang string
    outputFile string
    File name where to save data source results (after running pulumi preview).
    userClientIp string
    domain_type str
    ids Sequence[str]
    A list of instance IDs.
    lang str
    output_file str
    File name where to save data source results (after running pulumi preview).
    user_client_ip str
    domainType String
    ids List<String>
    A list of instance IDs.
    lang String
    outputFile String
    File name where to save data source results (after running pulumi preview).
    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
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi