1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. dns
  5. getDomains
Alibaba Cloud v3.38.0 published on Friday, Jun 2, 2023 by Pulumi

alicloud.dns.getDomains

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.38.0 published on Friday, Jun 2, 2023 by Pulumi

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

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

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var domainsDs = AliCloud.Dns.GetDomains.Invoke(new()
        {
            DomainNameRegex = "^hegu",
            OutputFile = "domains.txt",
        });
    
        return new Dictionary<string, object?>
        {
            ["firstDomainId"] = domainsDs.Apply(getDomainsResult => getDomainsResult.Domains[0]?.DomainId),
        };
    });
    
    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 {
    		domainsDs, err := dns.GetDomains(ctx, &dns.GetDomainsArgs{
    			DomainNameRegex: pulumi.StringRef("^hegu"),
    			OutputFile:      pulumi.StringRef("domains.txt"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstDomainId", domainsDs.Domains[0].DomainId)
    		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.dns.inputs.GetDomainsArgs;
    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 domainsDs = DnsFunctions.getDomains(GetDomainsArgs.builder()
                .domainNameRegex("^hegu")
                .outputFile("domains.txt")
                .build());
    
            ctx.export("firstDomainId", domainsDs.applyValue(getDomainsResult -> getDomainsResult.domains()[0].domainId()));
        }
    }
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    domains_ds = alicloud.dns.get_domains(domain_name_regex="^hegu",
        output_file="domains.txt")
    pulumi.export("firstDomainId", domains_ds.domains[0].domain_id)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const domainsDs = alicloud.dns.getDomains({
        domainNameRegex: "^hegu",
        outputFile: "domains.txt",
    });
    export const firstDomainId = domainsDs.then(domainsDs => domainsDs.domains?.[0]?.domainId);
    
    variables:
      domainsDs:
        fn::invoke:
          Function: alicloud:dns:getDomains
          Arguments:
            domainNameRegex: ^hegu
            outputFile: domains.txt
    outputs:
      firstDomainId: ${domainsDs.domains[0].domainId}
    

    Using getDomains

    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 getDomains(args: GetDomainsArgs, opts?: InvokeOptions): Promise<GetDomainsResult>
    function getDomainsOutput(args: GetDomainsOutputArgs, opts?: InvokeOptions): Output<GetDomainsResult>
    def get_domains(ali_domain: Optional[bool] = None,
                    domain_name_regex: Optional[str] = None,
                    enable_details: Optional[bool] = None,
                    group_id: Optional[str] = None,
                    group_name_regex: Optional[str] = None,
                    ids: Optional[Sequence[str]] = None,
                    instance_id: Optional[str] = None,
                    key_word: Optional[str] = None,
                    lang: Optional[str] = None,
                    output_file: Optional[str] = None,
                    resource_group_id: Optional[str] = None,
                    search_mode: Optional[str] = None,
                    starmark: Optional[bool] = None,
                    tags: Optional[Mapping[str, Any]] = None,
                    version_code: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetDomainsResult
    def get_domains_output(ali_domain: Optional[pulumi.Input[bool]] = None,
                    domain_name_regex: Optional[pulumi.Input[str]] = None,
                    enable_details: Optional[pulumi.Input[bool]] = None,
                    group_id: Optional[pulumi.Input[str]] = None,
                    group_name_regex: Optional[pulumi.Input[str]] = None,
                    ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                    instance_id: Optional[pulumi.Input[str]] = None,
                    key_word: Optional[pulumi.Input[str]] = None,
                    lang: Optional[pulumi.Input[str]] = None,
                    output_file: Optional[pulumi.Input[str]] = None,
                    resource_group_id: Optional[pulumi.Input[str]] = None,
                    search_mode: Optional[pulumi.Input[str]] = None,
                    starmark: Optional[pulumi.Input[bool]] = None,
                    tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                    version_code: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetDomainsResult]
    func GetDomains(ctx *Context, args *GetDomainsArgs, opts ...InvokeOption) (*GetDomainsResult, error)
    func GetDomainsOutput(ctx *Context, args *GetDomainsOutputArgs, opts ...InvokeOption) GetDomainsResultOutput

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

    public static class GetDomains 
    {
        public static Task<GetDomainsResult> InvokeAsync(GetDomainsArgs args, InvokeOptions? opts = null)
        public static Output<GetDomainsResult> Invoke(GetDomainsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDomainsResult> getDomains(GetDomainsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:dns/getDomains:getDomains
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AliDomain bool

    Specifies whether the domain is from Alibaba Cloud or not.

    DomainNameRegex string

    A regex string to filter results by the domain name.

    EnableDetails bool
    GroupId string

    Domain group ID, if not filled, the default is all groups.

    GroupNameRegex string

    A regex string to filter results by the group name.

    Ids List<string>

    A list of domain IDs.

    InstanceId string

    Cloud analysis product ID.

    KeyWord string

    The keywords are searched according to the %KeyWord% mode, which is not case sensitive.

    Lang string

    User language.

    OutputFile string

    File name where to save data source results (after running pulumi preview).

    ResourceGroupId string

    The Id of resource group which the dns belongs.

    SearchMode string

    Search mode, LIKE fuzzy search, EXACT exact search.

    Starmark bool

    Whether to query the domain name star.

    Tags Dictionary<string, object>

    A mapping of tags to assign to the resource.

    VersionCode string

    Cloud analysis version code.

    AliDomain bool

    Specifies whether the domain is from Alibaba Cloud or not.

    DomainNameRegex string

    A regex string to filter results by the domain name.

    EnableDetails bool
    GroupId string

    Domain group ID, if not filled, the default is all groups.

    GroupNameRegex string

    A regex string to filter results by the group name.

    Ids []string

    A list of domain IDs.

    InstanceId string

    Cloud analysis product ID.

    KeyWord string

    The keywords are searched according to the %KeyWord% mode, which is not case sensitive.

    Lang string

    User language.

    OutputFile string

    File name where to save data source results (after running pulumi preview).

    ResourceGroupId string

    The Id of resource group which the dns belongs.

    SearchMode string

    Search mode, LIKE fuzzy search, EXACT exact search.

    Starmark bool

    Whether to query the domain name star.

    Tags map[string]interface{}

    A mapping of tags to assign to the resource.

    VersionCode string

    Cloud analysis version code.

    aliDomain Boolean

    Specifies whether the domain is from Alibaba Cloud or not.

    domainNameRegex String

    A regex string to filter results by the domain name.

    enableDetails Boolean
    groupId String

    Domain group ID, if not filled, the default is all groups.

    groupNameRegex String

    A regex string to filter results by the group name.

    ids List<String>

    A list of domain IDs.

    instanceId String

    Cloud analysis product ID.

    keyWord String

    The keywords are searched according to the %KeyWord% mode, which is not case sensitive.

    lang String

    User language.

    outputFile String

    File name where to save data source results (after running pulumi preview).

    resourceGroupId String

    The Id of resource group which the dns belongs.

    searchMode String

    Search mode, LIKE fuzzy search, EXACT exact search.

    starmark Boolean

    Whether to query the domain name star.

    tags Map<String,Object>

    A mapping of tags to assign to the resource.

    versionCode String

    Cloud analysis version code.

    aliDomain boolean

    Specifies whether the domain is from Alibaba Cloud or not.

    domainNameRegex string

    A regex string to filter results by the domain name.

    enableDetails boolean
    groupId string

    Domain group ID, if not filled, the default is all groups.

    groupNameRegex string

    A regex string to filter results by the group name.

    ids string[]

    A list of domain IDs.

    instanceId string

    Cloud analysis product ID.

    keyWord string

    The keywords are searched according to the %KeyWord% mode, which is not case sensitive.

    lang string

    User language.

    outputFile string

    File name where to save data source results (after running pulumi preview).

    resourceGroupId string

    The Id of resource group which the dns belongs.

    searchMode string

    Search mode, LIKE fuzzy search, EXACT exact search.

    starmark boolean

    Whether to query the domain name star.

    tags {[key: string]: any}

    A mapping of tags to assign to the resource.

    versionCode string

    Cloud analysis version code.

    ali_domain bool

    Specifies whether the domain is from Alibaba Cloud or not.

    domain_name_regex str

    A regex string to filter results by the domain name.

    enable_details bool
    group_id str

    Domain group ID, if not filled, the default is all groups.

    group_name_regex str

    A regex string to filter results by the group name.

    ids Sequence[str]

    A list of domain IDs.

    instance_id str

    Cloud analysis product ID.

    key_word str

    The keywords are searched according to the %KeyWord% mode, which is not case sensitive.

    lang str

    User language.

    output_file str

    File name where to save data source results (after running pulumi preview).

    resource_group_id str

    The Id of resource group which the dns belongs.

    search_mode str

    Search mode, LIKE fuzzy search, EXACT exact search.

    starmark bool

    Whether to query the domain name star.

    tags Mapping[str, Any]

    A mapping of tags to assign to the resource.

    version_code str

    Cloud analysis version code.

    aliDomain Boolean

    Specifies whether the domain is from Alibaba Cloud or not.

    domainNameRegex String

    A regex string to filter results by the domain name.

    enableDetails Boolean
    groupId String

    Domain group ID, if not filled, the default is all groups.

    groupNameRegex String

    A regex string to filter results by the group name.

    ids List<String>

    A list of domain IDs.

    instanceId String

    Cloud analysis product ID.

    keyWord String

    The keywords are searched according to the %KeyWord% mode, which is not case sensitive.

    lang String

    User language.

    outputFile String

    File name where to save data source results (after running pulumi preview).

    resourceGroupId String

    The Id of resource group which the dns belongs.

    searchMode String

    Search mode, LIKE fuzzy search, EXACT exact search.

    starmark Boolean

    Whether to query the domain name star.

    tags Map<Any>

    A mapping of tags to assign to the resource.

    versionCode String

    Cloud analysis version code.

    getDomains Result

    The following output properties are available:

    Domains List<Pulumi.AliCloud.Dns.Outputs.GetDomainsDomain>

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

    Id string

    The provider-assigned unique ID for this managed resource.

    Ids List<string>

    A list of domain IDs.

    Names List<string>

    A list of domain names.

    AliDomain bool

    Indicates whether the domain is an Alibaba Cloud domain.

    DomainNameRegex string
    EnableDetails bool
    GroupId string

    Id of group that contains the domain.

    GroupNameRegex string
    InstanceId string

    Cloud analysis product ID of the domain.

    KeyWord string
    Lang string
    OutputFile string
    ResourceGroupId string

    The Id of resource group which the dns belongs.

    SearchMode string
    Starmark bool
    Tags Dictionary<string, object>
    VersionCode string

    Cloud resolution version ID.

    Domains []GetDomainsDomain

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

    Id string

    The provider-assigned unique ID for this managed resource.

    Ids []string

    A list of domain IDs.

    Names []string

    A list of domain names.

    AliDomain bool

    Indicates whether the domain is an Alibaba Cloud domain.

    DomainNameRegex string
    EnableDetails bool
    GroupId string

    Id of group that contains the domain.

    GroupNameRegex string
    InstanceId string

    Cloud analysis product ID of the domain.

    KeyWord string
    Lang string
    OutputFile string
    ResourceGroupId string

    The Id of resource group which the dns belongs.

    SearchMode string
    Starmark bool
    Tags map[string]interface{}
    VersionCode string

    Cloud resolution version ID.

    domains List<GetDomainsDomain>

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

    id String

    The provider-assigned unique ID for this managed resource.

    ids List<String>

    A list of domain IDs.

    names List<String>

    A list of domain names.

    aliDomain Boolean

    Indicates whether the domain is an Alibaba Cloud domain.

    domainNameRegex String
    enableDetails Boolean
    groupId String

    Id of group that contains the domain.

    groupNameRegex String
    instanceId String

    Cloud analysis product ID of the domain.

    keyWord String
    lang String
    outputFile String
    resourceGroupId String

    The Id of resource group which the dns belongs.

    searchMode String
    starmark Boolean
    tags Map<String,Object>
    versionCode String

    Cloud resolution version ID.

    domains GetDomainsDomain[]

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

    id string

    The provider-assigned unique ID for this managed resource.

    ids string[]

    A list of domain IDs.

    names string[]

    A list of domain names.

    aliDomain boolean

    Indicates whether the domain is an Alibaba Cloud domain.

    domainNameRegex string
    enableDetails boolean
    groupId string

    Id of group that contains the domain.

    groupNameRegex string
    instanceId string

    Cloud analysis product ID of the domain.

    keyWord string
    lang string
    outputFile string
    resourceGroupId string

    The Id of resource group which the dns belongs.

    searchMode string
    starmark boolean
    tags {[key: string]: any}
    versionCode string

    Cloud resolution version ID.

    domains Sequence[GetDomainsDomain]

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

    id str

    The provider-assigned unique ID for this managed resource.

    ids Sequence[str]

    A list of domain IDs.

    names Sequence[str]

    A list of domain names.

    ali_domain bool

    Indicates whether the domain is an Alibaba Cloud domain.

    domain_name_regex str
    enable_details bool
    group_id str

    Id of group that contains the domain.

    group_name_regex str
    instance_id str

    Cloud analysis product ID of the domain.

    key_word str
    lang str
    output_file str
    resource_group_id str

    The Id of resource group which the dns belongs.

    search_mode str
    starmark bool
    tags Mapping[str, Any]
    version_code str

    Cloud resolution version ID.

    domains List<Property Map>

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

    id String

    The provider-assigned unique ID for this managed resource.

    ids List<String>

    A list of domain IDs.

    names List<String>

    A list of domain names.

    aliDomain Boolean

    Indicates whether the domain is an Alibaba Cloud domain.

    domainNameRegex String
    enableDetails Boolean
    groupId String

    Id of group that contains the domain.

    groupNameRegex String
    instanceId String

    Cloud analysis product ID of the domain.

    keyWord String
    lang String
    outputFile String
    resourceGroupId String

    The Id of resource group which the dns belongs.

    searchMode String
    starmark Boolean
    tags Map<Any>
    versionCode String

    Cloud resolution version ID.

    Supporting Types

    GetDomainsDomain

    AliDomain bool

    Specifies whether the domain is from Alibaba Cloud or not.

    AvailableTtls List<int>
    DnsServers List<string>

    DNS list of domain names in the resolution system.

    DomainId string

    ID of the domain.

    DomainName string

    Name of the domain.

    GroupId string

    Domain group ID, if not filled, the default is all groups.

    GroupName string

    Name of group that contains the domain.

    Id string

    The Id of resource.

    InBlackHole bool

    Whether it is in black hole.

    InClean bool

    Whether it is cleaning.

    InstanceId string

    Cloud analysis product ID.

    LineType string
    MinTtl int

    Minimum TTL.

    PunyCode string

    Punycode of the Chinese domain.

    RecordLineTreeJson string

    Tree-like analytical line list.

    RecordLines List<Pulumi.AliCloud.Dns.Inputs.GetDomainsDomainRecordLine>
    RegionLines bool

    Whether it is a regional route.

    Remark string

    The Id of resource group which the dns belongs.

    ResourceGroupId string

    The Id of resource group which the dns belongs.

    SlaveDns bool

    Whether to allow auxiliary dns.

    Tags Dictionary<string, object>

    A mapping of tags to assign to the resource.

    VersionCode string

    Cloud analysis version code.

    VersionName string
    AliDomain bool

    Specifies whether the domain is from Alibaba Cloud or not.

    AvailableTtls []int
    DnsServers []string

    DNS list of domain names in the resolution system.

    DomainId string

    ID of the domain.

    DomainName string

    Name of the domain.

    GroupId string

    Domain group ID, if not filled, the default is all groups.

    GroupName string

    Name of group that contains the domain.

    Id string

    The Id of resource.

    InBlackHole bool

    Whether it is in black hole.

    InClean bool

    Whether it is cleaning.

    InstanceId string

    Cloud analysis product ID.

    LineType string
    MinTtl int

    Minimum TTL.

    PunyCode string

    Punycode of the Chinese domain.

    RecordLineTreeJson string

    Tree-like analytical line list.

    RecordLines []GetDomainsDomainRecordLine
    RegionLines bool

    Whether it is a regional route.

    Remark string

    The Id of resource group which the dns belongs.

    ResourceGroupId string

    The Id of resource group which the dns belongs.

    SlaveDns bool

    Whether to allow auxiliary dns.

    Tags map[string]interface{}

    A mapping of tags to assign to the resource.

    VersionCode string

    Cloud analysis version code.

    VersionName string
    aliDomain Boolean

    Specifies whether the domain is from Alibaba Cloud or not.

    availableTtls List<Integer>
    dnsServers List<String>

    DNS list of domain names in the resolution system.

    domainId String

    ID of the domain.

    domainName String

    Name of the domain.

    groupId String

    Domain group ID, if not filled, the default is all groups.

    groupName String

    Name of group that contains the domain.

    id String

    The Id of resource.

    inBlackHole Boolean

    Whether it is in black hole.

    inClean Boolean

    Whether it is cleaning.

    instanceId String

    Cloud analysis product ID.

    lineType String
    minTtl Integer

    Minimum TTL.

    punyCode String

    Punycode of the Chinese domain.

    recordLineTreeJson String

    Tree-like analytical line list.

    recordLines List<GetDomainsDomainRecordLine>
    regionLines Boolean

    Whether it is a regional route.

    remark String

    The Id of resource group which the dns belongs.

    resourceGroupId String

    The Id of resource group which the dns belongs.

    slaveDns Boolean

    Whether to allow auxiliary dns.

    tags Map<String,Object>

    A mapping of tags to assign to the resource.

    versionCode String

    Cloud analysis version code.

    versionName String
    aliDomain boolean

    Specifies whether the domain is from Alibaba Cloud or not.

    availableTtls number[]
    dnsServers string[]

    DNS list of domain names in the resolution system.

    domainId string

    ID of the domain.

    domainName string

    Name of the domain.

    groupId string

    Domain group ID, if not filled, the default is all groups.

    groupName string

    Name of group that contains the domain.

    id string

    The Id of resource.

    inBlackHole boolean

    Whether it is in black hole.

    inClean boolean

    Whether it is cleaning.

    instanceId string

    Cloud analysis product ID.

    lineType string
    minTtl number

    Minimum TTL.

    punyCode string

    Punycode of the Chinese domain.

    recordLineTreeJson string

    Tree-like analytical line list.

    recordLines GetDomainsDomainRecordLine[]
    regionLines boolean

    Whether it is a regional route.

    remark string

    The Id of resource group which the dns belongs.

    resourceGroupId string

    The Id of resource group which the dns belongs.

    slaveDns boolean

    Whether to allow auxiliary dns.

    tags {[key: string]: any}

    A mapping of tags to assign to the resource.

    versionCode string

    Cloud analysis version code.

    versionName string
    ali_domain bool

    Specifies whether the domain is from Alibaba Cloud or not.

    available_ttls Sequence[int]
    dns_servers Sequence[str]

    DNS list of domain names in the resolution system.

    domain_id str

    ID of the domain.

    domain_name str

    Name of the domain.

    group_id str

    Domain group ID, if not filled, the default is all groups.

    group_name str

    Name of group that contains the domain.

    id str

    The Id of resource.

    in_black_hole bool

    Whether it is in black hole.

    in_clean bool

    Whether it is cleaning.

    instance_id str

    Cloud analysis product ID.

    line_type str
    min_ttl int

    Minimum TTL.

    puny_code str

    Punycode of the Chinese domain.

    record_line_tree_json str

    Tree-like analytical line list.

    record_lines Sequence[GetDomainsDomainRecordLine]
    region_lines bool

    Whether it is a regional route.

    remark str

    The Id of resource group which the dns belongs.

    resource_group_id str

    The Id of resource group which the dns belongs.

    slave_dns bool

    Whether to allow auxiliary dns.

    tags Mapping[str, Any]

    A mapping of tags to assign to the resource.

    version_code str

    Cloud analysis version code.

    version_name str
    aliDomain Boolean

    Specifies whether the domain is from Alibaba Cloud or not.

    availableTtls List<Number>
    dnsServers List<String>

    DNS list of domain names in the resolution system.

    domainId String

    ID of the domain.

    domainName String

    Name of the domain.

    groupId String

    Domain group ID, if not filled, the default is all groups.

    groupName String

    Name of group that contains the domain.

    id String

    The Id of resource.

    inBlackHole Boolean

    Whether it is in black hole.

    inClean Boolean

    Whether it is cleaning.

    instanceId String

    Cloud analysis product ID.

    lineType String
    minTtl Number

    Minimum TTL.

    punyCode String

    Punycode of the Chinese domain.

    recordLineTreeJson String

    Tree-like analytical line list.

    recordLines List<Property Map>
    regionLines Boolean

    Whether it is a regional route.

    remark String

    The Id of resource group which the dns belongs.

    resourceGroupId String

    The Id of resource group which the dns belongs.

    slaveDns Boolean

    Whether to allow auxiliary dns.

    tags Map<Any>

    A mapping of tags to assign to the resource.

    versionCode String

    Cloud analysis version code.

    versionName String

    GetDomainsDomainRecordLine

    FatherCode string
    LineCode string
    LineDisplayName string
    LineName string
    FatherCode string
    LineCode string
    LineDisplayName string
    LineName string
    fatherCode String
    lineCode String
    lineDisplayName String
    lineName String
    fatherCode string
    lineCode string
    lineDisplayName string
    lineName string
    fatherCode String
    lineCode String
    lineDisplayName String
    lineName String

    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.38.0 published on Friday, Jun 2, 2023 by Pulumi