1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. CustomPages
Cloudflare v5.49.1 published on Tuesday, Feb 18, 2025 by Pulumi

cloudflare.CustomPages

Explore with Pulumi AI

Provides a resource which manages Cloudflare custom error pages.

Example Usage

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

const example = new cloudflare.CustomPages("example", {
    zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
    type: "basic_challenge",
    url: "https://example.com/challenge.html",
    state: "customized",
});
Copy
import pulumi
import pulumi_cloudflare as cloudflare

example = cloudflare.CustomPages("example",
    zone_id="0da42c8d2132a9ddaf714f9e7c920711",
    type="basic_challenge",
    url="https://example.com/challenge.html",
    state="customized")
Copy
package main

import (
	"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudflare.NewCustomPages(ctx, "example", &cloudflare.CustomPagesArgs{
			ZoneId: pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
			Type:   pulumi.String("basic_challenge"),
			Url:    pulumi.String("https://example.com/challenge.html"),
			State:  pulumi.String("customized"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;

return await Deployment.RunAsync(() => 
{
    var example = new Cloudflare.CustomPages("example", new()
    {
        ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
        Type = "basic_challenge",
        Url = "https://example.com/challenge.html",
        State = "customized",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.CustomPages;
import com.pulumi.cloudflare.CustomPagesArgs;
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 CustomPages("example", CustomPagesArgs.builder()
            .zoneId("0da42c8d2132a9ddaf714f9e7c920711")
            .type("basic_challenge")
            .url("https://example.com/challenge.html")
            .state("customized")
            .build());

    }
}
Copy
resources:
  example:
    type: cloudflare:CustomPages
    properties:
      zoneId: 0da42c8d2132a9ddaf714f9e7c920711
      type: basic_challenge
      url: https://example.com/challenge.html
      state: customized
Copy

Create CustomPages Resource

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

Constructor syntax

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

@overload
def CustomPages(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                type: Optional[str] = None,
                url: Optional[str] = None,
                account_id: Optional[str] = None,
                state: Optional[str] = None,
                zone_id: Optional[str] = None)
func NewCustomPages(ctx *Context, name string, args CustomPagesArgs, opts ...ResourceOption) (*CustomPages, error)
public CustomPages(string name, CustomPagesArgs args, CustomResourceOptions? opts = null)
public CustomPages(String name, CustomPagesArgs args)
public CustomPages(String name, CustomPagesArgs args, CustomResourceOptions options)
type: cloudflare:CustomPages
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. CustomPagesArgs
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. CustomPagesArgs
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. CustomPagesArgs
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. CustomPagesArgs
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. CustomPagesArgs
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 customPagesResource = new Cloudflare.CustomPages("customPagesResource", new()
{
    Type = "string",
    Url = "string",
    AccountId = "string",
    State = "string",
    ZoneId = "string",
});
Copy
example, err := cloudflare.NewCustomPages(ctx, "customPagesResource", &cloudflare.CustomPagesArgs{
	Type:      pulumi.String("string"),
	Url:       pulumi.String("string"),
	AccountId: pulumi.String("string"),
	State:     pulumi.String("string"),
	ZoneId:    pulumi.String("string"),
})
Copy
var customPagesResource = new CustomPages("customPagesResource", CustomPagesArgs.builder()
    .type("string")
    .url("string")
    .accountId("string")
    .state("string")
    .zoneId("string")
    .build());
Copy
custom_pages_resource = cloudflare.CustomPages("customPagesResource",
    type="string",
    url="string",
    account_id="string",
    state="string",
    zone_id="string")
Copy
const customPagesResource = new cloudflare.CustomPages("customPagesResource", {
    type: "string",
    url: "string",
    accountId: "string",
    state: "string",
    zoneId: "string",
});
Copy
type: cloudflare:CustomPages
properties:
    accountId: string
    state: string
    type: string
    url: string
    zoneId: string
Copy

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

Type This property is required. string
The type of custom page you wish to update. Available values: basic_challenge, waf_challenge, waf_block, ratelimit_block, country_challenge, ip_block, under_attack, 500_errors, 1000_errors, managed_challenge.
Url This property is required. string
URL of where the custom page source is located.
AccountId string
The account identifier to target for the resource. Conflicts with zone_id.
State string
Managed state of the custom page. Available values: default, customized.
ZoneId string
The zone identifier to target for the resource. Conflicts with account_id.
Type This property is required. string
The type of custom page you wish to update. Available values: basic_challenge, waf_challenge, waf_block, ratelimit_block, country_challenge, ip_block, under_attack, 500_errors, 1000_errors, managed_challenge.
Url This property is required. string
URL of where the custom page source is located.
AccountId string
The account identifier to target for the resource. Conflicts with zone_id.
State string
Managed state of the custom page. Available values: default, customized.
ZoneId string
The zone identifier to target for the resource. Conflicts with account_id.
type This property is required. String
The type of custom page you wish to update. Available values: basic_challenge, waf_challenge, waf_block, ratelimit_block, country_challenge, ip_block, under_attack, 500_errors, 1000_errors, managed_challenge.
url This property is required. String
URL of where the custom page source is located.
accountId String
The account identifier to target for the resource. Conflicts with zone_id.
state String
Managed state of the custom page. Available values: default, customized.
zoneId String
The zone identifier to target for the resource. Conflicts with account_id.
type This property is required. string
The type of custom page you wish to update. Available values: basic_challenge, waf_challenge, waf_block, ratelimit_block, country_challenge, ip_block, under_attack, 500_errors, 1000_errors, managed_challenge.
url This property is required. string
URL of where the custom page source is located.
accountId string
The account identifier to target for the resource. Conflicts with zone_id.
state string
Managed state of the custom page. Available values: default, customized.
zoneId string
The zone identifier to target for the resource. Conflicts with account_id.
type This property is required. str
The type of custom page you wish to update. Available values: basic_challenge, waf_challenge, waf_block, ratelimit_block, country_challenge, ip_block, under_attack, 500_errors, 1000_errors, managed_challenge.
url This property is required. str
URL of where the custom page source is located.
account_id str
The account identifier to target for the resource. Conflicts with zone_id.
state str
Managed state of the custom page. Available values: default, customized.
zone_id str
The zone identifier to target for the resource. Conflicts with account_id.
type This property is required. String
The type of custom page you wish to update. Available values: basic_challenge, waf_challenge, waf_block, ratelimit_block, country_challenge, ip_block, under_attack, 500_errors, 1000_errors, managed_challenge.
url This property is required. String
URL of where the custom page source is located.
accountId String
The account identifier to target for the resource. Conflicts with zone_id.
state String
Managed state of the custom page. Available values: default, customized.
zoneId String
The zone identifier to target for the resource. Conflicts with account_id.

Outputs

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

Get an existing CustomPages 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?: CustomPagesState, opts?: CustomResourceOptions): CustomPages
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[str] = None,
        state: Optional[str] = None,
        type: Optional[str] = None,
        url: Optional[str] = None,
        zone_id: Optional[str] = None) -> CustomPages
func GetCustomPages(ctx *Context, name string, id IDInput, state *CustomPagesState, opts ...ResourceOption) (*CustomPages, error)
public static CustomPages Get(string name, Input<string> id, CustomPagesState? state, CustomResourceOptions? opts = null)
public static CustomPages get(String name, Output<String> id, CustomPagesState state, CustomResourceOptions options)
resources:  _:    type: cloudflare:CustomPages    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:
AccountId string
The account identifier to target for the resource. Conflicts with zone_id.
State string
Managed state of the custom page. Available values: default, customized.
Type string
The type of custom page you wish to update. Available values: basic_challenge, waf_challenge, waf_block, ratelimit_block, country_challenge, ip_block, under_attack, 500_errors, 1000_errors, managed_challenge.
Url string
URL of where the custom page source is located.
ZoneId string
The zone identifier to target for the resource. Conflicts with account_id.
AccountId string
The account identifier to target for the resource. Conflicts with zone_id.
State string
Managed state of the custom page. Available values: default, customized.
Type string
The type of custom page you wish to update. Available values: basic_challenge, waf_challenge, waf_block, ratelimit_block, country_challenge, ip_block, under_attack, 500_errors, 1000_errors, managed_challenge.
Url string
URL of where the custom page source is located.
ZoneId string
The zone identifier to target for the resource. Conflicts with account_id.
accountId String
The account identifier to target for the resource. Conflicts with zone_id.
state String
Managed state of the custom page. Available values: default, customized.
type String
The type of custom page you wish to update. Available values: basic_challenge, waf_challenge, waf_block, ratelimit_block, country_challenge, ip_block, under_attack, 500_errors, 1000_errors, managed_challenge.
url String
URL of where the custom page source is located.
zoneId String
The zone identifier to target for the resource. Conflicts with account_id.
accountId string
The account identifier to target for the resource. Conflicts with zone_id.
state string
Managed state of the custom page. Available values: default, customized.
type string
The type of custom page you wish to update. Available values: basic_challenge, waf_challenge, waf_block, ratelimit_block, country_challenge, ip_block, under_attack, 500_errors, 1000_errors, managed_challenge.
url string
URL of where the custom page source is located.
zoneId string
The zone identifier to target for the resource. Conflicts with account_id.
account_id str
The account identifier to target for the resource. Conflicts with zone_id.
state str
Managed state of the custom page. Available values: default, customized.
type str
The type of custom page you wish to update. Available values: basic_challenge, waf_challenge, waf_block, ratelimit_block, country_challenge, ip_block, under_attack, 500_errors, 1000_errors, managed_challenge.
url str
URL of where the custom page source is located.
zone_id str
The zone identifier to target for the resource. Conflicts with account_id.
accountId String
The account identifier to target for the resource. Conflicts with zone_id.
state String
Managed state of the custom page. Available values: default, customized.
type String
The type of custom page you wish to update. Available values: basic_challenge, waf_challenge, waf_block, ratelimit_block, country_challenge, ip_block, under_attack, 500_errors, 1000_errors, managed_challenge.
url String
URL of where the custom page source is located.
zoneId String
The zone identifier to target for the resource. Conflicts with account_id.

Import

$ pulumi import cloudflare:index/customPages:CustomPages example <resource_level>/<resource_id>/<custom_page_type>
Copy

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

Package Details

Repository
Cloudflare pulumi/pulumi-cloudflare
License
Apache-2.0
Notes
This Pulumi package is based on the cloudflare Terraform Provider.