alicloud.slb.DomainExtension
Explore with Pulumi AI
HTTPS listeners of guaranteed-performance SLB support configuring multiple certificates, allowing you to forward requests with different domain names to different backend servers. Please refer to the documentation for details.
NOTE: Available in 1.60.0+
NOTE: The instance with shared loadBalancerSpec doesn’t support domainExtension.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const slbDomainExtensionName = config.get("slbDomainExtensionName") || "forDomainExtension";
const domainExtension = alicloud.getZones({
availableResourceCreation: "VSwitch",
});
const domainExtensionNetwork = new alicloud.vpc.Network("domain_extension", {vpcName: slbDomainExtensionName});
const domainExtensionSwitch = new alicloud.vpc.Switch("domain_extension", {
vpcId: domainExtensionNetwork.id,
cidrBlock: "172.16.0.0/21",
zoneId: domainExtension.then(domainExtension => domainExtension.zones?.[0]?.id),
vswitchName: slbDomainExtensionName,
});
const instance = new alicloud.slb.ApplicationLoadBalancer("instance", {
loadBalancerName: slbDomainExtensionName,
addressType: "intranet",
loadBalancerSpec: "slb.s2.small",
vswitchId: domainExtensionSwitch.id,
});
const domainExtensionServerCertificate = new alicloud.slb.ServerCertificate("domain_extension", {
name: "tf-testAccSlbServerCertificate",
serverCertificate: `-----BEGIN CERTIFICATE-----
MIIDdjCCAl4CCQCcm+erkcKN7DANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJj
bjELMAkGA1UECAwCYmoxEDAOBgNVBAcMB2JlaWppbmcxDzANBgNVBAoMBmFsaXl1
bjELMAkGA1UECwwCc2MxFTATBgNVBAMMDHd3dy50ZXN0LmNvbTEaMBgGCSqGSIb3
DQEJARYLMTIzQDEyMy5jb20wHhcNMTkwNDI2MDM0ODAxWhcNMjQwNDI1MDM0ODAx
WjB9MQswCQYDVQQGEwJjbjELMAkGA1UECAwCYmoxEDAOBgNVBAcMB2JlaWppbmcx
DzANBgNVBAoMBmFsaXl1bjELMAkGA1UECwwCc2MxFTATBgNVBAMMDHd3dy50ZXN0
LmNvbTEaMBgGC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3D2rJyQi5NCo/
ZjunA92/JqOTGuiFcLGHEszhhtY3ZXJET1LNz18vtzKJnpqrvOnYXlOVW/U+SqDQ
8JDb1c/PVZGuY1KrXkR9HLiW3kz5IJ3S3PFdUVYdeTN8BQxXCyg4V12nJJtJs912
y0zN3wKBgGDS6YttCN6aI4EOABYE8fI1EYQ7vhfiYsaWGWSR1l6bQey7KR6M1ACz
ZzMASNyytVt12yXE4/Emv6/pYqigbDLfL1zQJSLJ3EHJYTh2RxjR+AaGDudYFG/T
liQ9YXhV5Iu2x1pNwrtFnssDdaaGpfA7l3xC00BL7Z+SAJyI4QKA
-----END RSA PRIVATE KEY-----`,
});
const https = new alicloud.slb.Listener("https", {
loadBalancerId: instance.id,
backendPort: 80,
frontendPort: 443,
protocol: "https",
stickySession: "on",
stickySessionType: "insert",
cookie: "testslblistenercookie",
cookieTimeout: 86400,
healthCheck: "on",
healthCheckUri: "/cons",
healthCheckConnectPort: 20,
healthyThreshold: 8,
unhealthyThreshold: 8,
healthCheckTimeout: 8,
healthCheckInterval: 5,
healthCheckHttpCode: "http_2xx,http_3xx",
bandwidth: 10,
serverCertificateId: domainExtensionServerCertificate.id,
});
const example1 = new alicloud.slb.DomainExtension("example1", {
loadBalancerId: instance.id,
frontendPort: https.frontendPort,
domain: "www.test.com",
serverCertificateId: domainExtensionServerCertificate.id,
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
slb_domain_extension_name = config.get("slbDomainExtensionName")
if slb_domain_extension_name is None:
slb_domain_extension_name = "forDomainExtension"
domain_extension = alicloud.get_zones(available_resource_creation="VSwitch")
domain_extension_network = alicloud.vpc.Network("domain_extension", vpc_name=slb_domain_extension_name)
domain_extension_switch = alicloud.vpc.Switch("domain_extension",
vpc_id=domain_extension_network.id,
cidr_block="172.16.0.0/21",
zone_id=domain_extension.zones[0].id,
vswitch_name=slb_domain_extension_name)
instance = alicloud.slb.ApplicationLoadBalancer("instance",
load_balancer_name=slb_domain_extension_name,
address_type="intranet",
load_balancer_spec="slb.s2.small",
vswitch_id=domain_extension_switch.id)
domain_extension_server_certificate = alicloud.slb.ServerCertificate("domain_extension",
name="tf-testAccSlbServerCertificate",
server_certificate="""-----BEGIN CERTIFICATE-----
MIIDdjCCAl4CCQCcm+erkcKN7DANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJj
bjELMAkGA1UECAwCYmoxEDAOBgNVBAcMB2JlaWppbmcxDzANBgNVBAoMBmFsaXl1
bjELMAkGA1UECwwCc2MxFTATBgNVBAMMDHd3dy50ZXN0LmNvbTEaMBgGCSqGSIb3
DQEJARYLMTIzQDEyMy5jb20wHhcNMTkwNDI2MDM0ODAxWhcNMjQwNDI1MDM0ODAx
WjB9MQswCQYDVQQGEwJjbjELMAkGA1UECAwCYmoxEDAOBgNVBAcMB2JlaWppbmcx
DzANBgNVBAoMBmFsaXl1bjELMAkGA1UECwwCc2MxFTATBgNVBAMMDHd3dy50ZXN0
LmNvbTEaMBgGCSqGSIb3DQEJARYLMTIzQDEyMy5jb20wggEiMA0GCSqGSIb3DQEB
AQUAA4IBDwAwggEKAoIBAQDKMKF5qmN/uoMjdH3D8aPRcUOA0s8rZpYhG8zbkF1j
8gHYoB/FDvM7G7dfVsyjbMwLOxKvAhWvHHSpEz/t7gB+QdwrAMiMJwGmtCnXrh2E
WiXgalMe1y4a/T5R7q+m4T1zFATf+kbnHWfkSGF4W7b6UBoaH+9StQ95CnqzNf/2
p/Of7+S0XzCxFXw8GIVzZk0xFe6lHJzaq06f3mvzrD+4rpO56tTUvrgTY/n61gsF
ZP7f0CJ2JQh6eNRFOEUSfxKu/Dy/+IsQxorCJY2Q59ZAf3rXrqDN104jw9PlwnLl
qfZz3RMODN6BWjxE8rvRtT0qMfuAfv1gjBdWZN0hUYBRAgMBAAEwDQYJKoZIhvcN
AQELBQADggEBAABzo82TxGp5poVkd5pLWj5ACgcBv8Cs6oH9D+4Jz9BmyuBUsQXh
2aG0hQAe1mU61C9konsl/GTW8umJQ4M4lYEzt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A224S
k3BxtX2Kq6fhTXuwusAFc6OVMAZ76FgrQ5K4Ci7+DTsrF28z4b8td+p+lO/DxgP9
lTgN+ddsiTOV4fUef9Z3yY0Zr0CnBUMbQYRaV2UIbCdiB0G4V/bt9TsCgYEA0bya
Oo9wGI0RJV0bYP7qwO74Ra1/i1viWbRlS7jU37Q+AZstrlKcQ5CTPzOjKFKMiUzl
4miWacZ0/q2n+Mvd7NbXGXTLijahnyOYKaHJYyh4oBymfkgAifRstE0Ki9gdvArb
/I+emC0GvLSyfGN8UUeDJs4NmqdEXGqjo2JOV+MCgYALFv1MR5o9Y1u/hQBRs2fs
PiGDIx+9OUQxYloccyaxEfjNXAIGGkcpavchIbgWiJ++PJ2vdquIC8TLeK8evL+M
9M3iX0Q5UfxYvD2HmnCvn9D6Xl/cyRcfGnq+TGjrLW9BzSMGuZt+aiHKV0xqFx7l
bc4leTvMqGRmURS4lzcQOwKBgQCDzA/i4sYfN25h21tcHXSpnsG3D2rJyQi5NCo/
ZjunA92/JqOTGuiFcLGHEszhhtY3ZXJET1LNz18vtzKJnpqrvOnYXlOVW/U+SqDQ
8JDb1c/PVZGuY1KrXkR9HLiW3kz5IJ3S3PFdUVYdeTN8BQxXCyg4V12nJJtJs912
y0zN3wKBgGDS6YttCN6aI4EOABYE8fI1EYQ7vhfiYsaWGWSR1l6bQey7KR6M1ACz
ZzMASNyytVt12yXE4/Emv6/pYqigbDLfL1zQJSLJ3EHJYTh2RxjR+AaGDudYFG/T
liQ9YXhV5Iu2x1pNwrtFnssDdaaGpfA7l3xC00BL7Z+SAJyI4QKA
-----END RSA PRIVATE KEY-----""")
https = alicloud.slb.Listener("https",
load_balancer_id=instance.id,
backend_port=80,
frontend_port=443,
protocol="https",
sticky_session="on",
sticky_session_type="insert",
cookie="testslblistenercookie",
cookie_timeout=86400,
health_check="on",
health_check_uri="/cons",
health_check_connect_port=20,
healthy_threshold=8,
unhealthy_threshold=8,
health_check_timeout=8,
health_check_interval=5,
health_check_http_code="http_2xx,http_3xx",
bandwidth=10,
server_certificate_id=domain_extension_server_certificate.id)
example1 = alicloud.slb.DomainExtension("example1",
load_balancer_id=instance.id,
frontend_port=https.frontend_port,
domain="www.test.com",
server_certificate_id=domain_extension_server_certificate.id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/slb"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"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, "")
slbDomainExtensionName := "forDomainExtension"
if param := cfg.Get("slbDomainExtensionName"); param != "" {
slbDomainExtensionName = param
}
domainExtension, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
AvailableResourceCreation: pulumi.StringRef("VSwitch"),
}, nil)
if err != nil {
return err
}
domainExtensionNetwork, err := vpc.NewNetwork(ctx, "domain_extension", &vpc.NetworkArgs{
VpcName: pulumi.String(slbDomainExtensionName),
})
if err != nil {
return err
}
domainExtensionSwitch, err := vpc.NewSwitch(ctx, "domain_extension", &vpc.SwitchArgs{
VpcId: domainExtensionNetwork.ID(),
CidrBlock: pulumi.String("172.16.0.0/21"),
ZoneId: pulumi.String(domainExtension.Zones[0].Id),
VswitchName: pulumi.String(slbDomainExtensionName),
})
if err != nil {
return err
}
instance, err := slb.NewApplicationLoadBalancer(ctx, "instance", &slb.ApplicationLoadBalancerArgs{
LoadBalancerName: pulumi.String(slbDomainExtensionName),
AddressType: pulumi.String("intranet"),
LoadBalancerSpec: pulumi.String("slb.s2.small"),
VswitchId: domainExtensionSwitch.ID(),
})
if err != nil {
return err
}
domainExtensionServerCertificate, err := slb.NewServerCertificate(ctx, "domain_extension", &slb.ServerCertificateArgs{
Name: pulumi.String("tf-testAccSlbServerCertificate"),
ServerCertificate: pulumi.String(`-----BEGIN CERTI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UMbQYRaV2UIbCdiB0G4V/bt9TsCgYEA0bya
Oo9wGI0RJV0bYP7qwO74Ra1/i1viWbRlS7jU37Q+AZstrlKcQ5CTPzOjKFKMiUzl
4miWacZ0/q2n+Mvd7NbXGXTLijahnyOYKaHJYyh4oBymfkgAifRstE0Ki9gdvArb
/I+emC0GvLSyfGN8UUeDJs4NmqdEXGqjo2JOV+MCgYALFv1MR5o9Y1u/hQBRs2fs
PiGDIx+9OUQxYloccyaxEfjNXAIGGkcpavchIbgWiJ++PJ2vdquIC8TLeK8evL+M
9M3iX0Q5UfxYvD2HmnCvn9D6Xl/cyRcfGnq+TGjrLW9BzSMGuZt+aiHKV0xqFx7l
bc4leTvMqGRmURS4lzcQOwKBgQCDzA/i4sYfN25h21tcHXSpnsG3D2rJyQi5NCo/
ZjunA92/JqOTGuiFcLGHEszhhtY3ZXJET1LNz18vtzKJnpqrvOnYXlOVW/U+SqDQ
8JDb1c/PVZGuY1KrXkR9HLiW3kz5IJ3S3PFdUVYdeTN8BQxXCyg4V12nJJtJs912
y0zN3wKBgGDS6YttCN6aI4EOABYE8fI1EYQ7vhfiYsaWGWSR1l6bQey7KR6M1ACz
ZzMASNyytVt12yXE4/Emv6/pYqigbDLfL1zQJSLJ3EHJYTh2RxjR+AaGDudYFG/T
liQ9YXhV5Iu2x1pNwrtFnssDdaaGpfA7l3xC00BL7Z+SAJyI4QKA
-----END RSA PRIVATE KEY-----`),
})
if err != nil {
return err
}
https, err := slb.NewListener(ctx, "https", &slb.ListenerArgs{
LoadBalancerId: instance.ID(),
BackendPort: pulumi.Int(80),
FrontendPort: pulumi.Int(443),
Protocol: pulumi.String("https"),
StickySession: pulumi.String("on"),
StickySessionType: pulumi.String("insert"),
Cookie: pulumi.String("testslblistenercookie"),
CookieTimeout: pulumi.Int(86400),
HealthCheck: pulumi.String("on"),
HealthCheckUri: pulumi.String("/cons"),
HealthCheckConnectPort: pulumi.Int(20),
HealthyThreshold: pulumi.Int(8),
UnhealthyThreshold: pulumi.Int(8),
HealthCheckTimeout: pulumi.Int(8),
HealthCheckInterval: pulumi.Int(5),
HealthCheckHttpCode: pulumi.String("http_2xx,http_3xx"),
Bandwidth: pulumi.Int(10),
ServerCertificateId: domainExtensionServerCertificate.ID(),
})
if err != nil {
return err
}
_, err = slb.NewDomainExtension(ctx, "example1", &slb.DomainExtensionArgs{
LoadBalancerId: instance.ID(),
FrontendPort: https.FrontendPort,
Domain: pulumi.String("www.test.com"),
ServerCertificateId: domainExtensionServerCertificate.ID(),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var slbDomainExtensionName = config.Get("slbDomainExtensionName") ?? "forDomainExtension";
var domainExtension = AliCloud.GetZones.Invoke(new()
{
AvailableResourceCreation = "VSwitch",
});
var domainExtensionNetwork = new AliCloud.Vpc.Network("domain_extension", new()
{
VpcName = slbDomainExtensionName,
});
var domainExtensionSwitch = new AliCloud.Vpc.Switch("domain_extension", new()
{
VpcId = domainExtensionNetwork.Id,
CidrBlock = "172.16.0.0/21",
ZoneId = domainExtension.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
VswitchName = slbDomainExtensionName,
});
var instance = new AliCloud.Slb.ApplicationLoadBalancer("instance", new()
{
LoadBalancerName = slbDomainExtensionName,
AddressType = "intranet",
LoadBalancerSpec = "slb.s2.small",
VswitchId = domainExtensionSwitch.Id,
});
var domainExtensionServerCertificate = new AliCloud.Slb.ServerCertificate("domain_extension", new()
{
Name = "tf-testAccSlbServerCertificate",
Certificate = @"-----BEGIN CERTIFICATE-----
MIIDdjCCAl4CCQCcm+erkcKN7DANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJj
bjELMAkGA1UECAwCYmoxEDAOBgNVBAcMB2JlaWppbmcxDzANBgNVBAoMBmFsaXl1
bjELMAkGA1UECwwCc2MxFTATBgNVBAMMDHd3dy50ZXN0LmNvbTEaMBg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Gqjo2JOV+MCgYALFv1MR5o9Y1u/hQBRs2fs
PiGDIx+9OUQxYloccyaxEfjNXAIGGkcpavchIbgWiJ++PJ2vdquIC8TLeK8evL+M
9M3iX0Q5UfxYvD2HmnCvn9D6Xl/cyRcfGnq+TGjrLW9BzSMGuZt+aiHKV0xqFx7l
bc4leTvMqGRmURS4lzcQOwKBgQCDzA/i4sYfN25h21tcHXSpnsG3D2rJyQi5NCo/
ZjunA92/JqOTGuiFcLGHEszhhtY3ZXJET1LNz18vtzKJnpqrvOnYXlOVW/U+SqDQ
8JDb1c/PVZGuY1KrXkR9HLiW3kz5IJ3S3PFdUVYdeTN8BQxXCyg4V12nJJtJs912
y0zN3wKBgGDS6YttCN6aI4EOABYE8fI1EYQ7vhfiYsaWGWSR1l6bQey7KR6M1ACz
ZzMASNyytVt12yXE4/Emv6/pYqigbDLfL1zQJSLJ3EHJYTh2RxjR+AaGDudYFG/T
liQ9YXhV5Iu2x1pNwrtFnssDdaaGpfA7l3xC00BL7Z+SAJyI4QKA
-----END RSA PRIVATE KEY-----",
});
var https = new AliCloud.Slb.Listener("https", new()
{
LoadBalancerId = instance.Id,
BackendPort = 80,
FrontendPort = 443,
Protocol = "https",
StickySession = "on",
StickySessionType = "insert",
Cookie = "testslblistenercookie",
CookieTimeout = 86400,
HealthCheck = "on",
HealthCheckUri = "/cons",
HealthCheckConnectPort = 20,
HealthyThreshold = 8,
UnhealthyThreshold = 8,
HealthCheckTimeout = 8,
HealthCheckInterval = 5,
HealthCheckHttpCode = "http_2xx,http_3xx",
Bandwidth = 10,
ServerCertificateId = domainExtensionServerCertificate.Id,
});
var example1 = new AliCloud.Slb.DomainExtension("example1", new()
{
LoadBalancerId = instance.Id,
FrontendPort = https.FrontendPort,
Domain = "www.test.com",
ServerCertificateId = domainExtensionServerCertificate.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetZonesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.slb.ApplicationLoadBalancer;
import com.pulumi.alicloud.slb.ApplicationLoadBalancerArgs;
import com.pulumi.alicloud.slb.ServerCertificate;
import com.pulumi.alicloud.slb.ServerCertificateArgs;
import com.pulumi.alicloud.slb.Listener;
import com.pulumi.alicloud.slb.ListenerArgs;
import com.pulumi.alicloud.slb.DomainExtension;
import com.pulumi.alicloud.slb.DomainExtensionArgs;
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 slbDomainExtensionName = config.get("slbDomainExtensionName").orElse("forDomainExtension");
final var domainExtension = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation("VSwitch")
.build());
var domainExtensionNetwork = new Network("domainExtensionNetwork", NetworkArgs.builder()
.vpcName(slbDomainExtensionName)
.build());
var domainExtensionSwitch = new Switch("domainExtensionSwitch", SwitchArgs.builder()
.vpcId(domainExtensionNetwork.id())
.cidrBlock("172.16.0.0/21")
.zoneId(domainExtension.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.vswitchName(slbDomainExtensionName)
.build());
var instance = new ApplicationLoadBalancer("instance", ApplicationLoadBalancerArgs.builder()
.loadBalancerName(slbDomainExtensionName)
.addressType("intranet")
.loadBalancerSpec("slb.s2.small")
.vswitchId(domainExtensionSwitch.id())
.build());
var domainExtensionServerCertificate = new ServerCertificate("domainExtensionServerCertificate", ServerCertificateArgs.builder()
.name("tf-testAccSlbServerCertificate")
.serverCertificate("""
-----BEGIN CERTIFICATE-----
MIIDdjCCAl4CCQCcm+erkcKN7DANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJj
b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ZstrlKcQ5CTPzOjKFKMiUzl
4miWacZ0/q2n+Mvd7NbXGXTLijahnyOYKaHJYyh4oBymfkgAifRstE0Ki9gdvArb
/I+emC0GvLSyfGN8UUeDJs4NmqdEXGqjo2JOV+MCgYALFv1MR5o9Y1u/hQBRs2fs
PiGDIx+9OUQxYloccyaxEfjNXAIGGkcpavchIbgWiJ++PJ2vdquIC8TLeK8evL+M
9M3iX0Q5UfxYvD2HmnCvn9D6Xl/cyRcfGnq+TGjrLW9BzSMGuZt+aiHKV0xqFx7l
bc4leTvMqGRmURS4lzcQOwKBgQCDzA/i4sYfN25h21tcHXSpnsG3D2rJyQi5NCo/
ZjunA92/JqOTGuiFcLGHEszhhtY3ZXJET1LNz18vtzKJnpqrvOnYXlOVW/U+SqDQ
8JDb1c/PVZGuY1KrXkR9HLiW3kz5IJ3S3PFdUVYdeTN8BQxXCyg4V12nJJtJs912
y0zN3wKBgGDS6YttCN6aI4EOABYE8fI1EYQ7vhfiYsaWGWSR1l6bQey7KR6M1ACz
ZzMASNyytVt12yXE4/Emv6/pYqigbDLfL1zQJSLJ3EHJYTh2RxjR+AaGDudYFG/T
liQ9YXhV5Iu2x1pNwrtFnssDdaaGpfA7l3xC00BL7Z+SAJyI4QKA
-----END RSA PRIVATE KEY----- """)
.build());
var https = new Listener("https", ListenerArgs.builder()
.loadBalancerId(instance.id())
.backendPort(80)
.frontendPort(443)
.protocol("https")
.stickySession("on")
.stickySessionType("insert")
.cookie("testslblistenercookie")
.cookieTimeout(86400)
.healthCheck("on")
.healthCheckUri("/cons")
.healthCheckConnectPort(20)
.healthyThreshold(8)
.unhealthyThreshold(8)
.healthCheckTimeout(8)
.healthCheckInterval(5)
.healthCheckHttpCode("http_2xx,http_3xx")
.bandwidth(10)
.serverCertificateId(domainExtensionServerCertificate.id())
.build());
var example1 = new DomainExtension("example1", DomainExtensionArgs.builder()
.loadBalancerId(instance.id())
.frontendPort(https.frontendPort())
.domain("www.test.com")
.serverCertificateId(domainExtensionServerCertificate.id())
.build());
}
}
configuration:
# Create a new load balancer and domain extension
slbDomainExtensionName:
type: string
default: forDomainExtension
resources:
domainExtensionNetwork:
type: alicloud:vpc:Network
name: domain_extension
properties:
vpcName: ${slbDomainExtensionName}
domainExtensionSwitch:
type: alicloud:vpc:Switch
name: domain_extension
properties:
vpcId: ${domainExtensionNetwork.id}
cidrBlock: 172.16.0.0/21
zoneId: ${domainExtension.zones[0].id}
vswitchName: ${slbDomainExtensionName}
instance:
type: alicloud:slb:ApplicationLoadBalancer
properties:
loadBalancerName: ${slbDomainExtensionName}
addressType: intranet
loadBalancerSpec: slb.s2.small
vswitchId: ${domainExtensionSwitch.id}
domainExtensionServerCertificate:
type: alicloud:slb:ServerCertificate
name: domain_extension
properties:
name: tf-testAccSlbServerCertificate
serverCertificate: |-
-----BEGIN CERTIFICATE-----
MIIDdjCCAl4CCQCcm+erkcKN7DANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJj
bjELMAkGA1UECAwCYmoxEDAOBgNVBAcMB2JlaWppbmcxDzANBgNVBAoMBmFsaXl1
bjELMAkGA1UECwwCc2MxFTATBgNVBAMMDHd3dy50ZXN0LmNvbTEaMBgGCSqGSIb3
DQEJARYLMTIzQDEyMy5jb20wHhcNMTkwNDI2MDM0ODAxWhcNMjQwNDI1MDM0ODAx
WjB9MQswCQYDVQQGEwJjbjELMAkGA1UECAwCYmoxEDAOBgNVBAcMB2JlaWppbmcx
DzANBgNVBAoMBmFsaXl1bjELMAkGA1UECwwCc2MxFTATBgNVBAMMDHd3dy50ZXN0
LmNvbTEaMBgGCSqGSIb3DQEJARYLMTIzQDEyMy5jb20wggEiMA0GCSqGSIb3DQEB
AQUAA4IBDwAwggEKAoIBAQDKMKF5qmN/uoMjdH3D8aPRcUOA0s8rZpYhG8zbkF1j
8gHYoB/FDvM7G7dfVsyjbMwLOxKvAhWvHHSpEz/t7gB+QdwrAMiMJwGmtCnXrh2E
WiXgalMe1y4a/T5R7q+m4T1zFATf+kbnHW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ytVt12yXE4/Emv6/pYqigbDLfL1zQJSLJ3EHJYTh2RxjR+AaGDudYFG/T
liQ9YXhV5Iu2x1pNwrtFnssDdaaGpfA7l3xC00BL7Z+SAJyI4QKA
-----END RSA PRIVATE KEY-----
https:
type: alicloud:slb:Listener
properties:
loadBalancerId: ${instance.id}
backendPort: 80
frontendPort: 443
protocol: https
stickySession: on
stickySessionType: insert
cookie: testslblistenercookie
cookieTimeout: 86400
healthCheck: on
healthCheckUri: /cons
healthCheckConnectPort: 20
healthyThreshold: 8
unhealthyThreshold: 8
healthCheckTimeout: 8
healthCheckInterval: 5
healthCheckHttpCode: http_2xx,http_3xx
bandwidth: 10
serverCertificateId: ${domainExtensionServerCertificate.id}
example1:
type: alicloud:slb:DomainExtension
properties:
loadBalancerId: ${instance.id}
frontendPort: ${https.frontendPort}
domain: www.test.com
serverCertificateId: ${domainExtensionServerCertificate.id}
variables:
domainExtension:
fn::invoke:
Function: alicloud:getZones
Arguments:
availableResourceCreation: VSwitch
Create DomainExtension Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DomainExtension(name: string, args: DomainExtensionArgs, opts?: CustomResourceOptions);
@overload
def DomainExtension(resource_name: str,
args: DomainExtensionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DomainExtension(resource_name: str,
opts: Optional[ResourceOptions] = None,
domain: Optional[str] = None,
frontend_port: Optional[int] = None,
load_balancer_id: Optional[str] = None,
server_certificate_id: Optional[str] = None,
delete_protection_validation: Optional[bool] = None)
func NewDomainExtension(ctx *Context, name string, args DomainExtensionArgs, opts ...ResourceOption) (*DomainExtension, error)
public DomainExtension(string name, DomainExtensionArgs args, CustomResourceOptions? opts = null)
public DomainExtension(String name, DomainExtensionArgs args)
public DomainExtension(String name, DomainExtensionArgs args, CustomResourceOptions options)
type: alicloud:slb:DomainExtension
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args DomainExtensionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args DomainExtensionArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args DomainExtensionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DomainExtensionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DomainExtensionArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var domainExtensionResource = new AliCloud.Slb.DomainExtension("domainExtensionResource", new()
{
Domain = "string",
FrontendPort = 0,
LoadBalancerId = "string",
ServerCertificateId = "string",
DeleteProtectionValidation = false,
});
example, err := slb.NewDomainExtension(ctx, "domainExtensionResource", &slb.DomainExtensionArgs{
Domain: pulumi.String("string"),
FrontendPort: pulumi.Int(0),
LoadBalancerId: pulumi.String("string"),
ServerCertificateId: pulumi.String("string"),
DeleteProtectionValidation: pulumi.Bool(false),
})
var domainExtensionResource = new DomainExtension("domainExtensionResource", DomainExtensionArgs.builder()
.domain("string")
.frontendPort(0)
.loadBalancerId("string")
.serverCertificateId("string")
.deleteProtectionValidation(false)
.build());
domain_extension_resource = alicloud.slb.DomainExtension("domainExtensionResource",
domain="string",
frontend_port=0,
load_balancer_id="string",
server_certificate_id="string",
delete_protection_validation=False)
const domainExtensionResource = new alicloud.slb.DomainExtension("domainExtensionResource", {
domain: "string",
frontendPort: 0,
loadBalancerId: "string",
serverCertificateId: "string",
deleteProtectionValidation: false,
});
type: alicloud:slb:DomainExtension
properties:
deleteProtectionValidation: false
domain: string
frontendPort: 0
loadBalancerId: string
serverCertificateId: string
DomainExtension Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The DomainExtension resource accepts the following input properties:
- Domain string
- The domain name.
- Frontend
Port int - The frontend port used by the HTTPS listener of the SLB instance. Valid values: 1–65535.
- Load
Balancer stringId - The ID of the SLB instance.
- Server
Certificate stringId - The ID of the certificate used by the domain name.
- Delete
Protection boolValidation - Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- Domain string
- The domain name.
- Frontend
Port int - The frontend port used by the HTTPS listener of the SLB instance. Valid values: 1–65535.
- Load
Balancer stringId - The ID of the SLB instance.
- Server
Certificate stringId - The ID of the certificate used by the domain name.
- Delete
Protection boolValidation - Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- domain String
- The domain name.
- frontend
Port Integer - The frontend port used by the HTTPS listener of the SLB instance. Valid values: 1–65535.
- load
Balancer StringId - The ID of the SLB instance.
- server
Certificate StringId - The ID of the certificate used by the domain name.
- delete
Protection BooleanValidation - Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- domain string
- The domain name.
- frontend
Port number - The frontend port used by the HTTPS listener of the SLB instance. Valid values: 1–65535.
- load
Balancer stringId - The ID of the SLB instance.
- server
Certificate stringId - The ID of the certificate used by the domain name.
- delete
Protection booleanValidation - Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- domain str
- The domain name.
- frontend_
port int - The frontend port used by the HTTPS listener of the SLB instance. Valid values: 1–65535.
- load_
balancer_ strid - The ID of the SLB instance.
- server_
certificate_ strid - The ID of the certificate used by the domain name.
- delete_
protection_ boolvalidation - Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- domain String
- The domain name.
- frontend
Port Number - The frontend port used by the HTTPS listener of the SLB instance. Valid values: 1–65535.
- load
Balancer StringId - The ID of the SLB instance.
- server
Certificate StringId - The ID of the certificate used by the domain name.
- delete
Protection BooleanValidation - Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
Outputs
All input properties are implicitly available as output properties. Additionally, the DomainExtension resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing DomainExtension Resource
Get an existing DomainExtension resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: DomainExtensionState, opts?: CustomResourceOptions): DomainExtension
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
delete_protection_validation: Optional[bool] = None,
domain: Optional[str] = None,
frontend_port: Optional[int] = None,
load_balancer_id: Optional[str] = None,
server_certificate_id: Optional[str] = None) -> DomainExtension
func GetDomainExtension(ctx *Context, name string, id IDInput, state *DomainExtensionState, opts ...ResourceOption) (*DomainExtension, error)
public static DomainExtension Get(string name, Input<string> id, DomainExtensionState? state, CustomResourceOptions? opts = null)
public static DomainExtension get(String name, Output<String> id, DomainExtensionState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Delete
Protection boolValidation - Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- Domain string
- The domain name.
- Frontend
Port int - The frontend port used by the HTTPS listener of the SLB instance. Valid values: 1–65535.
- Load
Balancer stringId - The ID of the SLB instance.
- Server
Certificate stringId - The ID of the certificate used by the domain name.
- Delete
Protection boolValidation - Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- Domain string
- The domain name.
- Frontend
Port int - The frontend port used by the HTTPS listener of the SLB instance. Valid values: 1–65535.
- Load
Balancer stringId - The ID of the SLB instance.
- Server
Certificate stringId - The ID of the certificate used by the domain name.
- delete
Protection BooleanValidation - Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- domain String
- The domain name.
- frontend
Port Integer - The frontend port used by the HTTPS listener of the SLB instance. Valid values: 1–65535.
- load
Balancer StringId - The ID of the SLB instance.
- server
Certificate StringId - The ID of the certificate used by the domain name.
- delete
Protection booleanValidation - Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- domain string
- The domain name.
- frontend
Port number - The frontend port used by the HTTPS listener of the SLB instance. Valid values: 1–65535.
- load
Balancer stringId - The ID of the SLB instance.
- server
Certificate stringId - The ID of the certificate used by the domain name.
- delete_
protection_ boolvalidation - Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- domain str
- The domain name.
- frontend_
port int - The frontend port used by the HTTPS listener of the SLB instance. Valid values: 1–65535.
- load_
balancer_ strid - The ID of the SLB instance.
- server_
certificate_ strid - The ID of the certificate used by the domain name.
- delete
Protection BooleanValidation - Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- domain String
- The domain name.
- frontend
Port Number - The frontend port used by the HTTPS listener of the SLB instance. Valid values: 1–65535.
- load
Balancer StringId - The ID of the SLB instance.
- server
Certificate StringId - The ID of the certificate used by the domain name.
Import
Load balancer domain_extension can be imported using the id, e.g.
$ pulumi import alicloud:slb/domainExtension:DomainExtension example de-abc123456
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.