1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. ScfCustomDomain
tencentcloud 1.81.182 published on Monday, Apr 14, 2025 by tencentcloudstack

tencentcloud.ScfCustomDomain

Explore with Pulumi AI

Provides a resource to create a scf custom domain

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";

const scfCustomDomain = new tencentcloud.ScfCustomDomain("scfCustomDomain", {
    domain: "xxxxxx",
    endpointsConfigs: [{
        functionName: "xxxxxx",
        namespace: "default",
        pathMatch: "/aa/*",
        qualifier: "$LATEST",
    }],
    protocol: "HTTP",
    wafConfig: {
        wafOpen: "CLOSE",
    },
});
Copy
import pulumi
import pulumi_tencentcloud as tencentcloud

scf_custom_domain = tencentcloud.ScfCustomDomain("scfCustomDomain",
    domain="xxxxxx",
    endpoints_configs=[{
        "function_name": "xxxxxx",
        "namespace": "default",
        "path_match": "/aa/*",
        "qualifier": "$LATEST",
    }],
    protocol="HTTP",
    waf_config={
        "waf_open": "CLOSE",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := tencentcloud.NewScfCustomDomain(ctx, "scfCustomDomain", &tencentcloud.ScfCustomDomainArgs{
			Domain: pulumi.String("xxxxxx"),
			EndpointsConfigs: tencentcloud.ScfCustomDomainEndpointsConfigArray{
				&tencentcloud.ScfCustomDomainEndpointsConfigArgs{
					FunctionName: pulumi.String("xxxxxx"),
					Namespace:    pulumi.String("default"),
					PathMatch:    pulumi.String("/aa/*"),
					Qualifier:    pulumi.String("$LATEST"),
				},
			},
			Protocol: pulumi.String("HTTP"),
			WafConfig: &tencentcloud.ScfCustomDomainWafConfigArgs{
				WafOpen: pulumi.String("CLOSE"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;

return await Deployment.RunAsync(() => 
{
    var scfCustomDomain = new Tencentcloud.ScfCustomDomain("scfCustomDomain", new()
    {
        Domain = "xxxxxx",
        EndpointsConfigs = new[]
        {
            new Tencentcloud.Inputs.ScfCustomDomainEndpointsConfigArgs
            {
                FunctionName = "xxxxxx",
                Namespace = "default",
                PathMatch = "/aa/*",
                Qualifier = "$LATEST",
            },
        },
        Protocol = "HTTP",
        WafConfig = new Tencentcloud.Inputs.ScfCustomDomainWafConfigArgs
        {
            WafOpen = "CLOSE",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.ScfCustomDomain;
import com.pulumi.tencentcloud.ScfCustomDomainArgs;
import com.pulumi.tencentcloud.inputs.ScfCustomDomainEndpointsConfigArgs;
import com.pulumi.tencentcloud.inputs.ScfCustomDomainWafConfigArgs;
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 scfCustomDomain = new ScfCustomDomain("scfCustomDomain", ScfCustomDomainArgs.builder()
            .domain("xxxxxx")
            .endpointsConfigs(ScfCustomDomainEndpointsConfigArgs.builder()
                .functionName("xxxxxx")
                .namespace("default")
                .pathMatch("/aa/*")
                .qualifier("$LATEST")
                .build())
            .protocol("HTTP")
            .wafConfig(ScfCustomDomainWafConfigArgs.builder()
                .wafOpen("CLOSE")
                .build())
            .build());

    }
}
Copy
resources:
  scfCustomDomain:
    type: tencentcloud:ScfCustomDomain
    properties:
      domain: xxxxxx
      endpointsConfigs:
        - functionName: xxxxxx
          namespace: default
          pathMatch: /aa/*
          qualifier: $LATEST
      protocol: HTTP
      wafConfig:
        wafOpen: CLOSE
Copy

Create ScfCustomDomain Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ScfCustomDomain(name: string, args: ScfCustomDomainArgs, opts?: CustomResourceOptions);
@overload
def ScfCustomDomain(resource_name: str,
                    args: ScfCustomDomainArgs,
                    opts: Optional[ResourceOptions] = None)

@overload
def ScfCustomDomain(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    domain: Optional[str] = None,
                    endpoints_configs: Optional[Sequence[ScfCustomDomainEndpointsConfigArgs]] = None,
                    protocol: Optional[str] = None,
                    cert_config: Optional[ScfCustomDomainCertConfigArgs] = None,
                    scf_custom_domain_id: Optional[str] = None,
                    waf_config: Optional[ScfCustomDomainWafConfigArgs] = None)
func NewScfCustomDomain(ctx *Context, name string, args ScfCustomDomainArgs, opts ...ResourceOption) (*ScfCustomDomain, error)
public ScfCustomDomain(string name, ScfCustomDomainArgs args, CustomResourceOptions? opts = null)
public ScfCustomDomain(String name, ScfCustomDomainArgs args)
public ScfCustomDomain(String name, ScfCustomDomainArgs args, CustomResourceOptions options)
type: tencentcloud:ScfCustomDomain
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ScfCustomDomainArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ScfCustomDomainArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ScfCustomDomainArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ScfCustomDomainArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ScfCustomDomainArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

ScfCustomDomain 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 ScfCustomDomain resource accepts the following input properties:

Domain This property is required. string
Domain names, pan-domain names are not supported.
EndpointsConfigs This property is required. List<ScfCustomDomainEndpointsConfig>
Routing configuration.
Protocol This property is required. string
Protocol, value range: HTTP, HTTPS, HTTP&HTTPS.
CertConfig ScfCustomDomainCertConfig
Certificate configuration information, required for HTTPS protocol.
ScfCustomDomainId string
ID of the resource.
WafConfig ScfCustomDomainWafConfig
Web Application Firewall Configuration.
Domain This property is required. string
Domain names, pan-domain names are not supported.
EndpointsConfigs This property is required. []ScfCustomDomainEndpointsConfigArgs
Routing configuration.
Protocol This property is required. string
Protocol, value range: HTTP, HTTPS, HTTP&HTTPS.
CertConfig ScfCustomDomainCertConfigArgs
Certificate configuration information, required for HTTPS protocol.
ScfCustomDomainId string
ID of the resource.
WafConfig ScfCustomDomainWafConfigArgs
Web Application Firewall Configuration.
domain This property is required. String
Domain names, pan-domain names are not supported.
endpointsConfigs This property is required. List<ScfCustomDomainEndpointsConfig>
Routing configuration.
protocol This property is required. String
Protocol, value range: HTTP, HTTPS, HTTP&HTTPS.
certConfig ScfCustomDomainCertConfig
Certificate configuration information, required for HTTPS protocol.
scfCustomDomainId String
ID of the resource.
wafConfig ScfCustomDomainWafConfig
Web Application Firewall Configuration.
domain This property is required. string
Domain names, pan-domain names are not supported.
endpointsConfigs This property is required. ScfCustomDomainEndpointsConfig[]
Routing configuration.
protocol This property is required. string
Protocol, value range: HTTP, HTTPS, HTTP&HTTPS.
certConfig ScfCustomDomainCertConfig
Certificate configuration information, required for HTTPS protocol.
scfCustomDomainId string
ID of the resource.
wafConfig ScfCustomDomainWafConfig
Web Application Firewall Configuration.
domain This property is required. str
Domain names, pan-domain names are not supported.
endpoints_configs This property is required. Sequence[ScfCustomDomainEndpointsConfigArgs]
Routing configuration.
protocol This property is required. str
Protocol, value range: HTTP, HTTPS, HTTP&HTTPS.
cert_config ScfCustomDomainCertConfigArgs
Certificate configuration information, required for HTTPS protocol.
scf_custom_domain_id str
ID of the resource.
waf_config ScfCustomDomainWafConfigArgs
Web Application Firewall Configuration.
domain This property is required. String
Domain names, pan-domain names are not supported.
endpointsConfigs This property is required. List<Property Map>
Routing configuration.
protocol This property is required. String
Protocol, value range: HTTP, HTTPS, HTTP&HTTPS.
certConfig Property Map
Certificate configuration information, required for HTTPS protocol.
scfCustomDomainId String
ID of the resource.
wafConfig Property Map
Web Application Firewall Configuration.

Outputs

All input properties are implicitly available as output properties. Additionally, the ScfCustomDomain 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 ScfCustomDomain Resource

Get an existing ScfCustomDomain 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?: ScfCustomDomainState, opts?: CustomResourceOptions): ScfCustomDomain
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cert_config: Optional[ScfCustomDomainCertConfigArgs] = None,
        domain: Optional[str] = None,
        endpoints_configs: Optional[Sequence[ScfCustomDomainEndpointsConfigArgs]] = None,
        protocol: Optional[str] = None,
        scf_custom_domain_id: Optional[str] = None,
        waf_config: Optional[ScfCustomDomainWafConfigArgs] = None) -> ScfCustomDomain
func GetScfCustomDomain(ctx *Context, name string, id IDInput, state *ScfCustomDomainState, opts ...ResourceOption) (*ScfCustomDomain, error)
public static ScfCustomDomain Get(string name, Input<string> id, ScfCustomDomainState? state, CustomResourceOptions? opts = null)
public static ScfCustomDomain get(String name, Output<String> id, ScfCustomDomainState state, CustomResourceOptions options)
resources:  _:    type: tencentcloud:ScfCustomDomain    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
CertConfig ScfCustomDomainCertConfig
Certificate configuration information, required for HTTPS protocol.
Domain string
Domain names, pan-domain names are not supported.
EndpointsConfigs List<ScfCustomDomainEndpointsConfig>
Routing configuration.
Protocol string
Protocol, value range: HTTP, HTTPS, HTTP&HTTPS.
ScfCustomDomainId string
ID of the resource.
WafConfig ScfCustomDomainWafConfig
Web Application Firewall Configuration.
CertConfig ScfCustomDomainCertConfigArgs
Certificate configuration information, required for HTTPS protocol.
Domain string
Domain names, pan-domain names are not supported.
EndpointsConfigs []ScfCustomDomainEndpointsConfigArgs
Routing configuration.
Protocol string
Protocol, value range: HTTP, HTTPS, HTTP&HTTPS.
ScfCustomDomainId string
ID of the resource.
WafConfig ScfCustomDomainWafConfigArgs
Web Application Firewall Configuration.
certConfig ScfCustomDomainCertConfig
Certificate configuration information, required for HTTPS protocol.
domain String
Domain names, pan-domain names are not supported.
endpointsConfigs List<ScfCustomDomainEndpointsConfig>
Routing configuration.
protocol String
Protocol, value range: HTTP, HTTPS, HTTP&HTTPS.
scfCustomDomainId String
ID of the resource.
wafConfig ScfCustomDomainWafConfig
Web Application Firewall Configuration.
certConfig ScfCustomDomainCertConfig
Certificate configuration information, required for HTTPS protocol.
domain string
Domain names, pan-domain names are not supported.
endpointsConfigs ScfCustomDomainEndpointsConfig[]
Routing configuration.
protocol string
Protocol, value range: HTTP, HTTPS, HTTP&HTTPS.
scfCustomDomainId string
ID of the resource.
wafConfig ScfCustomDomainWafConfig
Web Application Firewall Configuration.
cert_config ScfCustomDomainCertConfigArgs
Certificate configuration information, required for HTTPS protocol.
domain str
Domain names, pan-domain names are not supported.
endpoints_configs Sequence[ScfCustomDomainEndpointsConfigArgs]
Routing configuration.
protocol str
Protocol, value range: HTTP, HTTPS, HTTP&HTTPS.
scf_custom_domain_id str
ID of the resource.
waf_config ScfCustomDomainWafConfigArgs
Web Application Firewall Configuration.
certConfig Property Map
Certificate configuration information, required for HTTPS protocol.
domain String
Domain names, pan-domain names are not supported.
endpointsConfigs List<Property Map>
Routing configuration.
protocol String
Protocol, value range: HTTP, HTTPS, HTTP&HTTPS.
scfCustomDomainId String
ID of the resource.
wafConfig Property Map
Web Application Firewall Configuration.

Supporting Types

ScfCustomDomainCertConfig
, ScfCustomDomainCertConfigArgs

CertificateId string
SSL Certificates ID.
CertificateId string
SSL Certificates ID.
certificateId String
SSL Certificates ID.
certificateId string
SSL Certificates ID.
certificate_id str
SSL Certificates ID.
certificateId String
SSL Certificates ID.

ScfCustomDomainEndpointsConfig
, ScfCustomDomainEndpointsConfigArgs

FunctionName This property is required. string
Function name.
Namespace This property is required. string
Function namespace.
PathMatch This property is required. string
Path, value specification: /,/,/xxx,/xxx/a,/xxx/.
Qualifier This property is required. string
Function alias or version.
PathRewrites List<ScfCustomDomainEndpointsConfigPathRewrite>
Path rewriting policy.
FunctionName This property is required. string
Function name.
Namespace This property is required. string
Function namespace.
PathMatch This property is required. string
Path, value specification: /,/,/xxx,/xxx/a,/xxx/.
Qualifier This property is required. string
Function alias or version.
PathRewrites []ScfCustomDomainEndpointsConfigPathRewrite
Path rewriting policy.
functionName This property is required. String
Function name.
namespace This property is required. String
Function namespace.
pathMatch This property is required. String
Path, value specification: /,/,/xxx,/xxx/a,/xxx/.
qualifier This property is required. String
Function alias or version.
pathRewrites List<ScfCustomDomainEndpointsConfigPathRewrite>
Path rewriting policy.
functionName This property is required. string
Function name.
namespace This property is required. string
Function namespace.
pathMatch This property is required. string
Path, value specification: /,/,/xxx,/xxx/a,/xxx/.
qualifier This property is required. string
Function alias or version.
pathRewrites ScfCustomDomainEndpointsConfigPathRewrite[]
Path rewriting policy.
function_name This property is required. str
Function name.
namespace This property is required. str
Function namespace.
path_match This property is required. str
Path, value specification: /,/,/xxx,/xxx/a,/xxx/.
qualifier This property is required. str
Function alias or version.
path_rewrites Sequence[ScfCustomDomainEndpointsConfigPathRewrite]
Path rewriting policy.
functionName This property is required. String
Function name.
namespace This property is required. String
Function namespace.
pathMatch This property is required. String
Path, value specification: /,/,/xxx,/xxx/a,/xxx/.
qualifier This property is required. String
Function alias or version.
pathRewrites List<Property Map>
Path rewriting policy.

ScfCustomDomainEndpointsConfigPathRewrite
, ScfCustomDomainEndpointsConfigPathRewriteArgs

Path This property is required. string
Path that needs to be rerouted, value specification: /,/,/xxx,/xxx/a,/xxx/.
Rewrite This property is required. string
Replacement values: such as/, /$.
Type This property is required. string
Matching rules, value range: WildcardRules wildcard matching, ExactRules exact matching.
Path This property is required. string
Path that needs to be rerouted, value specification: /,/,/xxx,/xxx/a,/xxx/.
Rewrite This property is required. string
Replacement values: such as/, /$.
Type This property is required. string
Matching rules, value range: WildcardRules wildcard matching, ExactRules exact matching.
path This property is required. String
Path that needs to be rerouted, value specification: /,/,/xxx,/xxx/a,/xxx/.
rewrite This property is required. String
Replacement values: such as/, /$.
type This property is required. String
Matching rules, value range: WildcardRules wildcard matching, ExactRules exact matching.
path This property is required. string
Path that needs to be rerouted, value specification: /,/,/xxx,/xxx/a,/xxx/.
rewrite This property is required. string
Replacement values: such as/, /$.
type This property is required. string
Matching rules, value range: WildcardRules wildcard matching, ExactRules exact matching.
path This property is required. str
Path that needs to be rerouted, value specification: /,/,/xxx,/xxx/a,/xxx/.
rewrite This property is required. str
Replacement values: such as/, /$.
type This property is required. str
Matching rules, value range: WildcardRules wildcard matching, ExactRules exact matching.
path This property is required. String
Path that needs to be rerouted, value specification: /,/,/xxx,/xxx/a,/xxx/.
rewrite This property is required. String
Replacement values: such as/, /$.
type This property is required. String
Matching rules, value range: WildcardRules wildcard matching, ExactRules exact matching.

ScfCustomDomainWafConfig
, ScfCustomDomainWafConfigArgs

WafInstanceId string
Web Application Firewall Instance ID.
WafOpen string
Whether the Web Application Firewall is turned on, value range:OPEN, CLOSE.
WafInstanceId string
Web Application Firewall Instance ID.
WafOpen string
Whether the Web Application Firewall is turned on, value range:OPEN, CLOSE.
wafInstanceId String
Web Application Firewall Instance ID.
wafOpen String
Whether the Web Application Firewall is turned on, value range:OPEN, CLOSE.
wafInstanceId string
Web Application Firewall Instance ID.
wafOpen string
Whether the Web Application Firewall is turned on, value range:OPEN, CLOSE.
waf_instance_id str
Web Application Firewall Instance ID.
waf_open str
Whether the Web Application Firewall is turned on, value range:OPEN, CLOSE.
wafInstanceId String
Web Application Firewall Instance ID.
wafOpen String
Whether the Web Application Firewall is turned on, value range:OPEN, CLOSE.

Import

scf scf_custom_domain can be imported using the id, e.g.

$ pulumi import tencentcloud:index/scfCustomDomain:ScfCustomDomain scf_custom_domain ${domain}
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
tencentcloud tencentcloudstack/terraform-provider-tencentcloud
License
Notes
This Pulumi package is based on the tencentcloud Terraform Provider.