服务作为业务对外暴露的入口,可以通过绑定域名功能,将您的自定义域名绑定至服务。
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as bytepluscc from "@byteplus/pulumi-bytepluscc";
const apigCustomDomainDemo = new bytepluscc.apig.CustomDomain("ApigCustomDomainDemo", {
serviceId: "sd50d3h5xxxm0t5xxxxx",
domain: "www.****.com",
protocols: [
"HTTP",
"HTTPS",
],
certificateId: "cert-775906d873xxx5bc9d1d372b5dxxxxx",
comments: "ApigCustomDomainDemo custom domain",
sslRedirect: true,
});
import pulumi
import pulumi_bytepluscc as bytepluscc
apig_custom_domain_demo = bytepluscc.apig.CustomDomain("ApigCustomDomainDemo",
service_id="sd50d3h5xxxm0t5xxxxx",
domain="www.****.com",
protocols=[
"HTTP",
"HTTPS",
],
certificate_id="cert-775906d873xxx5bc9d1d372b5dxxxxx",
comments="ApigCustomDomainDemo custom domain",
ssl_redirect=True)
package main
import (
"github.com/byteplus-sdk/pulumi-bytepluscc/sdk/go/bytepluscc/apig"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := apig.NewCustomDomain(ctx, "ApigCustomDomainDemo", &apig.CustomDomainArgs{
ServiceId: pulumi.String("sd50d3h5xxxm0t5xxxxx"),
Domain: pulumi.String("www.****.com"),
Protocols: pulumi.StringArray{
pulumi.String("HTTP"),
pulumi.String("HTTPS"),
},
CertificateId: pulumi.String("cert-775906d873xxx5bc9d1d372b5dxxxxx"),
Comments: pulumi.String("ApigCustomDomainDemo custom domain"),
SslRedirect: pulumi.Bool(true),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Bytepluscc = Byteplus.Pulumi.Bytepluscc;
return await Deployment.RunAsync(() =>
{
var apigCustomDomainDemo = new Bytepluscc.Apig.CustomDomain("ApigCustomDomainDemo", new()
{
ServiceId = "sd50d3h5xxxm0t5xxxxx",
Domain = "www.****.com",
Protocols = new[]
{
"HTTP",
"HTTPS",
},
CertificateId = "cert-775906d873xxx5bc9d1d372b5dxxxxx",
Comments = "ApigCustomDomainDemo custom domain",
SslRedirect = true,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.byteplus.bytepluscc.apig.CustomDomain;
import com.byteplus.bytepluscc.apig.CustomDomainArgs;
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 apigCustomDomainDemo = new CustomDomain("apigCustomDomainDemo", CustomDomainArgs.builder()
.serviceId("sd50d3h5xxxm0t5xxxxx")
.domain("www.****.com")
.protocols(
"HTTP",
"HTTPS")
.certificateId("cert-775906d873xxx5bc9d1d372b5dxxxxx")
.comments("ApigCustomDomainDemo custom domain")
.sslRedirect(true)
.build());
}
}
resources:
apigCustomDomainDemo:
type: bytepluscc:apig:CustomDomain
name: ApigCustomDomainDemo
properties:
serviceId: sd50d3h5xxxm0t5xxxxx
domain: www.****.com
protocols:
- HTTP
- HTTPS
certificateId: cert-775906d873xxx5bc9d1d372b5dxxxxx
comments: ApigCustomDomainDemo custom domain
sslRedirect: true
Create CustomDomain Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CustomDomain(name: string, args: CustomDomainArgs, opts?: CustomResourceOptions);@overload
def CustomDomain(resource_name: str,
args: CustomDomainArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CustomDomain(resource_name: str,
opts: Optional[ResourceOptions] = None,
domain: Optional[str] = None,
protocols: Optional[Sequence[str]] = None,
service_id: Optional[str] = None,
certificate_id: Optional[str] = None,
comments: Optional[str] = None,
ssl_redirect: Optional[bool] = None)func NewCustomDomain(ctx *Context, name string, args CustomDomainArgs, opts ...ResourceOption) (*CustomDomain, error)public CustomDomain(string name, CustomDomainArgs args, CustomResourceOptions? opts = null)
public CustomDomain(String name, CustomDomainArgs args)
public CustomDomain(String name, CustomDomainArgs args, CustomResourceOptions options)
type: bytepluscc:apig:CustomDomain
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 CustomDomainArgs
- 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 CustomDomainArgs
- 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 CustomDomainArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CustomDomainArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CustomDomainArgs
- 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 customDomainResource = new Bytepluscc.Apig.CustomDomain("customDomainResource", new()
{
Domain = "string",
Protocols = new[]
{
"string",
},
ServiceId = "string",
CertificateId = "string",
Comments = "string",
SslRedirect = false,
});
example, err := apig.NewCustomDomain(ctx, "customDomainResource", &apig.CustomDomainArgs{
Domain: pulumi.String("string"),
Protocols: pulumi.StringArray{
pulumi.String("string"),
},
ServiceId: pulumi.String("string"),
CertificateId: pulumi.String("string"),
Comments: pulumi.String("string"),
SslRedirect: pulumi.Bool(false),
})
var customDomainResource = new CustomDomain("customDomainResource", CustomDomainArgs.builder()
.domain("string")
.protocols("string")
.serviceId("string")
.certificateId("string")
.comments("string")
.sslRedirect(false)
.build());
custom_domain_resource = bytepluscc.apig.CustomDomain("customDomainResource",
domain="string",
protocols=["string"],
service_id="string",
certificate_id="string",
comments="string",
ssl_redirect=False)
const customDomainResource = new bytepluscc.apig.CustomDomain("customDomainResource", {
domain: "string",
protocols: ["string"],
serviceId: "string",
certificateId: "string",
comments: "string",
sslRedirect: false,
});
type: bytepluscc:apig:CustomDomain
properties:
certificateId: string
comments: string
domain: string
protocols:
- string
serviceId: string
sslRedirect: false
CustomDomain 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 CustomDomain resource accepts the following input properties:
- Domain string
- 自定义域名。
- Protocols List<string>
- 协议,取值:HTTP。HTTPS。
- Service
Id string - 服务ID。
- Certificate
Id string - 自定义域名证书ID。
- Comments string
- 备注。
- Ssl
Redirect bool - 重定向到HTTPS。
- Domain string
- 自定义域名。
- Protocols []string
- 协议,取值:HTTP。HTTPS。
- Service
Id string - 服务ID。
- Certificate
Id string - 自定义域名证书ID。
- Comments string
- 备注。
- Ssl
Redirect bool - 重定向到HTTPS。
- domain String
- 自定义域名。
- protocols List<String>
- 协议,取值:HTTP。HTTPS。
- service
Id String - 服务ID。
- certificate
Id String - 自定义域名证书ID。
- comments String
- 备注。
- ssl
Redirect Boolean - 重定向到HTTPS。
- domain string
- 自定义域名。
- protocols string[]
- 协议,取值:HTTP。HTTPS。
- service
Id string - 服务ID。
- certificate
Id string - 自定义域名证书ID。
- comments string
- 备注。
- ssl
Redirect boolean - 重定向到HTTPS。
- domain str
- 自定义域名。
- protocols Sequence[str]
- 协议,取值:HTTP。HTTPS。
- service_
id str - 服务ID。
- certificate_
id str - 自定义域名证书ID。
- comments str
- 备注。
- ssl_
redirect bool - 重定向到HTTPS。
- domain String
- 自定义域名。
- protocols List<String>
- 协议,取值:HTTP。HTTPS。
- service
Id String - 服务ID。
- certificate
Id String - 自定义域名证书ID。
- comments String
- 备注。
- ssl
Redirect Boolean - 重定向到HTTPS。
Outputs
All input properties are implicitly available as output properties. Additionally, the CustomDomain resource produces the following output properties:
- Created
Time string - 创建时间。
- Custom
Domain stringId - 自定义域名ID。
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- 状态,取值:Creating:配置中。CreationFailed:配置失败。Deleting:删除中。DeletionFailed:删除失败。Verified:正常。
- Updated
Time string - 更新时间。
- Created
Time string - 创建时间。
- Custom
Domain stringId - 自定义域名ID。
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- 状态,取值:Creating:配置中。CreationFailed:配置失败。Deleting:删除中。DeletionFailed:删除失败。Verified:正常。
- Updated
Time string - 更新时间。
- created
Time String - 创建时间。
- custom
Domain StringId - 自定义域名ID。
- id String
- The provider-assigned unique ID for this managed resource.
- status String
- 状态,取值:Creating:配置中。CreationFailed:配置失败。Deleting:删除中。DeletionFailed:删除失败。Verified:正常。
- updated
Time String - 更新时间。
- created
Time string - 创建时间。
- custom
Domain stringId - 自定义域名ID。
- id string
- The provider-assigned unique ID for this managed resource.
- status string
- 状态,取值:Creating:配置中。CreationFailed:配置失败。Deleting:删除中。DeletionFailed:删除失败。Verified:正常。
- updated
Time string - 更新时间。
- created_
time str - 创建时间。
- custom_
domain_ strid - 自定义域名ID。
- id str
- The provider-assigned unique ID for this managed resource.
- status str
- 状态,取值:Creating:配置中。CreationFailed:配置失败。Deleting:删除中。DeletionFailed:删除失败。Verified:正常。
- updated_
time str - 更新时间。
- created
Time String - 创建时间。
- custom
Domain StringId - 自定义域名ID。
- id String
- The provider-assigned unique ID for this managed resource.
- status String
- 状态,取值:Creating:配置中。CreationFailed:配置失败。Deleting:删除中。DeletionFailed:删除失败。Verified:正常。
- updated
Time String - 更新时间。
Look up Existing CustomDomain Resource
Get an existing CustomDomain 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?: CustomDomainState, opts?: CustomResourceOptions): CustomDomain@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
certificate_id: Optional[str] = None,
comments: Optional[str] = None,
created_time: Optional[str] = None,
custom_domain_id: Optional[str] = None,
domain: Optional[str] = None,
protocols: Optional[Sequence[str]] = None,
service_id: Optional[str] = None,
ssl_redirect: Optional[bool] = None,
status: Optional[str] = None,
updated_time: Optional[str] = None) -> CustomDomainfunc GetCustomDomain(ctx *Context, name string, id IDInput, state *CustomDomainState, opts ...ResourceOption) (*CustomDomain, error)public static CustomDomain Get(string name, Input<string> id, CustomDomainState? state, CustomResourceOptions? opts = null)public static CustomDomain get(String name, Output<String> id, CustomDomainState state, CustomResourceOptions options)resources: _: type: bytepluscc:apig:CustomDomain get: id: ${id}- 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.
- Certificate
Id string - 自定义域名证书ID。
- Comments string
- 备注。
- Created
Time string - 创建时间。
- Custom
Domain stringId - 自定义域名ID。
- Domain string
- 自定义域名。
- Protocols List<string>
- 协议,取值:HTTP。HTTPS。
- Service
Id string - 服务ID。
- Ssl
Redirect bool - 重定向到HTTPS。
- Status string
- 状态,取值:Creating:配置中。CreationFailed:配置失败。Deleting:删除中。DeletionFailed:删除失败。Verified:正常。
- Updated
Time string - 更新时间。
- Certificate
Id string - 自定义域名证书ID。
- Comments string
- 备注。
- Created
Time string - 创建时间。
- Custom
Domain stringId - 自定义域名ID。
- Domain string
- 自定义域名。
- Protocols []string
- 协议,取值:HTTP。HTTPS。
- Service
Id string - 服务ID。
- Ssl
Redirect bool - 重定向到HTTPS。
- Status string
- 状态,取值:Creating:配置中。CreationFailed:配置失败。Deleting:删除中。DeletionFailed:删除失败。Verified:正常。
- Updated
Time string - 更新时间。
- certificate
Id String - 自定义域名证书ID。
- comments String
- 备注。
- created
Time String - 创建时间。
- custom
Domain StringId - 自定义域名ID。
- domain String
- 自定义域名。
- protocols List<String>
- 协议,取值:HTTP。HTTPS。
- service
Id String - 服务ID。
- ssl
Redirect Boolean - 重定向到HTTPS。
- status String
- 状态,取值:Creating:配置中。CreationFailed:配置失败。Deleting:删除中。DeletionFailed:删除失败。Verified:正常。
- updated
Time String - 更新时间。
- certificate
Id string - 自定义域名证书ID。
- comments string
- 备注。
- created
Time string - 创建时间。
- custom
Domain stringId - 自定义域名ID。
- domain string
- 自定义域名。
- protocols string[]
- 协议,取值:HTTP。HTTPS。
- service
Id string - 服务ID。
- ssl
Redirect boolean - 重定向到HTTPS。
- status string
- 状态,取值:Creating:配置中。CreationFailed:配置失败。Deleting:删除中。DeletionFailed:删除失败。Verified:正常。
- updated
Time string - 更新时间。
- certificate_
id str - 自定义域名证书ID。
- comments str
- 备注。
- created_
time str - 创建时间。
- custom_
domain_ strid - 自定义域名ID。
- domain str
- 自定义域名。
- protocols Sequence[str]
- 协议,取值:HTTP。HTTPS。
- service_
id str - 服务ID。
- ssl_
redirect bool - 重定向到HTTPS。
- status str
- 状态,取值:Creating:配置中。CreationFailed:配置失败。Deleting:删除中。DeletionFailed:删除失败。Verified:正常。
- updated_
time str - 更新时间。
- certificate
Id String - 自定义域名证书ID。
- comments String
- 备注。
- created
Time String - 创建时间。
- custom
Domain StringId - 自定义域名ID。
- domain String
- 自定义域名。
- protocols List<String>
- 协议,取值:HTTP。HTTPS。
- service
Id String - 服务ID。
- ssl
Redirect Boolean - 重定向到HTTPS。
- status String
- 状态,取值:Creating:配置中。CreationFailed:配置失败。Deleting:删除中。DeletionFailed:删除失败。Verified:正常。
- updated
Time String - 更新时间。
Import
$ pulumi import bytepluscc:apig/customDomain:CustomDomain example "custom_domain_id"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- bytepluscc byteplus-sdk/pulumi-bytepluscc
- License
- MPL-2.0
- Notes
- This Pulumi package is based on the
byteplusccTerraform Provider.
