1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. ApiGatewayCustomDomain
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.ApiGatewayCustomDomain

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Use this resource to create custom domain of API gateway.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const foo = new tencentcloud.ApiGatewayCustomDomain("foo", {
        defaultDomain: "service-ohxqslqe-1259649581.gz.apigw.tencentcs.com",
        isDefaultMapping: false,
        netType: "OUTER",
        pathMappings: [
            "/good#test",
            "/root#release",
        ],
        protocol: "http",
        serviceId: "service-ohxqslqe",
        subDomain: "tic-test.dnsv1.com",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    foo = tencentcloud.ApiGatewayCustomDomain("foo",
        default_domain="service-ohxqslqe-1259649581.gz.apigw.tencentcs.com",
        is_default_mapping=False,
        net_type="OUTER",
        path_mappings=[
            "/good#test",
            "/root#release",
        ],
        protocol="http",
        service_id="service-ohxqslqe",
        sub_domain="tic-test.dnsv1.com")
    
    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.NewApiGatewayCustomDomain(ctx, "foo", &tencentcloud.ApiGatewayCustomDomainArgs{
    			DefaultDomain:    pulumi.String("service-ohxqslqe-1259649581.gz.apigw.tencentcs.com"),
    			IsDefaultMapping: pulumi.Bool(false),
    			NetType:          pulumi.String("OUTER"),
    			PathMappings: pulumi.StringArray{
    				pulumi.String("/good#test"),
    				pulumi.String("/root#release"),
    			},
    			Protocol:  pulumi.String("http"),
    			ServiceId: pulumi.String("service-ohxqslqe"),
    			SubDomain: pulumi.String("tic-test.dnsv1.com"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var foo = new Tencentcloud.ApiGatewayCustomDomain("foo", new()
        {
            DefaultDomain = "service-ohxqslqe-1259649581.gz.apigw.tencentcs.com",
            IsDefaultMapping = false,
            NetType = "OUTER",
            PathMappings = new[]
            {
                "/good#test",
                "/root#release",
            },
            Protocol = "http",
            ServiceId = "service-ohxqslqe",
            SubDomain = "tic-test.dnsv1.com",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.ApiGatewayCustomDomain;
    import com.pulumi.tencentcloud.ApiGatewayCustomDomainArgs;
    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 foo = new ApiGatewayCustomDomain("foo", ApiGatewayCustomDomainArgs.builder()
                .defaultDomain("service-ohxqslqe-1259649581.gz.apigw.tencentcs.com")
                .isDefaultMapping("false")
                .netType("OUTER")
                .pathMappings(            
                    "/good#test",
                    "/root#release")
                .protocol("http")
                .serviceId("service-ohxqslqe")
                .subDomain("tic-test.dnsv1.com")
                .build());
    
        }
    }
    
    resources:
      foo:
        type: tencentcloud:ApiGatewayCustomDomain
        properties:
          defaultDomain: service-ohxqslqe-1259649581.gz.apigw.tencentcs.com
          isDefaultMapping: 'false'
          netType: OUTER
          pathMappings:
            - /good#test
            - /root#release
          protocol: http
          serviceId: service-ohxqslqe
          subDomain: tic-test.dnsv1.com
    

    Create ApiGatewayCustomDomain Resource

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

    Constructor syntax

    new ApiGatewayCustomDomain(name: string, args: ApiGatewayCustomDomainArgs, opts?: CustomResourceOptions);
    @overload
    def ApiGatewayCustomDomain(resource_name: str,
                               args: ApiGatewayCustomDomainArgs,
                               opts: Optional[ResourceOptions] = None)
    
    @overload
    def ApiGatewayCustomDomain(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               default_domain: Optional[str] = None,
                               net_type: Optional[str] = None,
                               protocol: Optional[str] = None,
                               service_id: Optional[str] = None,
                               sub_domain: Optional[str] = None,
                               api_gateway_custom_domain_id: Optional[str] = None,
                               certificate_id: Optional[str] = None,
                               is_default_mapping: Optional[bool] = None,
                               is_forced_https: Optional[bool] = None,
                               path_mappings: Optional[Sequence[str]] = None)
    func NewApiGatewayCustomDomain(ctx *Context, name string, args ApiGatewayCustomDomainArgs, opts ...ResourceOption) (*ApiGatewayCustomDomain, error)
    public ApiGatewayCustomDomain(string name, ApiGatewayCustomDomainArgs args, CustomResourceOptions? opts = null)
    public ApiGatewayCustomDomain(String name, ApiGatewayCustomDomainArgs args)
    public ApiGatewayCustomDomain(String name, ApiGatewayCustomDomainArgs args, CustomResourceOptions options)
    
    type: tencentcloud:ApiGatewayCustomDomain
    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 ApiGatewayCustomDomainArgs
    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 ApiGatewayCustomDomainArgs
    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 ApiGatewayCustomDomainArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ApiGatewayCustomDomainArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ApiGatewayCustomDomainArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    DefaultDomain string
    Default domain name.
    NetType string
    Network type. Valid values: OUTER, INNER.
    Protocol string
    Protocol supported by service. Valid values: http, https, http&https.
    ServiceId string
    Unique service ID.
    SubDomain string
    Custom domain name to be bound.
    ApiGatewayCustomDomainId string
    ID of the resource.
    CertificateId string
    Unique certificate ID of the custom domain name to be bound. You can choose to upload for the protocol attribute value https or http&https.
    IsDefaultMapping bool
    Whether the default path mapping is used. The default value is true. When it is false, it means custom path mapping. In this case, the path_mappings attribute is required.
    IsForcedHttps bool
    Whether to force HTTP requests to jump to HTTPS, default to false. When the parameter is true, the API gateway will redirect all HTTP protocol requests using the custom domain name to the HTTPS protocol for forwarding.
    PathMappings List<string>
    Custom domain name path mapping. The data format is: path#environment. Optional values for the environment are test, prepub, and release.
    DefaultDomain string
    Default domain name.
    NetType string
    Network type. Valid values: OUTER, INNER.
    Protocol string
    Protocol supported by service. Valid values: http, https, http&https.
    ServiceId string
    Unique service ID.
    SubDomain string
    Custom domain name to be bound.
    ApiGatewayCustomDomainId string
    ID of the resource.
    CertificateId string
    Unique certificate ID of the custom domain name to be bound. You can choose to upload for the protocol attribute value https or http&https.
    IsDefaultMapping bool
    Whether the default path mapping is used. The default value is true. When it is false, it means custom path mapping. In this case, the path_mappings attribute is required.
    IsForcedHttps bool
    Whether to force HTTP requests to jump to HTTPS, default to false. When the parameter is true, the API gateway will redirect all HTTP protocol requests using the custom domain name to the HTTPS protocol for forwarding.
    PathMappings []string
    Custom domain name path mapping. The data format is: path#environment. Optional values for the environment are test, prepub, and release.
    defaultDomain String
    Default domain name.
    netType String
    Network type. Valid values: OUTER, INNER.
    protocol String
    Protocol supported by service. Valid values: http, https, http&https.
    serviceId String
    Unique service ID.
    subDomain String
    Custom domain name to be bound.
    apiGatewayCustomDomainId String
    ID of the resource.
    certificateId String
    Unique certificate ID of the custom domain name to be bound. You can choose to upload for the protocol attribute value https or http&https.
    isDefaultMapping Boolean
    Whether the default path mapping is used. The default value is true. When it is false, it means custom path mapping. In this case, the path_mappings attribute is required.
    isForcedHttps Boolean
    Whether to force HTTP requests to jump to HTTPS, default to false. When the parameter is true, the API gateway will redirect all HTTP protocol requests using the custom domain name to the HTTPS protocol for forwarding.
    pathMappings List<String>
    Custom domain name path mapping. The data format is: path#environment. Optional values for the environment are test, prepub, and release.
    defaultDomain string
    Default domain name.
    netType string
    Network type. Valid values: OUTER, INNER.
    protocol string
    Protocol supported by service. Valid values: http, https, http&https.
    serviceId string
    Unique service ID.
    subDomain string
    Custom domain name to be bound.
    apiGatewayCustomDomainId string
    ID of the resource.
    certificateId string
    Unique certificate ID of the custom domain name to be bound. You can choose to upload for the protocol attribute value https or http&https.
    isDefaultMapping boolean
    Whether the default path mapping is used. The default value is true. When it is false, it means custom path mapping. In this case, the path_mappings attribute is required.
    isForcedHttps boolean
    Whether to force HTTP requests to jump to HTTPS, default to false. When the parameter is true, the API gateway will redirect all HTTP protocol requests using the custom domain name to the HTTPS protocol for forwarding.
    pathMappings string[]
    Custom domain name path mapping. The data format is: path#environment. Optional values for the environment are test, prepub, and release.
    default_domain str
    Default domain name.
    net_type str
    Network type. Valid values: OUTER, INNER.
    protocol str
    Protocol supported by service. Valid values: http, https, http&https.
    service_id str
    Unique service ID.
    sub_domain str
    Custom domain name to be bound.
    api_gateway_custom_domain_id str
    ID of the resource.
    certificate_id str
    Unique certificate ID of the custom domain name to be bound. You can choose to upload for the protocol attribute value https or http&https.
    is_default_mapping bool
    Whether the default path mapping is used. The default value is true. When it is false, it means custom path mapping. In this case, the path_mappings attribute is required.
    is_forced_https bool
    Whether to force HTTP requests to jump to HTTPS, default to false. When the parameter is true, the API gateway will redirect all HTTP protocol requests using the custom domain name to the HTTPS protocol for forwarding.
    path_mappings Sequence[str]
    Custom domain name path mapping. The data format is: path#environment. Optional values for the environment are test, prepub, and release.
    defaultDomain String
    Default domain name.
    netType String
    Network type. Valid values: OUTER, INNER.
    protocol String
    Protocol supported by service. Valid values: http, https, http&https.
    serviceId String
    Unique service ID.
    subDomain String
    Custom domain name to be bound.
    apiGatewayCustomDomainId String
    ID of the resource.
    certificateId String
    Unique certificate ID of the custom domain name to be bound. You can choose to upload for the protocol attribute value https or http&https.
    isDefaultMapping Boolean
    Whether the default path mapping is used. The default value is true. When it is false, it means custom path mapping. In this case, the path_mappings attribute is required.
    isForcedHttps Boolean
    Whether to force HTTP requests to jump to HTTPS, default to false. When the parameter is true, the API gateway will redirect all HTTP protocol requests using the custom domain name to the HTTPS protocol for forwarding.
    pathMappings List<String>
    Custom domain name path mapping. The data format is: path#environment. Optional values for the environment are test, prepub, and release.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ApiGatewayCustomDomain resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Status double
    Domain name resolution status. 1 means normal analysis, 0 means parsing failed.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status float64
    Domain name resolution status. 1 means normal analysis, 0 means parsing failed.
    id String
    The provider-assigned unique ID for this managed resource.
    status Double
    Domain name resolution status. 1 means normal analysis, 0 means parsing failed.
    id string
    The provider-assigned unique ID for this managed resource.
    status number
    Domain name resolution status. 1 means normal analysis, 0 means parsing failed.
    id str
    The provider-assigned unique ID for this managed resource.
    status float
    Domain name resolution status. 1 means normal analysis, 0 means parsing failed.
    id String
    The provider-assigned unique ID for this managed resource.
    status Number
    Domain name resolution status. 1 means normal analysis, 0 means parsing failed.

    Look up Existing ApiGatewayCustomDomain Resource

    Get an existing ApiGatewayCustomDomain 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?: ApiGatewayCustomDomainState, opts?: CustomResourceOptions): ApiGatewayCustomDomain
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            api_gateway_custom_domain_id: Optional[str] = None,
            certificate_id: Optional[str] = None,
            default_domain: Optional[str] = None,
            is_default_mapping: Optional[bool] = None,
            is_forced_https: Optional[bool] = None,
            net_type: Optional[str] = None,
            path_mappings: Optional[Sequence[str]] = None,
            protocol: Optional[str] = None,
            service_id: Optional[str] = None,
            status: Optional[float] = None,
            sub_domain: Optional[str] = None) -> ApiGatewayCustomDomain
    func GetApiGatewayCustomDomain(ctx *Context, name string, id IDInput, state *ApiGatewayCustomDomainState, opts ...ResourceOption) (*ApiGatewayCustomDomain, error)
    public static ApiGatewayCustomDomain Get(string name, Input<string> id, ApiGatewayCustomDomainState? state, CustomResourceOptions? opts = null)
    public static ApiGatewayCustomDomain get(String name, Output<String> id, ApiGatewayCustomDomainState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:ApiGatewayCustomDomain    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.
    The following state arguments are supported:
    ApiGatewayCustomDomainId string
    ID of the resource.
    CertificateId string
    Unique certificate ID of the custom domain name to be bound. You can choose to upload for the protocol attribute value https or http&https.
    DefaultDomain string
    Default domain name.
    IsDefaultMapping bool
    Whether the default path mapping is used. The default value is true. When it is false, it means custom path mapping. In this case, the path_mappings attribute is required.
    IsForcedHttps bool
    Whether to force HTTP requests to jump to HTTPS, default to false. When the parameter is true, the API gateway will redirect all HTTP protocol requests using the custom domain name to the HTTPS protocol for forwarding.
    NetType string
    Network type. Valid values: OUTER, INNER.
    PathMappings List<string>
    Custom domain name path mapping. The data format is: path#environment. Optional values for the environment are test, prepub, and release.
    Protocol string
    Protocol supported by service. Valid values: http, https, http&https.
    ServiceId string
    Unique service ID.
    Status double
    Domain name resolution status. 1 means normal analysis, 0 means parsing failed.
    SubDomain string
    Custom domain name to be bound.
    ApiGatewayCustomDomainId string
    ID of the resource.
    CertificateId string
    Unique certificate ID of the custom domain name to be bound. You can choose to upload for the protocol attribute value https or http&https.
    DefaultDomain string
    Default domain name.
    IsDefaultMapping bool
    Whether the default path mapping is used. The default value is true. When it is false, it means custom path mapping. In this case, the path_mappings attribute is required.
    IsForcedHttps bool
    Whether to force HTTP requests to jump to HTTPS, default to false. When the parameter is true, the API gateway will redirect all HTTP protocol requests using the custom domain name to the HTTPS protocol for forwarding.
    NetType string
    Network type. Valid values: OUTER, INNER.
    PathMappings []string
    Custom domain name path mapping. The data format is: path#environment. Optional values for the environment are test, prepub, and release.
    Protocol string
    Protocol supported by service. Valid values: http, https, http&https.
    ServiceId string
    Unique service ID.
    Status float64
    Domain name resolution status. 1 means normal analysis, 0 means parsing failed.
    SubDomain string
    Custom domain name to be bound.
    apiGatewayCustomDomainId String
    ID of the resource.
    certificateId String
    Unique certificate ID of the custom domain name to be bound. You can choose to upload for the protocol attribute value https or http&https.
    defaultDomain String
    Default domain name.
    isDefaultMapping Boolean
    Whether the default path mapping is used. The default value is true. When it is false, it means custom path mapping. In this case, the path_mappings attribute is required.
    isForcedHttps Boolean
    Whether to force HTTP requests to jump to HTTPS, default to false. When the parameter is true, the API gateway will redirect all HTTP protocol requests using the custom domain name to the HTTPS protocol for forwarding.
    netType String
    Network type. Valid values: OUTER, INNER.
    pathMappings List<String>
    Custom domain name path mapping. The data format is: path#environment. Optional values for the environment are test, prepub, and release.
    protocol String
    Protocol supported by service. Valid values: http, https, http&https.
    serviceId String
    Unique service ID.
    status Double
    Domain name resolution status. 1 means normal analysis, 0 means parsing failed.
    subDomain String
    Custom domain name to be bound.
    apiGatewayCustomDomainId string
    ID of the resource.
    certificateId string
    Unique certificate ID of the custom domain name to be bound. You can choose to upload for the protocol attribute value https or http&https.
    defaultDomain string
    Default domain name.
    isDefaultMapping boolean
    Whether the default path mapping is used. The default value is true. When it is false, it means custom path mapping. In this case, the path_mappings attribute is required.
    isForcedHttps boolean
    Whether to force HTTP requests to jump to HTTPS, default to false. When the parameter is true, the API gateway will redirect all HTTP protocol requests using the custom domain name to the HTTPS protocol for forwarding.
    netType string
    Network type. Valid values: OUTER, INNER.
    pathMappings string[]
    Custom domain name path mapping. The data format is: path#environment. Optional values for the environment are test, prepub, and release.
    protocol string
    Protocol supported by service. Valid values: http, https, http&https.
    serviceId string
    Unique service ID.
    status number
    Domain name resolution status. 1 means normal analysis, 0 means parsing failed.
    subDomain string
    Custom domain name to be bound.
    api_gateway_custom_domain_id str
    ID of the resource.
    certificate_id str
    Unique certificate ID of the custom domain name to be bound. You can choose to upload for the protocol attribute value https or http&https.
    default_domain str
    Default domain name.
    is_default_mapping bool
    Whether the default path mapping is used. The default value is true. When it is false, it means custom path mapping. In this case, the path_mappings attribute is required.
    is_forced_https bool
    Whether to force HTTP requests to jump to HTTPS, default to false. When the parameter is true, the API gateway will redirect all HTTP protocol requests using the custom domain name to the HTTPS protocol for forwarding.
    net_type str
    Network type. Valid values: OUTER, INNER.
    path_mappings Sequence[str]
    Custom domain name path mapping. The data format is: path#environment. Optional values for the environment are test, prepub, and release.
    protocol str
    Protocol supported by service. Valid values: http, https, http&https.
    service_id str
    Unique service ID.
    status float
    Domain name resolution status. 1 means normal analysis, 0 means parsing failed.
    sub_domain str
    Custom domain name to be bound.
    apiGatewayCustomDomainId String
    ID of the resource.
    certificateId String
    Unique certificate ID of the custom domain name to be bound. You can choose to upload for the protocol attribute value https or http&https.
    defaultDomain String
    Default domain name.
    isDefaultMapping Boolean
    Whether the default path mapping is used. The default value is true. When it is false, it means custom path mapping. In this case, the path_mappings attribute is required.
    isForcedHttps Boolean
    Whether to force HTTP requests to jump to HTTPS, default to false. When the parameter is true, the API gateway will redirect all HTTP protocol requests using the custom domain name to the HTTPS protocol for forwarding.
    netType String
    Network type. Valid values: OUTER, INNER.
    pathMappings List<String>
    Custom domain name path mapping. The data format is: path#environment. Optional values for the environment are test, prepub, and release.
    protocol String
    Protocol supported by service. Valid values: http, https, http&https.
    serviceId String
    Unique service ID.
    status Number
    Domain name resolution status. 1 means normal analysis, 0 means parsing failed.
    subDomain String
    Custom domain name to be bound.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack