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

tencentcloud.GaapDomainErrorPage

Explore with Pulumi AI

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

    Provide a resource to custom error page info for a GAAP HTTP domain.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const fooGaapProxy = new tencentcloud.GaapProxy("fooGaapProxy", {
        bandwidth: 10,
        concurrent: 2,
        accessRegion: "SouthChina",
        realserverRegion: "NorthChina",
    });
    const fooGaapLayer7Listener = new tencentcloud.GaapLayer7Listener("fooGaapLayer7Listener", {
        protocol: "HTTP",
        port: 80,
        proxyId: fooGaapProxy.gaapProxyId,
    });
    const fooGaapHttpDomain = new tencentcloud.GaapHttpDomain("fooGaapHttpDomain", {
        listenerId: fooGaapLayer7Listener.gaapLayer7ListenerId,
        domain: "www.qq.com",
    });
    const fooGaapDomainErrorPage = new tencentcloud.GaapDomainErrorPage("fooGaapDomainErrorPage", {
        listenerId: fooGaapLayer7Listener.gaapLayer7ListenerId,
        domain: fooGaapHttpDomain.domain,
        errorCodes: [
            404,
            503,
        ],
        body: "bad request",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    foo_gaap_proxy = tencentcloud.GaapProxy("fooGaapProxy",
        bandwidth=10,
        concurrent=2,
        access_region="SouthChina",
        realserver_region="NorthChina")
    foo_gaap_layer7_listener = tencentcloud.GaapLayer7Listener("fooGaapLayer7Listener",
        protocol="HTTP",
        port=80,
        proxy_id=foo_gaap_proxy.gaap_proxy_id)
    foo_gaap_http_domain = tencentcloud.GaapHttpDomain("fooGaapHttpDomain",
        listener_id=foo_gaap_layer7_listener.gaap_layer7_listener_id,
        domain="www.qq.com")
    foo_gaap_domain_error_page = tencentcloud.GaapDomainErrorPage("fooGaapDomainErrorPage",
        listener_id=foo_gaap_layer7_listener.gaap_layer7_listener_id,
        domain=foo_gaap_http_domain.domain,
        error_codes=[
            404,
            503,
        ],
        body="bad request")
    
    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 {
    		fooGaapProxy, err := tencentcloud.NewGaapProxy(ctx, "fooGaapProxy", &tencentcloud.GaapProxyArgs{
    			Bandwidth:        pulumi.Float64(10),
    			Concurrent:       pulumi.Float64(2),
    			AccessRegion:     pulumi.String("SouthChina"),
    			RealserverRegion: pulumi.String("NorthChina"),
    		})
    		if err != nil {
    			return err
    		}
    		fooGaapLayer7Listener, err := tencentcloud.NewGaapLayer7Listener(ctx, "fooGaapLayer7Listener", &tencentcloud.GaapLayer7ListenerArgs{
    			Protocol: pulumi.String("HTTP"),
    			Port:     pulumi.Float64(80),
    			ProxyId:  fooGaapProxy.GaapProxyId,
    		})
    		if err != nil {
    			return err
    		}
    		fooGaapHttpDomain, err := tencentcloud.NewGaapHttpDomain(ctx, "fooGaapHttpDomain", &tencentcloud.GaapHttpDomainArgs{
    			ListenerId: fooGaapLayer7Listener.GaapLayer7ListenerId,
    			Domain:     pulumi.String("www.qq.com"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewGaapDomainErrorPage(ctx, "fooGaapDomainErrorPage", &tencentcloud.GaapDomainErrorPageArgs{
    			ListenerId: fooGaapLayer7Listener.GaapLayer7ListenerId,
    			Domain:     fooGaapHttpDomain.Domain,
    			ErrorCodes: pulumi.Float64Array{
    				pulumi.Float64(404),
    				pulumi.Float64(503),
    			},
    			Body: pulumi.String("bad request"),
    		})
    		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 fooGaapProxy = new Tencentcloud.GaapProxy("fooGaapProxy", new()
        {
            Bandwidth = 10,
            Concurrent = 2,
            AccessRegion = "SouthChina",
            RealserverRegion = "NorthChina",
        });
    
        var fooGaapLayer7Listener = new Tencentcloud.GaapLayer7Listener("fooGaapLayer7Listener", new()
        {
            Protocol = "HTTP",
            Port = 80,
            ProxyId = fooGaapProxy.GaapProxyId,
        });
    
        var fooGaapHttpDomain = new Tencentcloud.GaapHttpDomain("fooGaapHttpDomain", new()
        {
            ListenerId = fooGaapLayer7Listener.GaapLayer7ListenerId,
            Domain = "www.qq.com",
        });
    
        var fooGaapDomainErrorPage = new Tencentcloud.GaapDomainErrorPage("fooGaapDomainErrorPage", new()
        {
            ListenerId = fooGaapLayer7Listener.GaapLayer7ListenerId,
            Domain = fooGaapHttpDomain.Domain,
            ErrorCodes = new[]
            {
                404,
                503,
            },
            Body = "bad request",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.GaapProxy;
    import com.pulumi.tencentcloud.GaapProxyArgs;
    import com.pulumi.tencentcloud.GaapLayer7Listener;
    import com.pulumi.tencentcloud.GaapLayer7ListenerArgs;
    import com.pulumi.tencentcloud.GaapHttpDomain;
    import com.pulumi.tencentcloud.GaapHttpDomainArgs;
    import com.pulumi.tencentcloud.GaapDomainErrorPage;
    import com.pulumi.tencentcloud.GaapDomainErrorPageArgs;
    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 fooGaapProxy = new GaapProxy("fooGaapProxy", GaapProxyArgs.builder()
                .bandwidth(10)
                .concurrent(2)
                .accessRegion("SouthChina")
                .realserverRegion("NorthChina")
                .build());
    
            var fooGaapLayer7Listener = new GaapLayer7Listener("fooGaapLayer7Listener", GaapLayer7ListenerArgs.builder()
                .protocol("HTTP")
                .port(80)
                .proxyId(fooGaapProxy.gaapProxyId())
                .build());
    
            var fooGaapHttpDomain = new GaapHttpDomain("fooGaapHttpDomain", GaapHttpDomainArgs.builder()
                .listenerId(fooGaapLayer7Listener.gaapLayer7ListenerId())
                .domain("www.qq.com")
                .build());
    
            var fooGaapDomainErrorPage = new GaapDomainErrorPage("fooGaapDomainErrorPage", GaapDomainErrorPageArgs.builder()
                .listenerId(fooGaapLayer7Listener.gaapLayer7ListenerId())
                .domain(fooGaapHttpDomain.domain())
                .errorCodes(            
                    404,
                    503)
                .body("bad request")
                .build());
    
        }
    }
    
    resources:
      fooGaapProxy:
        type: tencentcloud:GaapProxy
        properties:
          bandwidth: 10
          concurrent: 2
          accessRegion: SouthChina
          realserverRegion: NorthChina
      fooGaapLayer7Listener:
        type: tencentcloud:GaapLayer7Listener
        properties:
          protocol: HTTP
          port: 80
          proxyId: ${fooGaapProxy.gaapProxyId}
      fooGaapHttpDomain:
        type: tencentcloud:GaapHttpDomain
        properties:
          listenerId: ${fooGaapLayer7Listener.gaapLayer7ListenerId}
          domain: www.qq.com
      fooGaapDomainErrorPage:
        type: tencentcloud:GaapDomainErrorPage
        properties:
          listenerId: ${fooGaapLayer7Listener.gaapLayer7ListenerId}
          domain: ${fooGaapHttpDomain.domain}
          errorCodes:
            - 404
            - 503
          body: bad request
    

    Create GaapDomainErrorPage Resource

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

    Constructor syntax

    new GaapDomainErrorPage(name: string, args: GaapDomainErrorPageArgs, opts?: CustomResourceOptions);
    @overload
    def GaapDomainErrorPage(resource_name: str,
                            args: GaapDomainErrorPageArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def GaapDomainErrorPage(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            body: Optional[str] = None,
                            domain: Optional[str] = None,
                            error_codes: Optional[Sequence[float]] = None,
                            listener_id: Optional[str] = None,
                            clear_headers: Optional[Sequence[str]] = None,
                            gaap_domain_error_page_id: Optional[str] = None,
                            new_error_code: Optional[float] = None,
                            set_headers: Optional[Mapping[str, str]] = None)
    func NewGaapDomainErrorPage(ctx *Context, name string, args GaapDomainErrorPageArgs, opts ...ResourceOption) (*GaapDomainErrorPage, error)
    public GaapDomainErrorPage(string name, GaapDomainErrorPageArgs args, CustomResourceOptions? opts = null)
    public GaapDomainErrorPage(String name, GaapDomainErrorPageArgs args)
    public GaapDomainErrorPage(String name, GaapDomainErrorPageArgs args, CustomResourceOptions options)
    
    type: tencentcloud:GaapDomainErrorPage
    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 GaapDomainErrorPageArgs
    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 GaapDomainErrorPageArgs
    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 GaapDomainErrorPageArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GaapDomainErrorPageArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GaapDomainErrorPageArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    Body string
    New response body.
    Domain string
    HTTP domain.
    ErrorCodes List<double>
    Original error codes.
    ListenerId string
    ID of the layer7 listener.
    ClearHeaders List<string>
    Response headers to be removed.
    GaapDomainErrorPageId string
    ID of the resource.
    NewErrorCode double
    New error code.
    SetHeaders Dictionary<string, string>
    Response headers to be set.
    Body string
    New response body.
    Domain string
    HTTP domain.
    ErrorCodes []float64
    Original error codes.
    ListenerId string
    ID of the layer7 listener.
    ClearHeaders []string
    Response headers to be removed.
    GaapDomainErrorPageId string
    ID of the resource.
    NewErrorCode float64
    New error code.
    SetHeaders map[string]string
    Response headers to be set.
    body String
    New response body.
    domain String
    HTTP domain.
    errorCodes List<Double>
    Original error codes.
    listenerId String
    ID of the layer7 listener.
    clearHeaders List<String>
    Response headers to be removed.
    gaapDomainErrorPageId String
    ID of the resource.
    newErrorCode Double
    New error code.
    setHeaders Map<String,String>
    Response headers to be set.
    body string
    New response body.
    domain string
    HTTP domain.
    errorCodes number[]
    Original error codes.
    listenerId string
    ID of the layer7 listener.
    clearHeaders string[]
    Response headers to be removed.
    gaapDomainErrorPageId string
    ID of the resource.
    newErrorCode number
    New error code.
    setHeaders {[key: string]: string}
    Response headers to be set.
    body str
    New response body.
    domain str
    HTTP domain.
    error_codes Sequence[float]
    Original error codes.
    listener_id str
    ID of the layer7 listener.
    clear_headers Sequence[str]
    Response headers to be removed.
    gaap_domain_error_page_id str
    ID of the resource.
    new_error_code float
    New error code.
    set_headers Mapping[str, str]
    Response headers to be set.
    body String
    New response body.
    domain String
    HTTP domain.
    errorCodes List<Number>
    Original error codes.
    listenerId String
    ID of the layer7 listener.
    clearHeaders List<String>
    Response headers to be removed.
    gaapDomainErrorPageId String
    ID of the resource.
    newErrorCode Number
    New error code.
    setHeaders Map<String>
    Response headers to be set.

    Outputs

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

    Get an existing GaapDomainErrorPage 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?: GaapDomainErrorPageState, opts?: CustomResourceOptions): GaapDomainErrorPage
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            body: Optional[str] = None,
            clear_headers: Optional[Sequence[str]] = None,
            domain: Optional[str] = None,
            error_codes: Optional[Sequence[float]] = None,
            gaap_domain_error_page_id: Optional[str] = None,
            listener_id: Optional[str] = None,
            new_error_code: Optional[float] = None,
            set_headers: Optional[Mapping[str, str]] = None) -> GaapDomainErrorPage
    func GetGaapDomainErrorPage(ctx *Context, name string, id IDInput, state *GaapDomainErrorPageState, opts ...ResourceOption) (*GaapDomainErrorPage, error)
    public static GaapDomainErrorPage Get(string name, Input<string> id, GaapDomainErrorPageState? state, CustomResourceOptions? opts = null)
    public static GaapDomainErrorPage get(String name, Output<String> id, GaapDomainErrorPageState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:GaapDomainErrorPage    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:
    Body string
    New response body.
    ClearHeaders List<string>
    Response headers to be removed.
    Domain string
    HTTP domain.
    ErrorCodes List<double>
    Original error codes.
    GaapDomainErrorPageId string
    ID of the resource.
    ListenerId string
    ID of the layer7 listener.
    NewErrorCode double
    New error code.
    SetHeaders Dictionary<string, string>
    Response headers to be set.
    Body string
    New response body.
    ClearHeaders []string
    Response headers to be removed.
    Domain string
    HTTP domain.
    ErrorCodes []float64
    Original error codes.
    GaapDomainErrorPageId string
    ID of the resource.
    ListenerId string
    ID of the layer7 listener.
    NewErrorCode float64
    New error code.
    SetHeaders map[string]string
    Response headers to be set.
    body String
    New response body.
    clearHeaders List<String>
    Response headers to be removed.
    domain String
    HTTP domain.
    errorCodes List<Double>
    Original error codes.
    gaapDomainErrorPageId String
    ID of the resource.
    listenerId String
    ID of the layer7 listener.
    newErrorCode Double
    New error code.
    setHeaders Map<String,String>
    Response headers to be set.
    body string
    New response body.
    clearHeaders string[]
    Response headers to be removed.
    domain string
    HTTP domain.
    errorCodes number[]
    Original error codes.
    gaapDomainErrorPageId string
    ID of the resource.
    listenerId string
    ID of the layer7 listener.
    newErrorCode number
    New error code.
    setHeaders {[key: string]: string}
    Response headers to be set.
    body str
    New response body.
    clear_headers Sequence[str]
    Response headers to be removed.
    domain str
    HTTP domain.
    error_codes Sequence[float]
    Original error codes.
    gaap_domain_error_page_id str
    ID of the resource.
    listener_id str
    ID of the layer7 listener.
    new_error_code float
    New error code.
    set_headers Mapping[str, str]
    Response headers to be set.
    body String
    New response body.
    clearHeaders List<String>
    Response headers to be removed.
    domain String
    HTTP domain.
    errorCodes List<Number>
    Original error codes.
    gaapDomainErrorPageId String
    ID of the resource.
    listenerId String
    ID of the layer7 listener.
    newErrorCode Number
    New error code.
    setHeaders Map<String>
    Response headers to be set.

    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