1. Packages
  2. Packages
  3. Alibaba Cloud Provider
  4. API Docs
  5. cdn
  6. getDomainConfigs
Viewing docs for Alibaba Cloud v3.104.0
published on Thursday, Jun 25, 2026 by Pulumi
alicloud logo
Viewing docs for Alibaba Cloud v3.104.0
published on Thursday, Jun 25, 2026 by Pulumi

    This data source provides the Cdn Domain Configs of the current Alibaba Cloud user.

    NOTE: Available since v1.279.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    import * as random from "@pulumi/random";
    
    const _default = new random.index.Integer("default", {
        min: 10000,
        max: 99999,
    });
    const defaultDomainNew = new alicloud.cdn.DomainNew("default", {
        domainName: `mycdndomain-${_default.result}.alicloud-provider.cn`,
        cdnType: "web",
        scope: "overseas",
        sources: [{
            content: "1.1.1.1",
            type: "ipaddr",
            priority: 20,
            port: 80,
            weight: 15,
        }],
    });
    const defaultDomainConfig = new alicloud.cdn.DomainConfig("default", {
        domainName: defaultDomainNew.domainName,
        functionName: "ip_allow_list_set",
        functionArgs: [{
            argName: "ip_list",
            argValue: "110.110.110.110",
        }],
    });
    const ids = alicloud.cdn.getDomainConfigsOutput({
        domainName: defaultDomainConfig.domainName,
        ids: [defaultDomainConfig.id],
    });
    export const cdnDomainConfigsId0 = ids.apply(ids => ids.configs?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    import pulumi_random as random
    
    default = random.Integer("default",
        min=10000,
        max=99999)
    default_domain_new = alicloud.cdn.DomainNew("default",
        domain_name=f"mycdndomain-{default['result']}.alicloud-provider.cn",
        cdn_type="web",
        scope="overseas",
        sources=[{
            "content": "1.1.1.1",
            "type": "ipaddr",
            "priority": 20,
            "port": 80,
            "weight": 15,
        }])
    default_domain_config = alicloud.cdn.DomainConfig("default",
        domain_name=default_domain_new.domain_name,
        function_name="ip_allow_list_set",
        function_args=[{
            "arg_name": "ip_list",
            "arg_value": "110.110.110.110",
        }])
    ids = alicloud.cdn.get_domain_configs_output(domain_name=default_domain_config.domain_name,
        ids=[default_domain_config.id])
    pulumi.export("cdnDomainConfigsId0", ids.configs[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cdn"
    	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_default, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
    			Min: 10000,
    			Max: 99999,
    		})
    		if err != nil {
    			return err
    		}
    		defaultDomainNew, err := cdn.NewDomainNew(ctx, "default", &cdn.DomainNewArgs{
    			DomainName: pulumi.Sprintf("mycdndomain-%v.alicloud-provider.cn", _default.Result),
    			CdnType:    pulumi.String("web"),
    			Scope:      pulumi.String("overseas"),
    			Sources: cdn.DomainNewSourceArray{
    				&cdn.DomainNewSourceArgs{
    					Content:  pulumi.String("1.1.1.1"),
    					Type:     pulumi.String("ipaddr"),
    					Priority: pulumi.Int(20),
    					Port:     pulumi.Int(80),
    					Weight:   pulumi.Int(15),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		defaultDomainConfig, err := cdn.NewDomainConfig(ctx, "default", &cdn.DomainConfigArgs{
    			DomainName:   defaultDomainNew.DomainName,
    			FunctionName: pulumi.String("ip_allow_list_set"),
    			FunctionArgs: cdn.DomainConfigFunctionArgArray{
    				&cdn.DomainConfigFunctionArgArgs{
    					ArgName:  pulumi.String("ip_list"),
    					ArgValue: pulumi.String("110.110.110.110"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		ids := cdn.GetDomainConfigsOutput(ctx, cdn.GetDomainConfigsOutputArgs{
    			DomainName: defaultDomainConfig.DomainName,
    			Ids: pulumi.StringArray{
    				defaultDomainConfig.ID(),
    			},
    		}, nil)
    		ctx.Export("cdnDomainConfigsId0", ids.ApplyT(func(ids cdn.GetDomainConfigsResult) (*string, error) {
    			return ids.Configs[0].Id, nil
    		}).(pulumi.StringPtrOutput))
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    using Random = Pulumi.Random;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = new Random.Integer("default", new()
        {
            Min = 10000,
            Max = 99999,
        });
    
        var defaultDomainNew = new AliCloud.Cdn.DomainNew("default", new()
        {
            DomainName = $"mycdndomain-{@default.Result}.alicloud-provider.cn",
            CdnType = "web",
            Scope = "overseas",
            Sources = new[]
            {
                new AliCloud.Cdn.Inputs.DomainNewSourceArgs
                {
                    Content = "1.1.1.1",
                    Type = "ipaddr",
                    Priority = 20,
                    Port = 80,
                    Weight = 15,
                },
            },
        });
    
        var defaultDomainConfig = new AliCloud.Cdn.DomainConfig("default", new()
        {
            DomainName = defaultDomainNew.DomainName,
            FunctionName = "ip_allow_list_set",
            FunctionArgs = new[]
            {
                new AliCloud.Cdn.Inputs.DomainConfigFunctionArgArgs
                {
                    ArgName = "ip_list",
                    ArgValue = "110.110.110.110",
                },
            },
        });
    
        var ids = AliCloud.Cdn.GetDomainConfigs.Invoke(new()
        {
            DomainName = defaultDomainConfig.DomainName,
            Ids = new[]
            {
                defaultDomainConfig.Id,
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["cdnDomainConfigsId0"] = ids.Apply(getDomainConfigsResult => getDomainConfigsResult.Configs[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.random.Integer;
    import com.pulumi.random.IntegerArgs;
    import com.pulumi.alicloud.cdn.DomainNew;
    import com.pulumi.alicloud.cdn.DomainNewArgs;
    import com.pulumi.alicloud.cdn.inputs.DomainNewSourceArgs;
    import com.pulumi.alicloud.cdn.DomainConfig;
    import com.pulumi.alicloud.cdn.DomainConfigArgs;
    import com.pulumi.alicloud.cdn.inputs.DomainConfigFunctionArgArgs;
    import com.pulumi.alicloud.cdn.CdnFunctions;
    import com.pulumi.alicloud.cdn.inputs.GetDomainConfigsArgs;
    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) {
            var default_ = new Integer("default", IntegerArgs.builder()
                .min(10000)
                .max(99999)
                .build());
    
            var defaultDomainNew = new DomainNew("defaultDomainNew", DomainNewArgs.builder()
                .domainName(String.format("mycdndomain-%s.alicloud-provider.cn", default_.result()))
                .cdnType("web")
                .scope("overseas")
                .sources(DomainNewSourceArgs.builder()
                    .content("1.1.1.1")
                    .type("ipaddr")
                    .priority(20)
                    .port(80)
                    .weight(15)
                    .build())
                .build());
    
            var defaultDomainConfig = new DomainConfig("defaultDomainConfig", DomainConfigArgs.builder()
                .domainName(defaultDomainNew.domainName())
                .functionName("ip_allow_list_set")
                .functionArgs(DomainConfigFunctionArgArgs.builder()
                    .argName("ip_list")
                    .argValue("110.110.110.110")
                    .build())
                .build());
    
            final var ids = CdnFunctions.getDomainConfigs(GetDomainConfigsArgs.builder()
                .domainName(defaultDomainConfig.domainName())
                .ids(defaultDomainConfig.id())
                .build());
    
            ctx.export("cdnDomainConfigsId0", ids.applyValue(_ids -> _ids.configs()[0].id()));
        }
    }
    
    resources:
      default:
        type: random:Integer
        properties:
          min: 10000
          max: 99999
      defaultDomainNew:
        type: alicloud:cdn:DomainNew
        name: default
        properties:
          domainName: mycdndomain-${default.result}.alicloud-provider.cn
          cdnType: web
          scope: overseas
          sources:
            - content: 1.1.1.1
              type: ipaddr
              priority: '20'
              port: 80
              weight: '15'
      defaultDomainConfig:
        type: alicloud:cdn:DomainConfig
        name: default
        properties:
          domainName: ${defaultDomainNew.domainName}
          functionName: ip_allow_list_set
          functionArgs:
            - argName: ip_list
              argValue: 110.110.110.110
    variables:
      ids:
        fn::invoke:
          function: alicloud:cdn:getDomainConfigs
          arguments:
            domainName: ${defaultDomainConfig.domainName}
            ids:
              - ${defaultDomainConfig.id}
    outputs:
      cdnDomainConfigsId0: ${ids.configs[0].id}
    
    pulumi {
      required_providers {
        alicloud = {
          source = "pulumi/alicloud"
        }
        random = {
          source = "pulumi/random"
        }
      }
    }
    
    data "alicloud_cdn_getdomainconfigs" "ids" {
      domain_name = alicloud_cdn_domainconfig.default.domain_name
      ids         = [alicloud_cdn_domainconfig.default.id]
    }
    
    resource "random_integer" "default" {
      min = 10000
      max = 99999
    }
    resource "alicloud_cdn_domainnew" "default" {
      domain_name ="mycdndomain-${random_integer.default.result}.alicloud-provider.cn"
      cdn_type    = "web"
      scope       = "overseas"
      sources {
        content  = "1.1.1.1"
        type     = "ipaddr"
        priority = "20"
        port     = 80
        weight   = "15"
      }
    }
    resource "alicloud_cdn_domainconfig" "default" {
      domain_name   = alicloud_cdn_domainnew.default.domain_name
      function_name = "ip_allow_list_set"
      function_args {
        arg_name  = "ip_list"
        arg_value = "110.110.110.110"
      }
    }
    output "cdnDomainConfigsId0" {
      value = data.alicloud_cdn_getdomainconfigs.ids.configs[0].id
    }
    

    Using getDomainConfigs

    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 getDomainConfigs(args: GetDomainConfigsArgs, opts?: InvokeOptions): Promise<GetDomainConfigsResult>
    function getDomainConfigsOutput(args: GetDomainConfigsOutputArgs, opts?: InvokeOptions): Output<GetDomainConfigsResult>
    def get_domain_configs(config_id: Optional[str] = None,
                           domain_name: Optional[str] = None,
                           function_name: Optional[str] = None,
                           ids: Optional[Sequence[str]] = None,
                           name_regex: Optional[str] = None,
                           output_file: Optional[str] = None,
                           status: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetDomainConfigsResult
    def get_domain_configs_output(config_id: pulumi.Input[Optional[str]] = None,
                           domain_name: pulumi.Input[Optional[str]] = None,
                           function_name: pulumi.Input[Optional[str]] = None,
                           ids: pulumi.Input[Optional[Sequence[pulumi.Input[str]]]] = None,
                           name_regex: pulumi.Input[Optional[str]] = None,
                           output_file: pulumi.Input[Optional[str]] = None,
                           status: pulumi.Input[Optional[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetDomainConfigsResult]
    func GetDomainConfigs(ctx *Context, args *GetDomainConfigsArgs, opts ...InvokeOption) (*GetDomainConfigsResult, error)
    func GetDomainConfigsOutput(ctx *Context, args *GetDomainConfigsOutputArgs, opts ...InvokeOption) GetDomainConfigsResultOutput

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

    public static class GetDomainConfigs 
    {
        public static Task<GetDomainConfigsResult> InvokeAsync(GetDomainConfigsArgs args, InvokeOptions? opts = null)
        public static Output<GetDomainConfigsResult> Invoke(GetDomainConfigsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDomainConfigsResult> getDomainConfigs(GetDomainConfigsArgs args, InvokeOptions options)
    public static Output<GetDomainConfigsResult> getDomainConfigs(GetDomainConfigsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: alicloud:cdn/getDomainConfigs:getDomainConfigs
      arguments:
        # arguments dictionary
    data "alicloud_cdn_getdomainconfigs" "name" {
        # arguments
    }

    The following arguments are supported:

    DomainName string
    The accelerated domain name.
    ConfigId string
    The ID of the feature configuration.
    FunctionName string
    The names of the features. Separate multiple feature names with commas (,).
    Ids List<string>
    A list of Domain Config IDs.
    NameRegex string
    A regex string to filter results by Domain Config name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status string
    The status of the configuration. Valid values: success, testing, failed, configuring.
    DomainName string
    The accelerated domain name.
    ConfigId string
    The ID of the feature configuration.
    FunctionName string
    The names of the features. Separate multiple feature names with commas (,).
    Ids []string
    A list of Domain Config IDs.
    NameRegex string
    A regex string to filter results by Domain Config name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status string
    The status of the configuration. Valid values: success, testing, failed, configuring.
    domain_name string
    The accelerated domain name.
    config_id string
    The ID of the feature configuration.
    function_name string
    The names of the features. Separate multiple feature names with commas (,).
    ids list(string)
    A list of Domain Config IDs.
    name_regex string
    A regex string to filter results by Domain Config name.
    output_file string
    File name where to save data source results (after running pulumi preview).
    status string
    The status of the configuration. Valid values: success, testing, failed, configuring.
    domainName String
    The accelerated domain name.
    configId String
    The ID of the feature configuration.
    functionName String
    The names of the features. Separate multiple feature names with commas (,).
    ids List<String>
    A list of Domain Config IDs.
    nameRegex String
    A regex string to filter results by Domain Config name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status String
    The status of the configuration. Valid values: success, testing, failed, configuring.
    domainName string
    The accelerated domain name.
    configId string
    The ID of the feature configuration.
    functionName string
    The names of the features. Separate multiple feature names with commas (,).
    ids string[]
    A list of Domain Config IDs.
    nameRegex string
    A regex string to filter results by Domain Config name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    status string
    The status of the configuration. Valid values: success, testing, failed, configuring.
    domain_name str
    The accelerated domain name.
    config_id str
    The ID of the feature configuration.
    function_name str
    The names of the features. Separate multiple feature names with commas (,).
    ids Sequence[str]
    A list of Domain Config IDs.
    name_regex str
    A regex string to filter results by Domain Config name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    status str
    The status of the configuration. Valid values: success, testing, failed, configuring.
    domainName String
    The accelerated domain name.
    configId String
    The ID of the feature configuration.
    functionName String
    The names of the features. Separate multiple feature names with commas (,).
    ids List<String>
    A list of Domain Config IDs.
    nameRegex String
    A regex string to filter results by Domain Config name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status String
    The status of the configuration. Valid values: success, testing, failed, configuring.

    getDomainConfigs Result

    The following output properties are available:

    Configs List<Pulumi.AliCloud.Cdn.Outputs.GetDomainConfigsConfig>
    A list of Domain Configs. Each element contains the following attributes:
    DomainName string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    A list of Domain Config names.
    ConfigId string
    The ID of the feature configuration.
    FunctionName string
    The name of the feature.
    NameRegex string
    OutputFile string
    Status string
    The status of the configuration.
    Configs []GetDomainConfigsConfig
    A list of Domain Configs. Each element contains the following attributes:
    DomainName string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    A list of Domain Config names.
    ConfigId string
    The ID of the feature configuration.
    FunctionName string
    The name of the feature.
    NameRegex string
    OutputFile string
    Status string
    The status of the configuration.
    configs list(object)
    A list of Domain Configs. Each element contains the following attributes:
    domain_name string
    id string
    The provider-assigned unique ID for this managed resource.
    ids list(string)
    names list(string)
    A list of Domain Config names.
    config_id string
    The ID of the feature configuration.
    function_name string
    The name of the feature.
    name_regex string
    output_file string
    status string
    The status of the configuration.
    configs List<GetDomainConfigsConfig>
    A list of Domain Configs. Each element contains the following attributes:
    domainName String
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    A list of Domain Config names.
    configId String
    The ID of the feature configuration.
    functionName String
    The name of the feature.
    nameRegex String
    outputFile String
    status String
    The status of the configuration.
    configs GetDomainConfigsConfig[]
    A list of Domain Configs. Each element contains the following attributes:
    domainName string
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    A list of Domain Config names.
    configId string
    The ID of the feature configuration.
    functionName string
    The name of the feature.
    nameRegex string
    outputFile string
    status string
    The status of the configuration.
    configs Sequence[GetDomainConfigsConfig]
    A list of Domain Configs. Each element contains the following attributes:
    domain_name str
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    A list of Domain Config names.
    config_id str
    The ID of the feature configuration.
    function_name str
    The name of the feature.
    name_regex str
    output_file str
    status str
    The status of the configuration.
    configs List<Property Map>
    A list of Domain Configs. Each element contains the following attributes:
    domainName String
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    A list of Domain Config names.
    configId String
    The ID of the feature configuration.
    functionName String
    The name of the feature.
    nameRegex String
    outputFile String
    status String
    The status of the configuration.

    Supporting Types

    GetDomainConfigsConfig

    ConfigId string
    The ID of the feature configuration.
    FunctionArgs List<Pulumi.AliCloud.Cdn.Inputs.GetDomainConfigsConfigFunctionArg>
    The args of the domain config.
    FunctionName string
    The names of the features. Separate multiple feature names with commas (,).
    Id string
    The ID of the Domain Config.
    ParentId string
    The ID of the rule condition.
    Status string
    The status of the configuration. Valid values: success, testing, failed, configuring.
    ConfigId string
    The ID of the feature configuration.
    FunctionArgs []GetDomainConfigsConfigFunctionArg
    The args of the domain config.
    FunctionName string
    The names of the features. Separate multiple feature names with commas (,).
    Id string
    The ID of the Domain Config.
    ParentId string
    The ID of the rule condition.
    Status string
    The status of the configuration. Valid values: success, testing, failed, configuring.
    config_id string
    The ID of the feature configuration.
    function_args list(object)
    The args of the domain config.
    function_name string
    The names of the features. Separate multiple feature names with commas (,).
    id string
    The ID of the Domain Config.
    parent_id string
    The ID of the rule condition.
    status string
    The status of the configuration. Valid values: success, testing, failed, configuring.
    configId String
    The ID of the feature configuration.
    functionArgs List<GetDomainConfigsConfigFunctionArg>
    The args of the domain config.
    functionName String
    The names of the features. Separate multiple feature names with commas (,).
    id String
    The ID of the Domain Config.
    parentId String
    The ID of the rule condition.
    status String
    The status of the configuration. Valid values: success, testing, failed, configuring.
    configId string
    The ID of the feature configuration.
    functionArgs GetDomainConfigsConfigFunctionArg[]
    The args of the domain config.
    functionName string
    The names of the features. Separate multiple feature names with commas (,).
    id string
    The ID of the Domain Config.
    parentId string
    The ID of the rule condition.
    status string
    The status of the configuration. Valid values: success, testing, failed, configuring.
    config_id str
    The ID of the feature configuration.
    function_args Sequence[GetDomainConfigsConfigFunctionArg]
    The args of the domain config.
    function_name str
    The names of the features. Separate multiple feature names with commas (,).
    id str
    The ID of the Domain Config.
    parent_id str
    The ID of the rule condition.
    status str
    The status of the configuration. Valid values: success, testing, failed, configuring.
    configId String
    The ID of the feature configuration.
    functionArgs List<Property Map>
    The args of the domain config.
    functionName String
    The names of the features. Separate multiple feature names with commas (,).
    id String
    The ID of the Domain Config.
    parentId String
    The ID of the rule condition.
    status String
    The status of the configuration. Valid values: success, testing, failed, configuring.

    GetDomainConfigsConfigFunctionArg

    ArgName string
    The name of arg.
    ArgValue string
    The value of arg.
    ArgName string
    The name of arg.
    ArgValue string
    The value of arg.
    arg_name string
    The name of arg.
    arg_value string
    The value of arg.
    argName String
    The name of arg.
    argValue String
    The value of arg.
    argName string
    The name of arg.
    argValue string
    The value of arg.
    arg_name str
    The name of arg.
    arg_value str
    The value of arg.
    argName String
    The name of arg.
    argValue String
    The value of arg.

    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
    Viewing docs for Alibaba Cloud v3.104.0
    published on Thursday, Jun 25, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial