Domain
DEPRECATED: This resource has been deprecated and using alicloud.wafv3.Domain instead. Provides a WAF Domain resource to create domain in the Web Application Firewall. For information about WAF and how to use it, see What is Alibaba Cloud WAF. NOTE: Available since v1.82.0.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const domain = new alicloud.waf.Domain("domain", {
domainName: "alicloud-provider.cn",
instanceId: "waf-123455",
isAccessProduct: "On",
sourceIps: ["1.1.1.1"],
clusterType: "PhysicalCluster",
http2Ports: ["443"],
httpPorts: ["80"],
httpsPorts: ["443"],
httpToUserIp: "Off",
httpsRedirect: "Off",
loadBalancing: "IpHash",
logHeaders: [{
key: "foo",
value: "http",
}],
});
import pulumi
import pulumi_alicloud as alicloud
domain = alicloud.waf.Domain("domain",
domain_name="alicloud-provider.cn",
instance_id="waf-123455",
is_access_product="On",
source_ips=["1.1.1.1"],
cluster_type="PhysicalCluster",
http2_ports=["443"],
http_ports=["80"],
https_ports=["443"],
http_to_user_ip="Off",
https_redirect="Off",
load_balancing="IpHash",
log_headers=[{
"key": "foo",
"value": "http",
}])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var domain = new AliCloud.Waf.Domain("domain", new()
{
DomainName = "alicloud-provider.cn",
InstanceId = "waf-123455",
IsAccessProduct = "On",
SourceIps = new[]
{
"1.1.1.1",
},
ClusterType = "PhysicalCluster",
Http2Ports = new[]
{
"443",
},
HttpPorts = new[]
{
"80",
},
HttpsPorts = new[]
{
"443",
},
HttpToUserIp = "Off",
HttpsRedirect = "Off",
LoadBalancing = "IpHash",
LogHeaders = new[]
{
new AliCloud.Waf.Inputs.DomainLogHeaderArgs
{
Key = "foo",
Value = "http",
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/waf"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := waf.NewDomain(ctx, "domain", &waf.DomainArgs{
DomainName: pulumi.String("alicloud-provider.cn"),
InstanceId: pulumi.String("waf-123455"),
IsAccessProduct: pulumi.String("On"),
SourceIps: pulumi.StringArray{
pulumi.String("1.1.1.1"),
},
ClusterType: pulumi.String("PhysicalCluster"),
Http2Ports: pulumi.StringArray{
pulumi.String("443"),
},
HttpPorts: pulumi.StringArray{
pulumi.String("80"),
},
HttpsPorts: pulumi.StringArray{
pulumi.String("443"),
},
HttpToUserIp: pulumi.String("Off"),
HttpsRedirect: pulumi.String("Off"),
LoadBalancing: pulumi.String("IpHash"),
LogHeaders: waf.DomainLogHeaderArray{
&waf.DomainLogHeaderArgs{
Key: pulumi.String("foo"),
Value: pulumi.String("http"),
},
},
})
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.waf.Domain;
import com.pulumi.alicloud.waf.DomainArgs;
import com.pulumi.alicloud.waf.inputs.DomainLogHeaderArgs;
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) {
var domain = new Domain("domain", DomainArgs.builder()
.domainName("alicloud-provider.cn")
.instanceId("waf-123455")
.isAccessProduct("On")
.sourceIps("1.1.1.1")
.clusterType("PhysicalCluster")
.http2Ports("443")
.httpPorts("80")
.httpsPorts("443")
.httpToUserIp("Off")
.httpsRedirect("Off")
.loadBalancing("IpHash")
.logHeaders(DomainLogHeaderArgs.builder()
.key("foo")
.value("http")
.build())
.build());
}
}
resources:
domain:
type: alicloud:waf:Domain
properties:
domainName: alicloud-provider.cn
instanceId: waf-123455
isAccessProduct: On
sourceIps:
- 1.1.1.1
clusterType: PhysicalCluster
http2Ports:
- 443
httpPorts:
- 80
httpsPorts:
- 443
httpToUserIp: Off
httpsRedirect: Off
loadBalancing: IpHash
logHeaders:
- key: foo
value: http
Import
WAF domain can be imported using the id, e.g.
$ pulumi import alicloud:waf/domain:Domain domain waf-132435:www.domain.com
Properties
The type of the WAF cluster. Valid values: PhysicalCluster
and VirtualCluster
. Default to PhysicalCluster
.
The connection timeout for WAF exclusive clusters. Unit: seconds.
The domain that you want to add to WAF. The domain_name
is required when the value of the domain
is Empty.
List of the HTTP 2.0 ports.
List of the HTTPS ports.
Specifies whether to redirect HTTP requests as HTTPS requests. Valid values: "On" and Off
. Default to Off
.
Specifies whether to enable the HTTP back-to-origin feature. After this feature is enabled, the WAF instance can use HTTP to forward HTTPS requests to the origin server. By default, port 80 is used to forward the requests to the origin server. Valid values: On
and Off
. Default to Off
.
The ID of the WAF instance.
Specifies whether to configure a Layer-7 proxy, such as Anti-DDoS Pro or CDN, to filter the inbound traffic before it is forwarded to WAF. Valid values: On
and Off
. Default to Off
.
The load balancing algorithm that is used to forward requests to the origin. Valid values: IpHash
and RoundRobin
. Default to IpHash
.
The key-value pair that is used to mark the traffic that flows through WAF to the domain. Each item contains two field:
The ID of the resource group to which the queried domain belongs in Resource Management. By default, no value is specified, indicating that the domain belongs to the default resource group.