Domain Resource Args
Provides a Anti-DDoS Pro Domain Resource resource. For information about Anti-DDoS Pro Domain Resource and how to use it, see What is Domain Resource.
NOTE: Available since v1.123.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "tf-example";
const domain = config.get("domain") || "tf-example.alibaba.com";
const _default = new alicloud.ddos.DdosCooInstance("default", {
name: name,
bandwidth: "30",
baseBandwidth: "30",
serviceBandwidth: "100",
portCount: "50",
domainCount: "50",
period: 1,
productType: "ddoscoo",
});
const defaultDomainResource = new alicloud.ddos.DomainResource("default", {
domain: domain,
rsType: 0,
instanceIds: [_default.id],
realServers: ["177.167.32.11"],
httpsExt: "{\"Http2\":1,\"Http2https\":0,\"Https2http\":0}",
proxyTypes: [{
proxyPorts: [443],
proxyType: "https",
}],
});import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tf-example"
domain = config.get("domain")
if domain is None:
domain = "tf-example.alibaba.com"
default = alicloud.ddos.DdosCooInstance("default",
name=name,
bandwidth="30",
base_bandwidth="30",
service_bandwidth="100",
port_count="50",
domain_count="50",
period=1,
product_type="ddoscoo")
default_domain_resource = alicloud.ddos.DomainResource("default",
domain=domain,
rs_type=0,
instance_ids=[default.id],
real_servers=["177.167.32.11"],
https_ext="{\"Http2\":1,\"Http2https\":0,\"Https2http\":0}",
proxy_types=[alicloud.ddos.DomainResourceProxyTypeArgs(
proxy_ports=[443],
proxy_type="https",
)])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") ?? "tf-example";
var domain = config.Get("domain") ?? "tf-example.alibaba.com";
var @default = new AliCloud.Ddos.DdosCooInstance("default", new()
{
Name = name,
Bandwidth = "30",
BaseBandwidth = "30",
ServiceBandwidth = "100",
PortCount = "50",
DomainCount = "50",
Period = 1,
ProductType = "ddoscoo",
});
var defaultDomainResource = new AliCloud.Ddos.DomainResource("default", new()
{
Domain = domain,
RsType = 0,
InstanceIds = new[]
{
@default.Id,
},
RealServers = new[]
{
"177.167.32.11",
},
HttpsExt = "{\"Http2\":1,\"Http2https\":0,\"Https2http\":0}",
ProxyTypes = new[]
{
new AliCloud.Ddos.Inputs.DomainResourceProxyTypeArgs
{
ProxyPorts = new[]
{
443,
},
ProxyType = "https",
},
},
});
});package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ddos"
"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 := "tf-example"
if param := cfg.Get("name"); param != "" {
name = param
}
domain := "tf-example.alibaba.com"
if param := cfg.Get("domain"); param != "" {
domain = param
}
_, err := ddos.NewDdosCooInstance(ctx, "default", &ddos.DdosCooInstanceArgs{
Name: pulumi.String(name),
Bandwidth: pulumi.String("30"),
BaseBandwidth: pulumi.String("30"),
ServiceBandwidth: pulumi.String("100"),
PortCount: pulumi.String("50"),
DomainCount: pulumi.String("50"),
Period: pulumi.Int(1),
ProductType: pulumi.String("ddoscoo"),
})
if err != nil {
return err
}
_, err = ddos.NewDomainResource(ctx, "default", &ddos.DomainResourceArgs{
Domain: pulumi.String(domain),
RsType: pulumi.Int(0),
InstanceIds: pulumi.StringArray{
_default.ID(),
},
RealServers: pulumi.StringArray{
pulumi.String("177.167.32.11"),
},
HttpsExt: pulumi.String("{\"Http2\":1,\"Http2https\":0,\"Https2http\":0}"),
ProxyTypes: ddos.DomainResourceProxyTypeArray{
&ddos.DomainResourceProxyTypeArgs{
ProxyPorts: pulumi.IntArray{
pulumi.Int(443),
},
ProxyType: pulumi.String("https"),
},
},
})
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.alicloud.ddos.DdosCooInstance;
import com.pulumi.alicloud.ddos.DdosCooInstanceArgs;
import com.pulumi.alicloud.ddos.DomainResource;
import com.pulumi.alicloud.ddos.DomainResourceArgs;
import com.pulumi.alicloud.ddos.inputs.DomainResourceProxyTypeArgs;
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 name = config.get("name").orElse("tf-example");
final var domain = config.get("domain").orElse("tf-example.alibaba.com");
var default_ = new DdosCooInstance("default", DdosCooInstanceArgs.builder()
.name(name)
.bandwidth("30")
.baseBandwidth("30")
.serviceBandwidth("100")
.portCount("50")
.domainCount("50")
.period("1")
.productType("ddoscoo")
.build());
var defaultDomainResource = new DomainResource("defaultDomainResource", DomainResourceArgs.builder()
.domain(domain)
.rsType(0)
.instanceIds(default_.id())
.realServers("177.167.32.11")
.httpsExt("{\"Http2\":1,\"Http2https\":0,\"Https2http\":0}")
.proxyTypes(DomainResourceProxyTypeArgs.builder()
.proxyPorts(443)
.proxyType("https")
.build())
.build());
}
}configuration:
name:
type: string
default: tf-example
domain:
type: string
default: tf-example.alibaba.com
resources:
default:
type: alicloud:ddos:DdosCooInstance
properties:
name: ${name}
bandwidth: '30'
baseBandwidth: '30'
serviceBandwidth: '100'
portCount: '50'
domainCount: '50'
period: '1'
productType: ddoscoo
defaultDomainResource:
type: alicloud:ddos:DomainResource
name: default
properties:
domain: ${domain}
rsType: 0
instanceIds:
- ${default.id}
realServers:
- 177.167.32.11
httpsExt: '{"Http2":1,"Http2https":0,"Https2http":0}'
proxyTypes:
- proxyPorts:
- 443
proxyType: httpsImport
Anti-DDoS Pro Domain Resource can be imported using the id, e.g.
$ pulumi import alicloud:ddos/domainResource:DomainResource example <domain>Properties
A list of instance ID that you want to associate. If this parameter is empty, only the domain name of the website is added but no instance is associated with the website.
Specifies whether to enable the OCSP feature. Default value: false. Valid values:
Protocol type and port number information. See proxy_types below.
the IP address. This field is required and must be a string array.
The address type of the origin server. Use the domain name of the origin server if you deploy proxies, such as Web Application Firewall (WAF), between the origin server and the Anti-DDoS Pro or Anti-DDoS Premium instance. If you use the domain name, you must enter the address of the proxy, such as the CNAME of WAF. Valid values: