Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

CustomPages

Provides a resource which manages Cloudflare custom error pages.

Example Usage

using Pulumi;
using Cloudflare = Pulumi.Cloudflare;

class MyStack : Stack
{
    public MyStack()
    {
        var basicChallenge = new Cloudflare.CustomPages("basicChallenge", new Cloudflare.CustomPagesArgs
        {
            State = "customized",
            Type = "basic_challenge",
            Url = "https://example.com/challenge.html",
            ZoneId = "d41d8cd98f00b204e9800998ecf8427e",
        });
    }

}
package main

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

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := cloudflare.NewCustomPages(ctx, "basicChallenge", &cloudflare.CustomPagesArgs{
            State:  pulumi.String("customized"),
            Type:   pulumi.String("basic_challenge"),
            Url:    pulumi.String("https://example.com/challenge.html"),
            ZoneId: pulumi.String("d41d8cd98f00b204e9800998ecf8427e"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_cloudflare as cloudflare

basic_challenge = cloudflare.CustomPages("basicChallenge",
    state="customized",
    type="basic_challenge",
    url="https://example.com/challenge.html",
    zone_id="d41d8cd98f00b204e9800998ecf8427e")
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";

const basicChallenge = new cloudflare.CustomPages("basic_challenge", {
    state: "customized",
    type: "basic_challenge",
    url: "https://example.com/challenge.html",
    zoneId: "d41d8cd98f00b204e9800998ecf8427e",
});

Create a CustomPages Resource

new CustomPages(name: string, args: CustomPagesArgs, opts?: CustomResourceOptions);
def CustomPages(resource_name: 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)
func NewCustomPages(ctx *Context, name string, args CustomPagesArgs, opts ...ResourceOption) (*CustomPages, error)
public CustomPages(string name, CustomPagesArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args CustomPagesArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args CustomPagesArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args CustomPagesArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

CustomPages Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The CustomPages resource accepts the following input properties:

Type string

The type of custom page you wish to update. Must be one of basic_challenge, waf_challenge, waf_block, ratelimit_block, country_challenge, ip_block, under_attack, 500_errors, 1000_errors, always_online.

Url string

URL of where the custom page source is located.

AccountId string

The account ID where the custom pages should be updated. Either account_id or zone_id must be provided. If account_id is present, it will override the zone setting.

State string
ZoneId string

The zone ID where the custom pages should be updated. Either zone_id or account_id must be provided.

Type string

The type of custom page you wish to update. Must be one of basic_challenge, waf_challenge, waf_block, ratelimit_block, country_challenge, ip_block, under_attack, 500_errors, 1000_errors, always_online.

Url string

URL of where the custom page source is located.

AccountId string

The account ID where the custom pages should be updated. Either account_id or zone_id must be provided. If account_id is present, it will override the zone setting.

State string
ZoneId string

The zone ID where the custom pages should be updated. Either zone_id or account_id must be provided.

type string

The type of custom page you wish to update. Must be one of basic_challenge, waf_challenge, waf_block, ratelimit_block, country_challenge, ip_block, under_attack, 500_errors, 1000_errors, always_online.

url string

URL of where the custom page source is located.

accountId string

The account ID where the custom pages should be updated. Either account_id or zone_id must be provided. If account_id is present, it will override the zone setting.

state string
zoneId string

The zone ID where the custom pages should be updated. Either zone_id or account_id must be provided.

type str

The type of custom page you wish to update. Must be one of basic_challenge, waf_challenge, waf_block, ratelimit_block, country_challenge, ip_block, under_attack, 500_errors, 1000_errors, always_online.

url str

URL of where the custom page source is located.

account_id str

The account ID where the custom pages should be updated. Either account_id or zone_id must be provided. If account_id is present, it will override the zone setting.

state str
zone_id str

The zone ID where the custom pages should be updated. Either zone_id or account_id must be provided.

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 str
The provider-assigned unique ID for this managed resource.

Look up an 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)
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.

The following state arguments are supported:

AccountId string

The account ID where the custom pages should be updated. Either account_id or zone_id must be provided. If account_id is present, it will override the zone setting.

State string
Type string

The type of custom page you wish to update. Must be one of basic_challenge, waf_challenge, waf_block, ratelimit_block, country_challenge, ip_block, under_attack, 500_errors, 1000_errors, always_online.

Url string

URL of where the custom page source is located.

ZoneId string

The zone ID where the custom pages should be updated. Either zone_id or account_id must be provided.

AccountId string

The account ID where the custom pages should be updated. Either account_id or zone_id must be provided. If account_id is present, it will override the zone setting.

State string
Type string

The type of custom page you wish to update. Must be one of basic_challenge, waf_challenge, waf_block, ratelimit_block, country_challenge, ip_block, under_attack, 500_errors, 1000_errors, always_online.

Url string

URL of where the custom page source is located.

ZoneId string

The zone ID where the custom pages should be updated. Either zone_id or account_id must be provided.

accountId string

The account ID where the custom pages should be updated. Either account_id or zone_id must be provided. If account_id is present, it will override the zone setting.

state string
type string

The type of custom page you wish to update. Must be one of basic_challenge, waf_challenge, waf_block, ratelimit_block, country_challenge, ip_block, under_attack, 500_errors, 1000_errors, always_online.

url string

URL of where the custom page source is located.

zoneId string

The zone ID where the custom pages should be updated. Either zone_id or account_id must be provided.

account_id str

The account ID where the custom pages should be updated. Either account_id or zone_id must be provided. If account_id is present, it will override the zone setting.

state str
type str

The type of custom page you wish to update. Must be one of basic_challenge, waf_challenge, waf_block, ratelimit_block, country_challenge, ip_block, under_attack, 500_errors, 1000_errors, always_online.

url str

URL of where the custom page source is located.

zone_id str

The zone ID where the custom pages should be updated. Either zone_id or account_id must be provided.

Import

Custom pages can be imported using a composite ID formed of* customPageLevel - Either account or zone. * identifier - The ID of the account or zone you intend to manage. * pageType - The value from the type argument. Example for a zone

 $ pulumi import cloudflare:index/customPages:CustomPages basic_challenge zone/d41d8cd98f00b204e9800998ecf8427e/basic_challenge

Example for an account

 $ pulumi import cloudflare:index/customPages:CustomPages basic_challenge account/e268443e43d93dab7ebef303bbe9642f/basic_challenge

Package Details

Repository
https://github.com/pulumi/pulumi-cloudflare
License
Apache-2.0
Notes
This Pulumi package is based on the cloudflare Terraform Provider.