1. Registry
  2. Packages
  3. Alibaba Cloud Provider
  4. API Docs
  5. apig
  6. getDomains
Viewing docs for Alibaba Cloud v3.106.0
published on Monday, Aug 24, 2026 by Pulumi
alicloud logo alicloud logo
Viewing docs for Alibaba Cloud v3.106.0
published on Monday, Aug 24, 2026 by Pulumi

    This data source provides Apig Domain available to the user.What is Domain

    NOTE: Available since v1.284.0.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const defaultDomain = new alicloud.apig.Domain("default", {
        domainName: "example-domain.example.com",
        gatewayType: "API",
        protocol: "HTTP",
    });
    const _default = alicloud.apig.getDomainsOutput({
        ids: [defaultDomain.id],
        nameRegex: defaultDomain.domainName,
        resourceGroupId: "",
    });
    export const alicloudApigDomainExampleId = _default.apply(_default => _default.domains?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default_domain = alicloud.apig.Domain("default",
        domain_name="example-domain.example.com",
        gateway_type="API",
        protocol="HTTP")
    default = alicloud.apig.get_domains_output(ids=[default_domain.id],
        name_regex=default_domain.domain_name,
        resource_group_id="")
    pulumi.export("alicloudApigDomainExampleId", default.domains[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/apig"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		defaultDomain, err := apig.NewDomain(ctx, "default", &apig.DomainArgs{
    			DomainName:  pulumi.String("example-domain.example.com"),
    			GatewayType: pulumi.String("API"),
    			Protocol:    pulumi.String("HTTP"),
    		})
    		if err != nil {
    			return err
    		}
    		_default := apig.GetDomainsOutput(ctx, apig.GetDomainsOutputArgs{
    			Ids: pulumi.StringArray{
    				defaultDomain.ID().ToIDOutput().ToStringOutput(),
    			},
    			NameRegex:       defaultDomain.DomainName,
    			ResourceGroupId: pulumi.String(""),
    		}, nil)
    		ctx.Export("alicloudApigDomainExampleId", _default.ApplyT(func(_default apig.GetDomainsResult) (*string, error) {
    			return _default.Domains[0].Id, nil
    		}).(pulumi.StringPtrOutput))
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var defaultDomain = new AliCloud.Apig.Domain("default", new()
        {
            DomainName = "example-domain.example.com",
            GatewayType = "API",
            Protocol = "HTTP",
        });
    
        var @default = AliCloud.Apig.GetDomains.Invoke(new()
        {
            Ids = new[]
            {
                defaultDomain.Id,
            },
            NameRegex = defaultDomain.DomainName,
            ResourceGroupId = "",
        });
    
        return new Dictionary<string, object?>
        {
            ["alicloudApigDomainExampleId"] = @default.Apply(@default => @default.Apply(getDomainsResult => getDomainsResult.Domains[0]?.Id)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.apig.Domain;
    import com.pulumi.alicloud.apig.DomainArgs;
    import com.pulumi.alicloud.apig.ApigFunctions;
    import com.pulumi.alicloud.apig.inputs.GetDomainsArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 config = ctx.config();
            final var name = config.get("name").orElse("terraform-example");
            var defaultDomain = new Domain("defaultDomain", DomainArgs.builder()
                .domainName("example-domain.example.com")
                .gatewayType("API")
                .protocol("HTTP")
                .build());
    
            final var default = ApigFunctions.getDomains(GetDomainsArgs.builder()
                .ids(defaultDomain.id())
                .nameRegex(defaultDomain.domainName())
                .resourceGroupId("")
                .build());
    
            ctx.export("alicloudApigDomainExampleId", default_.applyValue(_default_ -> _default_.domains()[0].id()));
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      defaultDomain:
        type: alicloud:apig:Domain
        name: default
        properties:
          domainName: example-domain.example.com
          gatewayType: API
          protocol: HTTP
    variables:
      default:
        fn::invoke:
          function: alicloud:apig:getDomains
          arguments:
            ids:
              - ${defaultDomain.id}
            nameRegex: ${defaultDomain.domainName}
            resourceGroupId: ""
    outputs:
      alicloudApigDomainExampleId: ${default.domains[0].id}
    
    pulumi {
      required_providers {
        alicloud = {
          source = "pulumi/alicloud"
        }
      }
    }
    
    data "alicloud_apig_getdomains" "default" {
      ids               = [alicloud_apig_domain.default.id]
      name_regex        = alicloud_apig_domain.default.domain_name
      resource_group_id = ""
    }
    
    resource "alicloud_apig_domain" "default" {
      domain_name  = "example-domain.example.com"
      gateway_type = "API"
      protocol     = "HTTP"
    }
    variable "name" {
      type    = string
      default = "terraform-example"
    }
    output "alicloudApigDomainExampleId" {
      value = data.alicloud_apig_getdomains.default.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?: InvokeOutputOptions): Output<GetDomainsResult>
    def get_domains(enable_details: Optional[bool] = None,
                    ids: Optional[Sequence[str]] = None,
                    name_regex: Optional[str] = None,
                    output_file: Optional[str] = None,
                    resource_group_id: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetDomainsResult
    def get_domains_output(enable_details: pulumi.Input[Optional[bool]] = None,
                    ids: pulumi.Input[Optional[Sequence[pulumi.Input[str]]]] = None,
                    name_regex: pulumi.Input[Optional[str]] = None,
                    output_file: pulumi.Input[Optional[str]] = None,
                    resource_group_id: pulumi.Input[Optional[str]] = None,
                    opts: Optional[InvokeOutputOptions] = 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 Output<GetDomainsResult> Invoke(GetDomainsInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetDomainsResult> getDomains(GetDomainsArgs args, InvokeOptions options)
    public static Output<GetDomainsResult> getDomains(GetDomainsArgs args, InvokeOptions options)
    public static Output<GetDomainsResult> getDomains(GetDomainsArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: alicloud:apig/getDomains:getDomains
      arguments:
        # arguments dictionary
    data "alicloud_apig_get_domains" "name" {
        # arguments
    }

    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.
    NameRegex string
    A regex string to filter results by Group Metric Rule name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ResourceGroupId string
    The ID of the resource group
    EnableDetails bool
    Default to false. Set it to true can output more details about resource attributes.
    Ids []string
    A list of Domain IDs.
    NameRegex string
    A regex string to filter results by Group Metric Rule name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ResourceGroupId string
    The ID of the resource group
    enable_details bool
    Default to false. Set it to true can output more details about resource attributes.
    ids list(string)
    A list of Domain IDs.
    name_regex string
    A regex string to filter results by Group Metric Rule name.
    output_file string
    File name where to save data source results (after running pulumi preview).
    resource_group_id string
    The ID of the resource group
    enableDetails Boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids List<String>
    A list of Domain IDs.
    nameRegex String
    A regex string to filter results by Group Metric Rule name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    resourceGroupId String
    The ID of the resource group
    enableDetails boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids string[]
    A list of Domain IDs.
    nameRegex string
    A regex string to filter results by Group Metric Rule name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    resourceGroupId string
    The ID of the resource group
    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.
    name_regex str
    A regex string to filter results by Group Metric Rule name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    resource_group_id str
    The ID of the resource group
    enableDetails Boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids List<String>
    A list of Domain IDs.
    nameRegex String
    A regex string to filter results by Group Metric Rule name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    resourceGroupId String
    The ID of the resource group

    getDomains Result

    The following output properties are available:

    Domains List<Pulumi.AliCloud.Apig.Outputs.GetDomainsDomain>
    A list of Domain Entries. 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 name of Domains.
    EnableDetails bool
    NameRegex string
    OutputFile string
    ResourceGroupId string
    The ID of the resource group.
    Domains []GetDomainsDomain
    A list of Domain Entries. 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 name of Domains.
    EnableDetails bool
    NameRegex string
    OutputFile string
    ResourceGroupId string
    The ID of the resource group.
    domains list(object)
    A list of Domain Entries. 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 name of Domains.
    enable_details bool
    name_regex string
    output_file string
    resource_group_id string
    The ID of the resource group.
    domains List<GetDomainsDomain>
    A list of Domain Entries. 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 name of Domains.
    enableDetails Boolean
    nameRegex String
    outputFile String
    resourceGroupId String
    The ID of the resource group.
    domains GetDomainsDomain[]
    A list of Domain Entries. 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 name of Domains.
    enableDetails boolean
    nameRegex string
    outputFile string
    resourceGroupId string
    The ID of the resource group.
    domains Sequence[GetDomainsDomain]
    A list of Domain Entries. 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 name of Domains.
    enable_details bool
    name_regex str
    output_file str
    resource_group_id str
    The ID of the resource group.
    domains List<Property Map>
    A list of Domain Entries. 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 name of Domains.
    enableDetails Boolean
    nameRegex String
    outputFile String
    resourceGroupId String
    The ID of the resource group.

    Supporting Types

    GetDomainsDomain

    CaCertIdentifier string
    NOTE: This field is only available when enableDetails is true. CA certificate identifier.
    CertIdentifier string
    tls cert identifier.
    ClientCaCert string
    client CA certificate.
    DomainId string
    domain id.
    DomainName string
    domain name.
    DomainScope string
    domain scope.
    ForceHttps bool
    Set the HTTPS protocol type and whether to enable forced HTTPS redirection.
    Http2Option string
    NOTE: This field is only available when enableDetails is true. Whether to enable http2 settings.
    Id string
    The ID of the resource supplied above.
    MTlsEnabled bool
    Whether to enable mTLS mutual authentication.
    Protocol string
    Protocol, HTTP/HTTPS.
    ResourceGroupId string
    The ID of the resource group
    TlsCipherSuitesConfigs List<Pulumi.AliCloud.Apig.Inputs.GetDomainsDomainTlsCipherSuitesConfig>
    NOTE: This field is only available when enableDetails is true. TlsCipherSuitesConfig.
    TlsMax string
    NOTE: This field is only available when enableDetails is true. The maximum version of the TLS protocol.
    TlsMin string
    NOTE: This field is only available when enableDetails is true. The minimum version of the TLS protocol.
    CaCertIdentifier string
    NOTE: This field is only available when enableDetails is true. CA certificate identifier.
    CertIdentifier string
    tls cert identifier.
    ClientCaCert string
    client CA certificate.
    DomainId string
    domain id.
    DomainName string
    domain name.
    DomainScope string
    domain scope.
    ForceHttps bool
    Set the HTTPS protocol type and whether to enable forced HTTPS redirection.
    Http2Option string
    NOTE: This field is only available when enableDetails is true. Whether to enable http2 settings.
    Id string
    The ID of the resource supplied above.
    MTlsEnabled bool
    Whether to enable mTLS mutual authentication.
    Protocol string
    Protocol, HTTP/HTTPS.
    ResourceGroupId string
    The ID of the resource group
    TlsCipherSuitesConfigs []GetDomainsDomainTlsCipherSuitesConfig
    NOTE: This field is only available when enableDetails is true. TlsCipherSuitesConfig.
    TlsMax string
    NOTE: This field is only available when enableDetails is true. The maximum version of the TLS protocol.
    TlsMin string
    NOTE: This field is only available when enableDetails is true. The minimum version of the TLS protocol.
    ca_cert_identifier string
    NOTE: This field is only available when enableDetails is true. CA certificate identifier.
    cert_identifier string
    tls cert identifier.
    client_ca_cert string
    client CA certificate.
    domain_id string
    domain id.
    domain_name string
    domain name.
    domain_scope string
    domain scope.
    force_https bool
    Set the HTTPS protocol type and whether to enable forced HTTPS redirection.
    http2_option string
    NOTE: This field is only available when enableDetails is true. Whether to enable http2 settings.
    id string
    The ID of the resource supplied above.
    m_tls_enabled bool
    Whether to enable mTLS mutual authentication.
    protocol string
    Protocol, HTTP/HTTPS.
    resource_group_id string
    The ID of the resource group
    tls_cipher_suites_configs list(object)
    NOTE: This field is only available when enableDetails is true. TlsCipherSuitesConfig.
    tls_max string
    NOTE: This field is only available when enableDetails is true. The maximum version of the TLS protocol.
    tls_min string
    NOTE: This field is only available when enableDetails is true. The minimum version of the TLS protocol.
    caCertIdentifier String
    NOTE: This field is only available when enableDetails is true. CA certificate identifier.
    certIdentifier String
    tls cert identifier.
    clientCaCert String
    client CA certificate.
    domainId String
    domain id.
    domainName String
    domain name.
    domainScope String
    domain scope.
    forceHttps Boolean
    Set the HTTPS protocol type and whether to enable forced HTTPS redirection.
    http2Option String
    NOTE: This field is only available when enableDetails is true. Whether to enable http2 settings.
    id String
    The ID of the resource supplied above.
    mTlsEnabled Boolean
    Whether to enable mTLS mutual authentication.
    protocol String
    Protocol, HTTP/HTTPS.
    resourceGroupId String
    The ID of the resource group
    tlsCipherSuitesConfigs List<GetDomainsDomainTlsCipherSuitesConfig>
    NOTE: This field is only available when enableDetails is true. TlsCipherSuitesConfig.
    tlsMax String
    NOTE: This field is only available when enableDetails is true. The maximum version of the TLS protocol.
    tlsMin String
    NOTE: This field is only available when enableDetails is true. The minimum version of the TLS protocol.
    caCertIdentifier string
    NOTE: This field is only available when enableDetails is true. CA certificate identifier.
    certIdentifier string
    tls cert identifier.
    clientCaCert string
    client CA certificate.
    domainId string
    domain id.
    domainName string
    domain name.
    domainScope string
    domain scope.
    forceHttps boolean
    Set the HTTPS protocol type and whether to enable forced HTTPS redirection.
    http2Option string
    NOTE: This field is only available when enableDetails is true. Whether to enable http2 settings.
    id string
    The ID of the resource supplied above.
    mTlsEnabled boolean
    Whether to enable mTLS mutual authentication.
    protocol string
    Protocol, HTTP/HTTPS.
    resourceGroupId string
    The ID of the resource group
    tlsCipherSuitesConfigs GetDomainsDomainTlsCipherSuitesConfig[]
    NOTE: This field is only available when enableDetails is true. TlsCipherSuitesConfig.
    tlsMax string
    NOTE: This field is only available when enableDetails is true. The maximum version of the TLS protocol.
    tlsMin string
    NOTE: This field is only available when enableDetails is true. The minimum version of the TLS protocol.
    ca_cert_identifier str
    NOTE: This field is only available when enableDetails is true. CA certificate identifier.
    cert_identifier str
    tls cert identifier.
    client_ca_cert str
    client CA certificate.
    domain_id str
    domain id.
    domain_name str
    domain name.
    domain_scope str
    domain scope.
    force_https bool
    Set the HTTPS protocol type and whether to enable forced HTTPS redirection.
    http2_option str
    NOTE: This field is only available when enableDetails is true. Whether to enable http2 settings.
    id str
    The ID of the resource supplied above.
    m_tls_enabled bool
    Whether to enable mTLS mutual authentication.
    protocol str
    Protocol, HTTP/HTTPS.
    resource_group_id str
    The ID of the resource group
    tls_cipher_suites_configs Sequence[GetDomainsDomainTlsCipherSuitesConfig]
    NOTE: This field is only available when enableDetails is true. TlsCipherSuitesConfig.
    tls_max str
    NOTE: This field is only available when enableDetails is true. The maximum version of the TLS protocol.
    tls_min str
    NOTE: This field is only available when enableDetails is true. The minimum version of the TLS protocol.
    caCertIdentifier String
    NOTE: This field is only available when enableDetails is true. CA certificate identifier.
    certIdentifier String
    tls cert identifier.
    clientCaCert String
    client CA certificate.
    domainId String
    domain id.
    domainName String
    domain name.
    domainScope String
    domain scope.
    forceHttps Boolean
    Set the HTTPS protocol type and whether to enable forced HTTPS redirection.
    http2Option String
    NOTE: This field is only available when enableDetails is true. Whether to enable http2 settings.
    id String
    The ID of the resource supplied above.
    mTlsEnabled Boolean
    Whether to enable mTLS mutual authentication.
    protocol String
    Protocol, HTTP/HTTPS.
    resourceGroupId String
    The ID of the resource group
    tlsCipherSuitesConfigs List<Property Map>
    NOTE: This field is only available when enableDetails is true. TlsCipherSuitesConfig.
    tlsMax String
    NOTE: This field is only available when enableDetails is true. The maximum version of the TLS protocol.
    tlsMin String
    NOTE: This field is only available when enableDetails is true. The minimum version of the TLS protocol.

    GetDomainsDomainTlsCipherSuitesConfig

    ConfigType string
    config type, Default or Custom.
    TlsCipherSuites []GetDomainsDomainTlsCipherSuitesConfigTlsCipherSuite
    tls Cipher Suite.
    config_type string
    config type, Default or Custom.
    tls_cipher_suites list(object)
    tls Cipher Suite.
    configType String
    config type, Default or Custom.
    tlsCipherSuites List<GetDomainsDomainTlsCipherSuitesConfigTlsCipherSuite>
    tls Cipher Suite.
    configType string
    config type, Default or Custom.
    tlsCipherSuites GetDomainsDomainTlsCipherSuitesConfigTlsCipherSuite[]
    tls Cipher Suite.
    configType String
    config type, Default or Custom.
    tlsCipherSuites List<Property Map>
    tls Cipher Suite.

    GetDomainsDomainTlsCipherSuitesConfigTlsCipherSuite

    Name string
    cipher suite name.
    SupportVersions List<string>
    support versions.
    Name string
    cipher suite name.
    SupportVersions []string
    support versions.
    name string
    cipher suite name.
    support_versions list(string)
    support versions.
    name String
    cipher suite name.
    supportVersions List<String>
    support versions.
    name string
    cipher suite name.
    supportVersions string[]
    support versions.
    name str
    cipher suite name.
    support_versions Sequence[str]
    support versions.
    name String
    cipher suite name.
    supportVersions List<String>
    support versions.

    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 alicloud logo
    Viewing docs for Alibaba Cloud v3.106.0
    published on Monday, Aug 24, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial