Alibaba Cloud

v3.15.0 published on Thursday, Jan 13, 2022 by Pulumi

getDomains

This data source provides the Direct Mail Domains of the current Alibaba Cloud user.

NOTE: Available in v1.134.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var ids = Output.Create(AliCloud.DirectMail.GetDomains.InvokeAsync(new AliCloud.DirectMail.GetDomainsArgs
        {
            Ids = 
            {
                "example_id",
            },
        }));
        this.DirectMailDomainId1 = ids.Apply(ids => ids.Domains?[0]?.Id);
        var nameRegex = Output.Create(AliCloud.DirectMail.GetDomains.InvokeAsync(new AliCloud.DirectMail.GetDomainsArgs
        {
            NameRegex = "^my-Domain",
        }));
        this.DirectMailDomainId2 = nameRegex.Apply(nameRegex => nameRegex.Domains?[0]?.Id);
        var example = Output.Create(AliCloud.DirectMail.GetDomains.InvokeAsync(new AliCloud.DirectMail.GetDomainsArgs
        {
            Status = "1",
            KeyWord = "^my-Domain",
            Ids = 
            {
                "example_id",
            },
        }));
        this.DirectMailDomainId3 = example.Apply(example => example.Domains?[0]?.Id);
    }

    [Output("directMailDomainId1")]
    public Output<string> DirectMailDomainId1 { get; set; }
    [Output("directMailDomainId2")]
    public Output<string> DirectMailDomainId2 { get; set; }
    [Output("directMailDomainId3")]
    public Output<string> DirectMailDomainId3 { get; set; }
}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		ids, err := directmail.GetDomains(ctx, &directmail.GetDomainsArgs{
			Ids: []string{
				"example_id",
			},
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("directMailDomainId1", ids.Domains[0].Id)
		opt0 := "^my-Domain"
		nameRegex, err := directmail.GetDomains(ctx, &directmail.GetDomainsArgs{
			NameRegex: &opt0,
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("directMailDomainId2", nameRegex.Domains[0].Id)
		opt1 := "1"
		opt2 := "^my-Domain"
		example, err := directmail.GetDomains(ctx, &directmail.GetDomainsArgs{
			Status:  &opt1,
			KeyWord: &opt2,
			Ids: []string{
				"example_id",
			},
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("directMailDomainId3", example.Domains[0].Id)
		return nil
	})
}
import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.directmail.get_domains(ids=["example_id"])
pulumi.export("directMailDomainId1", ids.domains[0].id)
name_regex = alicloud.directmail.get_domains(name_regex="^my-Domain")
pulumi.export("directMailDomainId2", name_regex.domains[0].id)
example = alicloud.directmail.get_domains(status="1",
    key_word="^my-Domain",
    ids=["example_id"])
pulumi.export("directMailDomainId3", example.domains[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const ids = alicloud.directmail.getDomains({
    ids: ["example_id"],
});
export const directMailDomainId1 = ids.then(ids => ids.domains?[0]?.id);
const nameRegex = alicloud.directmail.getDomains({
    nameRegex: "^my-Domain",
});
export const directMailDomainId2 = nameRegex.then(nameRegex => nameRegex.domains?[0]?.id);
const example = alicloud.directmail.getDomains({
    status: "1",
    keyWord: "^my-Domain",
    ids: ["example_id"],
});
export const directMailDomainId3 = example.then(example => example.domains?[0]?.id);

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(enable_details: Optional[bool] = None,
                ids: Optional[Sequence[str]] = None,
                key_word: Optional[str] = None,
                name_regex: Optional[str] = None,
                output_file: Optional[str] = None,
                status: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetDomainsResult
def get_domains_output(enable_details: Optional[pulumi.Input[bool]] = None,
                ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                key_word: Optional[pulumi.Input[str]] = None,
                name_regex: Optional[pulumi.Input[str]] = None,
                output_file: Optional[pulumi.Input[str]] = None,
                status: 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)
}

The following arguments are supported:

EnableDetails bool
Default to false. Set it to true can output more details about resource attributes.
Ids List<string>
A list of Domain IDs.
KeyWord string
domain, length 1 to 50, including numbers or capitals or lowercase letters or . or -
NameRegex string
A regex string to filter results by Domain name.
OutputFile string
Status string
The status of the domain name. Valid values:0 to 4. 0:Available, Passed. 1: Unavailable, No passed. 2: Available, cname no passed, icp no passed. 3: Available, icp no passed. 4: Available, cname no passed.
EnableDetails bool
Default to false. Set it to true can output more details about resource attributes.
Ids []string
A list of Domain IDs.
KeyWord string
domain, length 1 to 50, including numbers or capitals or lowercase letters or . or -
NameRegex string
A regex string to filter results by Domain name.
OutputFile string
Status string
The status of the domain name. Valid values:0 to 4. 0:Available, Passed. 1: Unavailable, No passed. 2: Available, cname no passed, icp no passed. 3: Available, icp no passed. 4: Available, cname no passed.
enableDetails boolean
Default to false. Set it to true can output more details about resource attributes.
ids string[]
A list of Domain IDs.
keyWord string
domain, length 1 to 50, including numbers or capitals or lowercase letters or . or -
nameRegex string
A regex string to filter results by Domain name.
outputFile string
status string
The status of the domain name. Valid values:0 to 4. 0:Available, Passed. 1: Unavailable, No passed. 2: Available, cname no passed, icp no passed. 3: Available, icp no passed. 4: Available, cname no passed.
enable_details bool
Default to false. Set it to true can output more details about resource attributes.
ids Sequence[str]
A list of Domain IDs.
key_word str
domain, length 1 to 50, including numbers or capitals or lowercase letters or . or -
name_regex str
A regex string to filter results by Domain name.
output_file str
status str
The status of the domain name. Valid values:0 to 4. 0:Available, Passed. 1: Unavailable, No passed. 2: Available, cname no passed, icp no passed. 3: Available, icp no passed. 4: Available, cname no passed.

getDomains Result

The following output properties are available:

Domains List<Pulumi.AliCloud.DirectMail.Outputs.GetDomainsDomain>
Id string
The provider-assigned unique ID for this managed resource.
Ids List<string>
Names List<string>
EnableDetails bool
KeyWord string
NameRegex string
OutputFile string
Status string
Domains []GetDomainsDomain
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
Names []string
EnableDetails bool
KeyWord string
NameRegex string
OutputFile string
Status string
domains GetDomainsDomain[]
id string
The provider-assigned unique ID for this managed resource.
ids string[]
names string[]
enableDetails boolean
keyWord string
nameRegex string
outputFile string
status string
domains Sequence[GetDomainsDomain]
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
names Sequence[str]
enable_details bool
key_word str
name_regex str
output_file str
status str

Supporting Types

GetDomainsDomain

CnameAuthStatus string
Track verification.
CnameConfirmStatus string
Indicates whether the CNAME record is successfully verified. Valid values: 0 and 1. 0: indicates the verification is successful. 1: indicates that the verification fails.
CnameRecord string
The value of the CNAME record.
CreateTime string
The time when the DNS record was created.
DefaultDomain string
The default domain name.
DnsMx string
The value of the MX record.
DnsSpf string
The value of the SPF record.
DnsTxt string
The value of the TXT ownership record.
DomainId string
The ID of the domain name.
DomainName string
The domain name.
DomainType string
The type of the domain.
IcpStatus string
The status of ICP filing. Valid values: 0 and 1. 0: indicates that the domain name is not filed. 1: indicates that the domain name is filed.
Id string
The ID of the Domain.
MxAuthStatus string
Indicates whether the MX record is successfully verified. Valid values: 0 and 1. 0: indicates the verification is successful. 1: indicates that the verification fails.
MxRecord string
The MX verification record provided by Alibaba Cloud DNS.
SpfAuthStatus string
Indicates whether the SPF record is successfully verified. Valid values: 0 and 1. 0: indicates the verification is successful. 1: indicates that the verification fails.
SpfRecord string
The SPF verification record provided by Alibaba Cloud DNS.
Status string
The status of the domain name. Valid values:0 to 4. 0:Available, Passed. 1: Unavailable, No passed. 2: Available, cname no passed, icp no passed. 3: Available, icp no passed. 4: Available, cname no passed.
TlDomainName string
The primary domain name.
TracefRecord string
The CNAME verification record provided by Alibaba Cloud DNS.
CnameAuthStatus string
Track verification.
CnameConfirmStatus string
Indicates whether the CNAME record is successfully verified. Valid values: 0 and 1. 0: indicates the verification is successful. 1: indicates that the verification fails.
CnameRecord string
The value of the CNAME record.
CreateTime string
The time when the DNS record was created.
DefaultDomain string
The default domain name.
DnsMx string
The value of the MX record.
DnsSpf string
The value of the SPF record.
DnsTxt string
The value of the TXT ownership record.
DomainId string
The ID of the domain name.
DomainName string
The domain name.
DomainType string
The type of the domain.
IcpStatus string
The status of ICP filing. Valid values: 0 and 1. 0: indicates that the domain name is not filed. 1: indicates that the domain name is filed.
Id string
The ID of the Domain.
MxAuthStatus string
Indicates whether the MX record is successfully verified. Valid values: 0 and 1. 0: indicates the verification is successful. 1: indicates that the verification fails.
MxRecord string
The MX verification record provided by Alibaba Cloud DNS.
SpfAuthStatus string
Indicates whether the SPF record is successfully verified. Valid values: 0 and 1. 0: indicates the verification is successful. 1: indicates that the verification fails.
SpfRecord string
The SPF verification record provided by Alibaba Cloud DNS.
Status string
The status of the domain name. Valid values:0 to 4. 0:Available, Passed. 1: Unavailable, No passed. 2: Available, cname no passed, icp no passed. 3: Available, icp no passed. 4: Available, cname no passed.
TlDomainName string
The primary domain name.
TracefRecord string
The CNAME verification record provided by Alibaba Cloud DNS.
cnameAuthStatus string
Track verification.
cnameConfirmStatus string
Indicates whether the CNAME record is successfully verified. Valid values: 0 and 1. 0: indicates the verification is successful. 1: indicates that the verification fails.
cnameRecord string
The value of the CNAME record.
createTime string
The time when the DNS record was created.
defaultDomain string
The default domain name.
dnsMx string
The value of the MX record.
dnsSpf string
The value of the SPF record.
dnsTxt string
The value of the TXT ownership record.
domainId string
The ID of the domain name.
domainName string
The domain name.
domainType string
The type of the domain.
icpStatus string
The status of ICP filing. Valid values: 0 and 1. 0: indicates that the domain name is not filed. 1: indicates that the domain name is filed.
id string
The ID of the Domain.
mxAuthStatus string
Indicates whether the MX record is successfully verified. Valid values: 0 and 1. 0: indicates the verification is successful. 1: indicates that the verification fails.
mxRecord string
The MX verification record provided by Alibaba Cloud DNS.
spfAuthStatus string
Indicates whether the SPF record is successfully verified. Valid values: 0 and 1. 0: indicates the verification is successful. 1: indicates that the verification fails.
spfRecord string
The SPF verification record provided by Alibaba Cloud DNS.
status string
The status of the domain name. Valid values:0 to 4. 0:Available, Passed. 1: Unavailable, No passed. 2: Available, cname no passed, icp no passed. 3: Available, icp no passed. 4: Available, cname no passed.
tlDomainName string
The primary domain name.
tracefRecord string
The CNAME verification record provided by Alibaba Cloud DNS.
cname_auth_status str
Track verification.
cname_confirm_status str
Indicates whether the CNAME record is successfully verified. Valid values: 0 and 1. 0: indicates the verification is successful. 1: indicates that the verification fails.
cname_record str
The value of the CNAME record.
create_time str
The time when the DNS record was created.
default_domain str
The default domain name.
dns_mx str
The value of the MX record.
dns_spf str
The value of the SPF record.
dns_txt str
The value of the TXT ownership record.
domain_id str
The ID of the domain name.
domain_name str
The domain name.
domain_type str
The type of the domain.
icp_status str
The status of ICP filing. Valid values: 0 and 1. 0: indicates that the domain name is not filed. 1: indicates that the domain name is filed.
id str
The ID of the Domain.
mx_auth_status str
Indicates whether the MX record is successfully verified. Valid values: 0 and 1. 0: indicates the verification is successful. 1: indicates that the verification fails.
mx_record str
The MX verification record provided by Alibaba Cloud DNS.
spf_auth_status str
Indicates whether the SPF record is successfully verified. Valid values: 0 and 1. 0: indicates the verification is successful. 1: indicates that the verification fails.
spf_record str
The SPF verification record provided by Alibaba Cloud DNS.
status str
The status of the domain name. Valid values:0 to 4. 0:Available, Passed. 1: Unavailable, No passed. 2: Available, cname no passed, icp no passed. 3: Available, icp no passed. 4: Available, cname no passed.
tl_domain_name str
The primary domain name.
tracef_record str
The CNAME verification record provided by Alibaba Cloud DNS.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.