Domain
Provides a DCDN Domain resource. Full station accelerated domain name. For information about DCDN Domain and how to use it, see What is Domain.
NOTE: Available since v1.94.0. NOTE: Field
force_set
,security_token
has been removed from provider version 1.227.1.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
import * as random from "@pulumi/random";
const config = new pulumi.Config();
const domainName = config.get("domainName") || "tf-example.com";
const _default = new random.index.Integer("default", {
min: 10000,
max: 99999,
});
const example = new alicloud.dcdn.Domain("example", {
domainName: `${domainName}-${_default.result}`,
scope: "overseas",
sources: [{
content: "1.1.1.1",
port: 80,
priority: "20",
type: "ipaddr",
weight: "10",
}],
});
import pulumi
import pulumi_alicloud as alicloud
import pulumi_random as random
config = pulumi.Config()
domain_name = config.get("domainName")
if domain_name is None:
domain_name = "tf-example.com"
default = random.index.Integer("default",
min=10000,
max=99999)
example = alicloud.dcdn.Domain("example",
domain_name=f"{domain_name}-{default['result']}",
scope="overseas",
sources=[{
"content": "1.1.1.1",
"port": 80,
"priority": "20",
"type": "ipaddr",
"weight": "10",
}])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
using Random = Pulumi.Random;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var domainName = config.Get("domainName") ?? "tf-example.com";
var @default = new Random.Index.Integer("default", new()
{
Min = 10000,
Max = 99999,
});
var example = new AliCloud.Dcdn.Domain("example", new()
{
DomainName = $"{domainName}-{@default.Result}",
Scope = "overseas",
Sources = new[]
{
new AliCloud.Dcdn.Inputs.DomainSourceArgs
{
Content = "1.1.1.1",
Port = 80,
Priority = "20",
Type = "ipaddr",
Weight = "10",
},
},
});
});
package main
import (
"fmt"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/dcdn"
"github.com/pulumi/pulumi-random/sdk/v4/go/random"
"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, "")
domainName := "tf-example.com"
if param := cfg.Get("domainName"); param != "" {
domainName = param
}
_default, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
Min: 10000,
Max: 99999,
})
if err != nil {
return err
}
_, err = dcdn.NewDomain(ctx, "example", &dcdn.DomainArgs{
DomainName: pulumi.Sprintf("%v-%v", domainName, _default.Result),
Scope: pulumi.String("overseas"),
Sources: dcdn.DomainSourceArray{
&dcdn.DomainSourceArgs{
Content: pulumi.String("1.1.1.1"),
Port: pulumi.Int(80),
Priority: pulumi.String("20"),
Type: pulumi.String("ipaddr"),
Weight: pulumi.String("10"),
},
},
})
if err != nil {
return err
}
return nil
})
}
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.dcdn.Domain;
import com.pulumi.alicloud.dcdn.DomainArgs;
import com.pulumi.alicloud.dcdn.inputs.DomainSourceArgs;
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 config = ctx.config();
final var domainName = config.get("domainName").orElse("tf-example.com");
var default_ = new Integer("default", IntegerArgs.builder()
.min(10000)
.max(99999)
.build());
var example = new Domain("example", DomainArgs.builder()
.domainName(String.format("%s-%s", domainName,default_.result()))
.scope("overseas")
.sources(DomainSourceArgs.builder()
.content("1.1.1.1")
.port("80")
.priority("20")
.type("ipaddr")
.weight("10")
.build())
.build());
}
}
configuration:
domainName:
type: string
default: tf-example.com
resources:
default:
type: random:integer
properties:
min: 10000
max: 99999
example:
type: alicloud:dcdn:Domain
properties:
domainName: ${domainName}-${default.result}
scope: overseas
sources:
- content: 1.1.1.1
port: '80'
priority: '20'
type: ipaddr
weight: '10'
Import
DCDN Domain can be imported using the id, e.g.
$ pulumi import alicloud:dcdn/domain:Domain example <id>
Properties
The region of the SSL certificate. This parameter takes effect only when CertType
is set to cas
. Default value: cn-hangzhou. Valid values: cn-hangzhou and ap-southeast-1.
The time when the accelerated domain name was created.
The accelerated domain name. You can specify multiple domain names and separate them with commas (,). You can specify up to 500 domain names in each request. The query results of multiple domain names are aggregated. If you do not specify this parameter, data of all accelerated domain names under your account is queried.
Computing service type. Valid values:
The ID of the resource group. If you do not specify a value for this parameter, the system automatically assigns the ID of the default resource group.
Source See sources
below.
Specifies whether to enable the SSL certificate. Valid values:
The top-level domain.