1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. directmail
  5. getDomains
Alibaba Cloud v3.45.0 published on Monday, Nov 27, 2023 by Pulumi

alicloud.directmail.getDomains

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.45.0 published on Monday, Nov 27, 2023 by Pulumi

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

    NOTE: Available in v1.134.0+.

    Example Usage

    Basic Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.DirectMail.GetDomains.Invoke(new()
        {
            Ids = new[]
            {
                "example_id",
            },
        });
    
        var nameRegex = AliCloud.DirectMail.GetDomains.Invoke(new()
        {
            NameRegex = "^my-Domain",
        });
    
        var example = AliCloud.DirectMail.GetDomains.Invoke(new()
        {
            Status = "1",
            KeyWord = "^my-Domain",
            Ids = new[]
            {
                "example_id",
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["directMailDomainId1"] = ids.Apply(getDomainsResult => getDomainsResult.Domains[0]?.Id),
            ["directMailDomainId2"] = nameRegex.Apply(getDomainsResult => getDomainsResult.Domains[0]?.Id),
            ["directMailDomainId3"] = example.Apply(getDomainsResult => getDomainsResult.Domains[0]?.Id),
        };
    });
    
    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)
    		nameRegex, err := directmail.GetDomains(ctx, &directmail.GetDomainsArgs{
    			NameRegex: pulumi.StringRef("^my-Domain"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("directMailDomainId2", nameRegex.Domains[0].Id)
    		example, err := directmail.GetDomains(ctx, &directmail.GetDomainsArgs{
    			Status:  pulumi.StringRef("1"),
    			KeyWord: pulumi.StringRef("^my-Domain"),
    			Ids: []string{
    				"example_id",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("directMailDomainId3", example.Domains[0].Id)
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.directmail.DirectmailFunctions;
    import com.pulumi.alicloud.directmail.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 ids = DirectmailFunctions.getDomains(GetDomainsArgs.builder()
                .ids("example_id")
                .build());
    
            ctx.export("directMailDomainId1", ids.applyValue(getDomainsResult -> getDomainsResult.domains()[0].id()));
            final var nameRegex = DirectmailFunctions.getDomains(GetDomainsArgs.builder()
                .nameRegex("^my-Domain")
                .build());
    
            ctx.export("directMailDomainId2", nameRegex.applyValue(getDomainsResult -> getDomainsResult.domains()[0].id()));
            final var example = DirectmailFunctions.getDomains(GetDomainsArgs.builder()
                .status("1")
                .keyWord("^my-Domain")
                .ids("example_id")
                .build());
    
            ctx.export("directMailDomainId3", example.applyValue(getDomainsResult -> getDomainsResult.domains()[0].id()));
        }
    }
    
    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);
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:directmail:getDomains
          Arguments:
            ids:
              - example_id
      nameRegex:
        fn::invoke:
          Function: alicloud:directmail:getDomains
          Arguments:
            nameRegex: ^my-Domain
      example:
        fn::invoke:
          Function: alicloud:directmail:getDomains
          Arguments:
            status: '1'
            keyWord: ^my-Domain
            ids:
              - example_id
    outputs:
      directMailDomainId1: ${ids.domains[0].id}
      directMailDomainId2: ${nameRegex.domains[0].id}
      directMailDomainId3: ${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)
    }
    public static CompletableFuture<GetDomainsResult> getDomains(GetDomainsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:directmail/getDomains:getDomains
      arguments:
        # arguments dictionary

    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

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

    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

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

    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 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

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

    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

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

    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

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

    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.

    enableDetails Boolean

    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

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

    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.

    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 List<GetDomainsDomain>
    id String

    The provider-assigned unique ID for this managed resource.

    ids List<String>
    names List<String>
    enableDetails Boolean
    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
    domains List<Property Map>
    id String

    The provider-assigned unique ID for this managed resource.

    ids List<String>
    names List<String>
    enableDetails Boolean
    keyWord String
    nameRegex String
    outputFile String
    status String

    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.

    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.

    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.

    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.45.0 published on Monday, Nov 27, 2023 by Pulumi