tencentcloud.TeoCustomizeErrorPage
Explore with Pulumi AI
Provides a resource to create a TEO customize error page
Example Usage
If content_type is application/json
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const example = new tencentcloud.TeoCustomizeErrorPage("example", {
zoneId: "zone-3edjdliiw3he",
contentType: "application/json",
description: "description.",
content: JSON.stringify({
key: "value",
}),
});
import pulumi
import json
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.TeoCustomizeErrorPage("example",
zone_id="zone-3edjdliiw3he",
content_type="application/json",
description="description.",
content=json.dumps({
"key": "value",
}))
package main
import (
"encoding/json"
"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 {
tmpJSON0, err := json.Marshal(map[string]interface{}{
"key": "value",
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
_, err = tencentcloud.NewTeoCustomizeErrorPage(ctx, "example", &tencentcloud.TeoCustomizeErrorPageArgs{
ZoneId: pulumi.String("zone-3edjdliiw3he"),
ContentType: pulumi.String("application/json"),
Description: pulumi.String("description."),
Content: pulumi.String(json0),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var example = new Tencentcloud.TeoCustomizeErrorPage("example", new()
{
ZoneId = "zone-3edjdliiw3he",
ContentType = "application/json",
Description = "description.",
Content = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["key"] = "value",
}),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TeoCustomizeErrorPage;
import com.pulumi.tencentcloud.TeoCustomizeErrorPageArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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 example = new TeoCustomizeErrorPage("example", TeoCustomizeErrorPageArgs.builder()
.zoneId("zone-3edjdliiw3he")
.contentType("application/json")
.description("description.")
.content(serializeJson(
jsonObject(
jsonProperty("key", "value")
)))
.build());
}
}
resources:
example:
type: tencentcloud:TeoCustomizeErrorPage
properties:
zoneId: zone-3edjdliiw3he
contentType: application/json
description: description.
content:
fn::toJSON:
key: value
If content_type is text/html
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const example = new tencentcloud.TeoCustomizeErrorPage("example", {
content: `<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Error Page</title>
</head>
<body>
customize error page
</body>
</html>
`,
contentType: "text/html",
description: "description.",
zoneId: "zone-3edjdliiw3he",
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.TeoCustomizeErrorPage("example",
content="""<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Error Page</title>
</head>
<body>
customize error page
</body>
</html>
""",
content_type="text/html",
description="description.",
zone_id="zone-3edjdliiw3he")
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.NewTeoCustomizeErrorPage(ctx, "example", &tencentcloud.TeoCustomizeErrorPageArgs{
Content: pulumi.String(`<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Error Page</title>
</head>
<body>
customize error page
</body>
</html>
`),
ContentType: pulumi.String("text/html"),
Description: pulumi.String("description."),
ZoneId: pulumi.String("zone-3edjdliiw3he"),
})
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 example = new Tencentcloud.TeoCustomizeErrorPage("example", new()
{
Content = @"<!DOCTYPE html>
<html>
<head>
<meta charset=""UTF-8"">
<title>Error Page</title>
</head>
<body>
customize error page
</body>
</html>
",
ContentType = "text/html",
Description = "description.",
ZoneId = "zone-3edjdliiw3he",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TeoCustomizeErrorPage;
import com.pulumi.tencentcloud.TeoCustomizeErrorPageArgs;
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 example = new TeoCustomizeErrorPage("example", TeoCustomizeErrorPageArgs.builder()
.content("""
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Error Page</title>
</head>
<body>
customize error page
</body>
</html>
""")
.contentType("text/html")
.description("description.")
.zoneId("zone-3edjdliiw3he")
.build());
}
}
resources:
example:
type: tencentcloud:TeoCustomizeErrorPage
properties:
content: |+
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Error Page</title>
</head>
<body>
customize error page
</body>
</html>
contentType: text/html
description: description.
zoneId: zone-3edjdliiw3he
If content_type is text/plain
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const example = new tencentcloud.TeoCustomizeErrorPage("example", {
content: "customize error page",
contentType: "text/plain",
description: "description.",
zoneId: "zone-3edjdliiw3he",
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.TeoCustomizeErrorPage("example",
content="customize error page",
content_type="text/plain",
description="description.",
zone_id="zone-3edjdliiw3he")
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.NewTeoCustomizeErrorPage(ctx, "example", &tencentcloud.TeoCustomizeErrorPageArgs{
Content: pulumi.String("customize error page"),
ContentType: pulumi.String("text/plain"),
Description: pulumi.String("description."),
ZoneId: pulumi.String("zone-3edjdliiw3he"),
})
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 example = new Tencentcloud.TeoCustomizeErrorPage("example", new()
{
Content = "customize error page",
ContentType = "text/plain",
Description = "description.",
ZoneId = "zone-3edjdliiw3he",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TeoCustomizeErrorPage;
import com.pulumi.tencentcloud.TeoCustomizeErrorPageArgs;
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 example = new TeoCustomizeErrorPage("example", TeoCustomizeErrorPageArgs.builder()
.content("customize error page")
.contentType("text/plain")
.description("description.")
.zoneId("zone-3edjdliiw3he")
.build());
}
}
resources:
example:
type: tencentcloud:TeoCustomizeErrorPage
properties:
content: customize error page
contentType: text/plain
description: description.
zoneId: zone-3edjdliiw3he
If content_type is text/xml
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const example = new tencentcloud.TeoCustomizeErrorPage("example", {
content: `<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="#internalStyle"?>
<error-page>
<message>customize error page</message>
</error-page>
`,
contentType: "text/xml",
description: "description.",
zoneId: "zone-3edjdliiw3he",
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.TeoCustomizeErrorPage("example",
content="""<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="#internalStyle"?>
<error-page>
<message>customize error page</message>
</error-page>
""",
content_type="text/xml",
description="description.",
zone_id="zone-3edjdliiw3he")
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.NewTeoCustomizeErrorPage(ctx, "example", &tencentcloud.TeoCustomizeErrorPageArgs{
Content: pulumi.String(`<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="#internalStyle"?>
<error-page>
<message>customize error page</message>
</error-page>
`),
ContentType: pulumi.String("text/xml"),
Description: pulumi.String("description."),
ZoneId: pulumi.String("zone-3edjdliiw3he"),
})
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 example = new Tencentcloud.TeoCustomizeErrorPage("example", new()
{
Content = @"<?xml version=""1.0"" encoding=""UTF-8""?>
<?xml-stylesheet type=""text/css"" href=""#internalStyle""?>
<error-page>
<message>customize error page</message>
</error-page>
",
ContentType = "text/xml",
Description = "description.",
ZoneId = "zone-3edjdliiw3he",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TeoCustomizeErrorPage;
import com.pulumi.tencentcloud.TeoCustomizeErrorPageArgs;
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 example = new TeoCustomizeErrorPage("example", TeoCustomizeErrorPageArgs.builder()
.content("""
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="#internalStyle"?>
<error-page>
<message>customize error page</message>
</error-page>
""")
.contentType("text/xml")
.description("description.")
.zoneId("zone-3edjdliiw3he")
.build());
}
}
resources:
example:
type: tencentcloud:TeoCustomizeErrorPage
properties:
content: |+
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="#internalStyle"?>
<error-page>
<message>customize error page</message>
</error-page>
contentType: text/xml
description: description.
zoneId: zone-3edjdliiw3he
Create TeoCustomizeErrorPage Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new TeoCustomizeErrorPage(name: string, args: TeoCustomizeErrorPageArgs, opts?: CustomResourceOptions);
@overload
def TeoCustomizeErrorPage(resource_name: str,
args: TeoCustomizeErrorPageArgs,
opts: Optional[ResourceOptions] = None)
@overload
def TeoCustomizeErrorPage(resource_name: str,
opts: Optional[ResourceOptions] = None,
content_type: Optional[str] = None,
zone_id: Optional[str] = None,
content: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None,
teo_customize_error_page_id: Optional[str] = None)
func NewTeoCustomizeErrorPage(ctx *Context, name string, args TeoCustomizeErrorPageArgs, opts ...ResourceOption) (*TeoCustomizeErrorPage, error)
public TeoCustomizeErrorPage(string name, TeoCustomizeErrorPageArgs args, CustomResourceOptions? opts = null)
public TeoCustomizeErrorPage(String name, TeoCustomizeErrorPageArgs args)
public TeoCustomizeErrorPage(String name, TeoCustomizeErrorPageArgs args, CustomResourceOptions options)
type: tencentcloud:TeoCustomizeErrorPage
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 TeoCustomizeErrorPageArgs
- 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 TeoCustomizeErrorPageArgs
- 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 TeoCustomizeErrorPageArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TeoCustomizeErrorPageArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TeoCustomizeErrorPageArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
TeoCustomizeErrorPage 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 TeoCustomizeErrorPage resource accepts the following input properties:
- Content
Type string - Custom error page type, with values:text/html; application/json;text/plain;text/xml..
- Zone
Id string - Zone ID.
- Content string
- Custom error page content, not exceeding 2 KB.
- Description string
- Custom error page description, not exceeding 60 characters.
- Name string
- Custom error page name. The name must be 2-30 characters long.
- Teo
Customize stringError Page Id - ID of the resource.
- Content
Type string - Custom error page type, with values:text/html; application/json;text/plain;text/xml..
- Zone
Id string - Zone ID.
- Content string
- Custom error page content, not exceeding 2 KB.
- Description string
- Custom error page description, not exceeding 60 characters.
- Name string
- Custom error page name. The name must be 2-30 characters long.
- Teo
Customize stringError Page Id - ID of the resource.
- content
Type String - Custom error page type, with values:text/html; application/json;text/plain;text/xml..
- zone
Id String - Zone ID.
- content String
- Custom error page content, not exceeding 2 KB.
- description String
- Custom error page description, not exceeding 60 characters.
- name String
- Custom error page name. The name must be 2-30 characters long.
- teo
Customize StringError Page Id - ID of the resource.
- content
Type string - Custom error page type, with values:text/html; application/json;text/plain;text/xml..
- zone
Id string - Zone ID.
- content string
- Custom error page content, not exceeding 2 KB.
- description string
- Custom error page description, not exceeding 60 characters.
- name string
- Custom error page name. The name must be 2-30 characters long.
- teo
Customize stringError Page Id - ID of the resource.
- content_
type str - Custom error page type, with values:text/html; application/json;text/plain;text/xml..
- zone_
id str - Zone ID.
- content str
- Custom error page content, not exceeding 2 KB.
- description str
- Custom error page description, not exceeding 60 characters.
- name str
- Custom error page name. The name must be 2-30 characters long.
- teo_
customize_ strerror_ page_ id - ID of the resource.
- content
Type String - Custom error page type, with values:text/html; application/json;text/plain;text/xml..
- zone
Id String - Zone ID.
- content String
- Custom error page content, not exceeding 2 KB.
- description String
- Custom error page description, not exceeding 60 characters.
- name String
- Custom error page name. The name must be 2-30 characters long.
- teo
Customize StringError Page Id - ID of the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the TeoCustomizeErrorPage resource produces the following output properties:
Look up Existing TeoCustomizeErrorPage Resource
Get an existing TeoCustomizeErrorPage 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?: TeoCustomizeErrorPageState, opts?: CustomResourceOptions): TeoCustomizeErrorPage
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
content: Optional[str] = None,
content_type: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None,
page_id: Optional[str] = None,
teo_customize_error_page_id: Optional[str] = None,
zone_id: Optional[str] = None) -> TeoCustomizeErrorPage
func GetTeoCustomizeErrorPage(ctx *Context, name string, id IDInput, state *TeoCustomizeErrorPageState, opts ...ResourceOption) (*TeoCustomizeErrorPage, error)
public static TeoCustomizeErrorPage Get(string name, Input<string> id, TeoCustomizeErrorPageState? state, CustomResourceOptions? opts = null)
public static TeoCustomizeErrorPage get(String name, Output<String> id, TeoCustomizeErrorPageState state, CustomResourceOptions options)
resources: _: type: tencentcloud:TeoCustomizeErrorPage 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.
- Content string
- Custom error page content, not exceeding 2 KB.
- Content
Type string - Custom error page type, with values:text/html; application/json;text/plain;text/xml..
- Description string
- Custom error page description, not exceeding 60 characters.
- Name string
- Custom error page name. The name must be 2-30 characters long.
- Page
Id string - Page ID.
- Teo
Customize stringError Page Id - ID of the resource.
- Zone
Id string - Zone ID.
- Content string
- Custom error page content, not exceeding 2 KB.
- Content
Type string - Custom error page type, with values:text/html; application/json;text/plain;text/xml..
- Description string
- Custom error page description, not exceeding 60 characters.
- Name string
- Custom error page name. The name must be 2-30 characters long.
- Page
Id string - Page ID.
- Teo
Customize stringError Page Id - ID of the resource.
- Zone
Id string - Zone ID.
- content String
- Custom error page content, not exceeding 2 KB.
- content
Type String - Custom error page type, with values:text/html; application/json;text/plain;text/xml..
- description String
- Custom error page description, not exceeding 60 characters.
- name String
- Custom error page name. The name must be 2-30 characters long.
- page
Id String - Page ID.
- teo
Customize StringError Page Id - ID of the resource.
- zone
Id String - Zone ID.
- content string
- Custom error page content, not exceeding 2 KB.
- content
Type string - Custom error page type, with values:text/html; application/json;text/plain;text/xml..
- description string
- Custom error page description, not exceeding 60 characters.
- name string
- Custom error page name. The name must be 2-30 characters long.
- page
Id string - Page ID.
- teo
Customize stringError Page Id - ID of the resource.
- zone
Id string - Zone ID.
- content str
- Custom error page content, not exceeding 2 KB.
- content_
type str - Custom error page type, with values:text/html; application/json;text/plain;text/xml..
- description str
- Custom error page description, not exceeding 60 characters.
- name str
- Custom error page name. The name must be 2-30 characters long.
- page_
id str - Page ID.
- teo_
customize_ strerror_ page_ id - ID of the resource.
- zone_
id str - Zone ID.
- content String
- Custom error page content, not exceeding 2 KB.
- content
Type String - Custom error page type, with values:text/html; application/json;text/plain;text/xml..
- description String
- Custom error page description, not exceeding 60 characters.
- name String
- Custom error page name. The name must be 2-30 characters long.
- page
Id String - Page ID.
- teo
Customize StringError Page Id - ID of the resource.
- zone
Id String - Zone ID.
Import
TEO customize error page can be imported using the id, e.g.
$ pulumi import tencentcloud:index/teoCustomizeErrorPage:TeoCustomizeErrorPage example zone-3edjdliiw3he#p-3egexy9b4426
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.