Skip to content
Start here

Pages

PagesProjects

resource cloudflare_pages_project

required Expand Collapse
name: String

Name of the project.

account_id: String

Identifier.

production_branch: String

Production branch of the project. Used to identify production deployments.

optional Expand Collapse
build_config?: Attributes

Configs for the project build process.

build_caching?: Bool

Enable build caching for the project.

build_command?: String

Command used to build project.

destination_dir?: String

Output directory of the build.

root_dir?: String

Directory to run the command.

web_analytics_tag?: String

The classifying tag for analytics.

web_analytics_token?: String

The auth token for analytics.

source?: Attributes

Configs for the project source control.

config: Attributes
Deprecateddeployments_enabled?: Bool
Use `production_deployments_enabled` and `preview_deployment_setting` for more granular control.

Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically.

owner?: String

The owner of the repository.

owner_id?: String

The owner ID of the repository.

path_excludes?: List[String]

A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (*) is supported.

path_includes?: List[String]

A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (*) is supported.

pr_comments_enabled?: Bool

Whether to enable PR comments.

preview_branch_excludes?: List[String]

A list of branches that should not trigger a preview deployment. Wildcard syntax (*) is supported. Must be used with preview_deployment_setting set to custom.

preview_branch_includes?: List[String]

A list of branches that should trigger a preview deployment. Wildcard syntax (*) is supported. Must be used with preview_deployment_setting set to custom.

preview_deployment_setting?: String

Controls whether commits to preview branches trigger a preview deployment.

production_branch?: String

The production branch of the repository.

production_deployments_enabled?: Bool

Whether to trigger a production deployment on commits to the production branch.

repo_id?: String

The ID of the repository.

repo_name?: String

The name of the repository.

type: String

The source control management provider.

deployment_configs?: Attributes

Configs for deployments in a project.

preview?: Attributes

Configs for preview deploys.

ai_bindings?: Map[Attributes]

Constellation bindings used for Pages Functions.

project_id: String
always_use_latest_compatibility_date?: Bool

Whether to always use the latest compatibility date for Pages Functions.

analytics_engine_datasets?: Map[Attributes]

Analytics Engine bindings used for Pages Functions.

dataset: String

Name of the dataset.

browsers?: Map[Attributes]

Browser bindings used for Pages Functions.

build_image_major_version?: Int64

The major version of the build image to use for Pages Functions.

compatibility_date?: String

Compatibility date used for Pages Functions.

compatibility_flags?: List[String]

Compatibility flags used for Pages Functions.

d1_databases?: Map[Attributes]

D1 databases used for Pages Functions.

id: String

UUID of the D1 database.

durable_object_namespaces?: Map[Attributes]

Durable Object namespaces used for Pages Functions.

namespace_id: String

ID of the Durable Object namespace.

env_vars?: Map[Attributes]

Environment variables used for builds and Pages Functions.

type: String
value: String

Environment variable value.

fail_open?: Bool

Whether to fail open when the deployment config cannot be applied.

hyperdrive_bindings?: Map[Attributes]

Hyperdrive bindings used for Pages Functions.

id: String
kv_namespaces?: Map[Attributes]

KV namespaces used for Pages Functions.

namespace_id: String

ID of the KV namespace.

limits?: Attributes

Limits for Pages Functions.

cpu_ms: Int64

CPU time limit in milliseconds.

mtls_certificates?: Map[Attributes]

mTLS bindings used for Pages Functions.

certificate_id: String
placement?: Attributes

Placement setting used for Pages Functions.

mode: String

Placement mode.

queue_producers?: Map[Attributes]

Queue Producer bindings used for Pages Functions.

name: String

Name of the Queue.

r2_buckets?: Map[Attributes]

R2 buckets used for Pages Functions.

name: String

Name of the R2 bucket.

jurisdiction?: String

Jurisdiction of the R2 bucket.

services?: Map[Attributes]

Services used for Pages Functions.

service: String

The Service name.

entrypoint?: String

The entrypoint to bind to.

environment?: String

The Service environment.

Deprecatedusage_model?: String
All new projects now use the Standard usage model.

The usage model for Pages Functions.

vectorize_bindings?: Map[Attributes]

Vectorize bindings used for Pages Functions.

index_name: String
wrangler_config_hash?: String

Hash of the Wrangler configuration used for the deployment.

production?: Attributes

Configs for production deploys.

ai_bindings?: Map[Attributes]

Constellation bindings used for Pages Functions.

project_id: String
always_use_latest_compatibility_date?: Bool

Whether to always use the latest compatibility date for Pages Functions.

analytics_engine_datasets?: Map[Attributes]

Analytics Engine bindings used for Pages Functions.

dataset: String

Name of the dataset.

browsers?: Map[Attributes]

Browser bindings used for Pages Functions.

build_image_major_version?: Int64

The major version of the build image to use for Pages Functions.

compatibility_date?: String

Compatibility date used for Pages Functions.

compatibility_flags?: List[String]

Compatibility flags used for Pages Functions.

d1_databases?: Map[Attributes]

D1 databases used for Pages Functions.

id: String

UUID of the D1 database.

durable_object_namespaces?: Map[Attributes]

Durable Object namespaces used for Pages Functions.

namespace_id: String

ID of the Durable Object namespace.

env_vars?: Map[Attributes]

Environment variables used for builds and Pages Functions.

type: String
value: String

Environment variable value.

fail_open?: Bool

Whether to fail open when the deployment config cannot be applied.

hyperdrive_bindings?: Map[Attributes]

Hyperdrive bindings used for Pages Functions.

id: String
kv_namespaces?: Map[Attributes]

KV namespaces used for Pages Functions.

namespace_id: String

ID of the KV namespace.

limits?: Attributes

Limits for Pages Functions.

cpu_ms: Int64

CPU time limit in milliseconds.

mtls_certificates?: Map[Attributes]

mTLS bindings used for Pages Functions.

certificate_id: String
placement?: Attributes

Placement setting used for Pages Functions.

mode: String

Placement mode.

queue_producers?: Map[Attributes]

Queue Producer bindings used for Pages Functions.

name: String

Name of the Queue.

r2_buckets?: Map[Attributes]

R2 buckets used for Pages Functions.

name: String

Name of the R2 bucket.

jurisdiction?: String

Jurisdiction of the R2 bucket.

services?: Map[Attributes]

Services used for Pages Functions.

service: String

The Service name.

entrypoint?: String

The entrypoint to bind to.

environment?: String

The Service environment.

Deprecatedusage_model?: String
All new projects now use the Standard usage model.

The usage model for Pages Functions.

vectorize_bindings?: Map[Attributes]

Vectorize bindings used for Pages Functions.

index_name: String
wrangler_config_hash?: String

Hash of the Wrangler configuration used for the deployment.

computed Expand Collapse
id: String

Name of the project.

created_on: Time

When the project was created.

framework: String

Framework the project is using.

framework_version: String

Version of the framework the project is using.

preview_script_name: String

Name of the preview script.

production_script_name: String

Name of the production script.

subdomain: String

The Cloudflare subdomain associated with the project.

uses_functions: Bool

Whether the project uses functions.

domains: List[String]

A list of associated custom domains for the project.

canonical_deployment: Attributes

Most recent production deployment of the project.

id: String

Id of the deployment.

aliases: List[String]

A list of alias URLs pointing to this deployment.

build_config: Attributes

Configs for the project build process.

web_analytics_tag: String

The classifying tag for analytics.

web_analytics_token: String

The auth token for analytics.

build_caching: Bool

Enable build caching for the project.

build_command: String

Command used to build project.

destination_dir: String

Assets output directory of the build.

root_dir: String

Directory to run the command.

created_on: Time

When the deployment was created.

deployment_trigger: Attributes

Info about what caused the deployment.

metadata: Attributes

Additional info about the trigger.

branch: String

Where the trigger happened.

commit_dirty: Bool

Whether the deployment trigger commit was dirty.

commit_hash: String

Hash of the deployment trigger commit.

commit_message: String

Message of the deployment trigger commit.

type: String

What caused the deployment.

env_vars: Map[Attributes]

Environment variables used for builds and Pages Functions.

type: String
value: String

Environment variable value.

environment: String

Type of deploy.

is_skipped: Bool

If the deployment has been skipped.

latest_stage: Attributes

The status of the deployment.

ended_on: Time

When the stage ended.

name: String

The current build stage.

started_on: Time

When the stage started.

status: String

State of the current stage.

modified_on: Time

When the deployment was last modified.

project_id: String

Id of the project.

project_name: String

Name of the project.

short_id: String

Short Id (8 character) of the deployment.

source: Attributes

Configs for the project source control.

config: Attributes
Deprecateddeployments_enabled: Bool
Use `production_deployments_enabled` and `preview_deployment_setting` for more granular control.

Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically.

owner: String

The owner of the repository.

owner_id: String

The owner ID of the repository.

path_excludes: List[String]

A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (*) is supported.

path_includes: List[String]

A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (*) is supported.

pr_comments_enabled: Bool

Whether to enable PR comments.

preview_branch_excludes: List[String]

A list of branches that should not trigger a preview deployment. Wildcard syntax (*) is supported. Must be used with preview_deployment_setting set to custom.

preview_branch_includes: List[String]

A list of branches that should trigger a preview deployment. Wildcard syntax (*) is supported. Must be used with preview_deployment_setting set to custom.

preview_deployment_setting: String

Controls whether commits to preview branches trigger a preview deployment.

production_branch: String

The production branch of the repository.

production_deployments_enabled: Bool

Whether to trigger a production deployment on commits to the production branch.

repo_id: String

The ID of the repository.

repo_name: String

The name of the repository.

type: String

The source control management provider.

stages: List[Attributes]

List of past stages.

ended_on: Time

When the stage ended.

name: String

The current build stage.

started_on: Time

When the stage started.

status: String

State of the current stage.

url: String

The live URL to view this deployment.

uses_functions: Bool

Whether the deployment uses functions.

latest_deployment: Attributes

Most recent deployment of the project.

id: String

Id of the deployment.

aliases: List[String]

A list of alias URLs pointing to this deployment.

build_config: Attributes

Configs for the project build process.

web_analytics_tag: String

The classifying tag for analytics.

web_analytics_token: String

The auth token for analytics.

build_caching: Bool

Enable build caching for the project.

build_command: String

Command used to build project.

destination_dir: String

Assets output directory of the build.

root_dir: String

Directory to run the command.

created_on: Time

When the deployment was created.

deployment_trigger: Attributes

Info about what caused the deployment.

metadata: Attributes

Additional info about the trigger.

branch: String

Where the trigger happened.

commit_dirty: Bool

Whether the deployment trigger commit was dirty.

commit_hash: String

Hash of the deployment trigger commit.

commit_message: String

Message of the deployment trigger commit.

type: String

What caused the deployment.

env_vars: Map[Attributes]

Environment variables used for builds and Pages Functions.

type: String
value: String

Environment variable value.

environment: String

Type of deploy.

is_skipped: Bool

If the deployment has been skipped.

latest_stage: Attributes

The status of the deployment.

ended_on: Time

When the stage ended.

name: String

The current build stage.

started_on: Time

When the stage started.

status: String

State of the current stage.

modified_on: Time

When the deployment was last modified.

project_id: String

Id of the project.

project_name: String

Name of the project.

short_id: String

Short Id (8 character) of the deployment.

source: Attributes

Configs for the project source control.

config: Attributes
Deprecateddeployments_enabled: Bool
Use `production_deployments_enabled` and `preview_deployment_setting` for more granular control.

Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically.

owner: String

The owner of the repository.

owner_id: String

The owner ID of the repository.

path_excludes: List[String]

A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (*) is supported.

path_includes: List[String]

A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (*) is supported.

pr_comments_enabled: Bool

Whether to enable PR comments.

preview_branch_excludes: List[String]

A list of branches that should not trigger a preview deployment. Wildcard syntax (*) is supported. Must be used with preview_deployment_setting set to custom.

preview_branch_includes: List[String]

A list of branches that should trigger a preview deployment. Wildcard syntax (*) is supported. Must be used with preview_deployment_setting set to custom.

preview_deployment_setting: String

Controls whether commits to preview branches trigger a preview deployment.

production_branch: String

The production branch of the repository.

production_deployments_enabled: Bool

Whether to trigger a production deployment on commits to the production branch.

repo_id: String

The ID of the repository.

repo_name: String

The name of the repository.

type: String

The source control management provider.

stages: List[Attributes]

List of past stages.

ended_on: Time

When the stage ended.

name: String

The current build stage.

started_on: Time

When the stage started.

status: String

State of the current stage.

url: String

The live URL to view this deployment.

uses_functions: Bool

Whether the deployment uses functions.

cloudflare_pages_project

resource "cloudflare_pages_project" "example_pages_project" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  name = "my-pages-app"
  production_branch = "main"
  build_config = {
    build_caching = true
    build_command = "npm run build"
    destination_dir = "build"
    root_dir = "/"
    web_analytics_tag = "cee1c73f6e4743d0b5e6bb1a0bcaabcc"
    web_analytics_token = "021e1057c18547eca7b79f2516f06o7x"
  }
  deployment_configs = {
    preview = {
      ai_bindings = {
        AI_BINDING = {
          project_id = "some-project-id"
        }
      }
      always_use_latest_compatibility_date = false
      analytics_engine_datasets = {
        ANALYTICS_ENGINE_BINDING = {
          dataset = "api_analytics"
        }
      }
      browsers = {
        BROWSER = {

        }
      }
      build_image_major_version = 3
      compatibility_date = "2025-01-01"
      compatibility_flags = ["url_standard"]
      d1_databases = {
        D1_BINDING = {
          id = "445e2955-951a-43f8-a35b-a4d0c8138f63"
        }
      }
      durable_object_namespaces = {
        DO_BINDING = {
          namespace_id = "5eb63bbbe01eeed093cb22bb8f5acdc3"
        }
      }
      env_vars = {
        foo = {
          type = "plain_text"
          value = "hello world"
        }
      }
      fail_open = true
      hyperdrive_bindings = {
        HYPERDRIVE = {
          id = "a76a99bc342644deb02c38d66082262a"
        }
      }
      kv_namespaces = {
        KV_BINDING = {
          namespace_id = "5eb63bbbe01eeed093cb22bb8f5acdc3"
        }
      }
      limits = {
        cpu_ms = 100
      }
      mtls_certificates = {
        MTLS = {
          certificate_id = "d7cdd17c-916f-4cb7-aabe-585eb382ec4e"
        }
      }
      placement = {
        mode = "smart"
      }
      queue_producers = {
        QUEUE_PRODUCER_BINDING = {
          name = "some-queue"
        }
      }
      r2_buckets = {
        R2_BINDING = {
          name = "some-bucket"
          jurisdiction = "eu"
        }
      }
      services = {
        SERVICE_BINDING = {
          service = "example-worker"
          entrypoint = "MyHandler"
          environment = "production"
        }
      }
      usage_model = "standard"
      vectorize_bindings = {
        VECTORIZE = {
          index_name = "my_index"
        }
      }
      wrangler_config_hash = "abc123def456"
    }
    production = {
      ai_bindings = {
        AI_BINDING = {
          project_id = "some-project-id"
        }
      }
      always_use_latest_compatibility_date = false
      analytics_engine_datasets = {
        ANALYTICS_ENGINE_BINDING = {
          dataset = "api_analytics"
        }
      }
      browsers = {
        BROWSER = {

        }
      }
      build_image_major_version = 3
      compatibility_date = "2025-01-01"
      compatibility_flags = ["url_standard"]
      d1_databases = {
        D1_BINDING = {
          id = "445e2955-951a-43f8-a35b-a4d0c8138f63"
        }
      }
      durable_object_namespaces = {
        DO_BINDING = {
          namespace_id = "5eb63bbbe01eeed093cb22bb8f5acdc3"
        }
      }
      env_vars = {
        foo = {
          type = "plain_text"
          value = "hello world"
        }
      }
      fail_open = true
      hyperdrive_bindings = {
        HYPERDRIVE = {
          id = "a76a99bc342644deb02c38d66082262a"
        }
      }
      kv_namespaces = {
        KV_BINDING = {
          namespace_id = "5eb63bbbe01eeed093cb22bb8f5acdc3"
        }
      }
      limits = {
        cpu_ms = 100
      }
      mtls_certificates = {
        MTLS = {
          certificate_id = "d7cdd17c-916f-4cb7-aabe-585eb382ec4e"
        }
      }
      placement = {
        mode = "smart"
      }
      queue_producers = {
        QUEUE_PRODUCER_BINDING = {
          name = "some-queue"
        }
      }
      r2_buckets = {
        R2_BINDING = {
          name = "some-bucket"
          jurisdiction = "eu"
        }
      }
      services = {
        SERVICE_BINDING = {
          service = "example-worker"
          entrypoint = "MyHandler"
          environment = "production"
        }
      }
      usage_model = "standard"
      vectorize_bindings = {
        VECTORIZE = {
          index_name = "my_index"
        }
      }
      wrangler_config_hash = "abc123def456"
    }
  }
  source = {
    config = {
      deployments_enabled = true
      owner = "my-org"
      owner_id = "12345678"
      path_excludes = ["string"]
      path_includes = ["string"]
      pr_comments_enabled = true
      preview_branch_excludes = ["string"]
      preview_branch_includes = ["string"]
      preview_deployment_setting = "all"
      production_branch = "main"
      production_deployments_enabled = true
      repo_id = "12345678"
      repo_name = "my-repo"
    }
    type = "github"
  }
}

data cloudflare_pages_project

required Expand Collapse
project_name: String

Name of the project.

account_id: String

Identifier.

computed Expand Collapse
id: String

Name of the project.

created_on: Time

When the project was created.

framework: String

Framework the project is using.

framework_version: String

Version of the framework the project is using.

name: String

Name of the project.

preview_script_name: String

Name of the preview script.

production_branch: String

Production branch of the project. Used to identify production deployments.

production_script_name: String

Name of the production script.

subdomain: String

The Cloudflare subdomain associated with the project.

uses_functions: Bool

Whether the project uses functions.

domains: List[String]

A list of associated custom domains for the project.

build_config: Attributes

Configs for the project build process.

web_analytics_tag: String

The classifying tag for analytics.

web_analytics_token: String

The auth token for analytics.

build_caching: Bool

Enable build caching for the project.

build_command: String

Command used to build project.

destination_dir: String

Assets output directory of the build.

root_dir: String

Directory to run the command.

canonical_deployment: Attributes

Most recent production deployment of the project.

id: String

Id of the deployment.

aliases: List[String]

A list of alias URLs pointing to this deployment.

build_config: Attributes

Configs for the project build process.

web_analytics_tag: String

The classifying tag for analytics.

web_analytics_token: String

The auth token for analytics.

build_caching: Bool

Enable build caching for the project.

build_command: String

Command used to build project.

destination_dir: String

Assets output directory of the build.

root_dir: String

Directory to run the command.

created_on: Time

When the deployment was created.

deployment_trigger: Attributes

Info about what caused the deployment.

metadata: Attributes

Additional info about the trigger.

branch: String

Where the trigger happened.

commit_dirty: Bool

Whether the deployment trigger commit was dirty.

commit_hash: String

Hash of the deployment trigger commit.

commit_message: String

Message of the deployment trigger commit.

type: String

What caused the deployment.

env_vars: Map[Attributes]

Environment variables used for builds and Pages Functions.

type: String
value: String

Environment variable value.

environment: String

Type of deploy.

is_skipped: Bool

If the deployment has been skipped.

latest_stage: Attributes

The status of the deployment.

ended_on: Time

When the stage ended.

name: String

The current build stage.

started_on: Time

When the stage started.

status: String

State of the current stage.

modified_on: Time

When the deployment was last modified.

project_id: String

Id of the project.

project_name: String

Name of the project.

short_id: String

Short Id (8 character) of the deployment.

source: Attributes

Configs for the project source control.

config: Attributes
Deprecateddeployments_enabled: Bool
Use `production_deployments_enabled` and `preview_deployment_setting` for more granular control.

Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically.

owner: String

The owner of the repository.

owner_id: String

The owner ID of the repository.

path_excludes: List[String]

A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (*) is supported.

path_includes: List[String]

A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (*) is supported.

pr_comments_enabled: Bool

Whether to enable PR comments.

preview_branch_excludes: List[String]

A list of branches that should not trigger a preview deployment. Wildcard syntax (*) is supported. Must be used with preview_deployment_setting set to custom.

preview_branch_includes: List[String]

A list of branches that should trigger a preview deployment. Wildcard syntax (*) is supported. Must be used with preview_deployment_setting set to custom.

preview_deployment_setting: String

Controls whether commits to preview branches trigger a preview deployment.

production_branch: String

The production branch of the repository.

production_deployments_enabled: Bool

Whether to trigger a production deployment on commits to the production branch.

repo_id: String

The ID of the repository.

repo_name: String

The name of the repository.

type: String

The source control management provider.

stages: List[Attributes]

List of past stages.

ended_on: Time

When the stage ended.

name: String

The current build stage.

started_on: Time

When the stage started.

status: String

State of the current stage.

url: String

The live URL to view this deployment.

uses_functions: Bool

Whether the deployment uses functions.

deployment_configs: Attributes

Configs for deployments in a project.

preview: Attributes

Configs for preview deploys.

always_use_latest_compatibility_date: Bool

Whether to always use the latest compatibility date for Pages Functions.

build_image_major_version: Int64

The major version of the build image to use for Pages Functions.

compatibility_date: String

Compatibility date used for Pages Functions.

compatibility_flags: List[String]

Compatibility flags used for Pages Functions.

env_vars: Map[Attributes]

Environment variables used for builds and Pages Functions.

type: String
value: String

Environment variable value.

fail_open: Bool

Whether to fail open when the deployment config cannot be applied.

Deprecatedusage_model: String
All new projects now use the Standard usage model.

The usage model for Pages Functions.

ai_bindings: Map[Attributes]

Constellation bindings used for Pages Functions.

project_id: String
analytics_engine_datasets: Map[Attributes]

Analytics Engine bindings used for Pages Functions.

dataset: String

Name of the dataset.

browsers: Map[Attributes]

Browser bindings used for Pages Functions.

d1_databases: Map[Attributes]

D1 databases used for Pages Functions.

id: String

UUID of the D1 database.

durable_object_namespaces: Map[Attributes]

Durable Object namespaces used for Pages Functions.

namespace_id: String

ID of the Durable Object namespace.

hyperdrive_bindings: Map[Attributes]

Hyperdrive bindings used for Pages Functions.

id: String
kv_namespaces: Map[Attributes]

KV namespaces used for Pages Functions.

namespace_id: String

ID of the KV namespace.

limits: Attributes

Limits for Pages Functions.

cpu_ms: Int64

CPU time limit in milliseconds.

mtls_certificates: Map[Attributes]

mTLS bindings used for Pages Functions.

certificate_id: String
placement: Attributes

Placement setting used for Pages Functions.

mode: String

Placement mode.

queue_producers: Map[Attributes]

Queue Producer bindings used for Pages Functions.

name: String

Name of the Queue.

r2_buckets: Map[Attributes]

R2 buckets used for Pages Functions.

name: String

Name of the R2 bucket.

jurisdiction: String

Jurisdiction of the R2 bucket.

services: Map[Attributes]

Services used for Pages Functions.

environment: String

The Service environment.

service: String

The Service name.

entrypoint: String

The entrypoint to bind to.

vectorize_bindings: Map[Attributes]

Vectorize bindings used for Pages Functions.

index_name: String
wrangler_config_hash: String

Hash of the Wrangler configuration used for the deployment.

production: Attributes

Configs for production deploys.

always_use_latest_compatibility_date: Bool

Whether to always use the latest compatibility date for Pages Functions.

build_image_major_version: Int64

The major version of the build image to use for Pages Functions.

compatibility_date: String

Compatibility date used for Pages Functions.

compatibility_flags: List[String]

Compatibility flags used for Pages Functions.

env_vars: Map[Attributes]

Environment variables used for builds and Pages Functions.

type: String
value: String

Environment variable value.

fail_open: Bool

Whether to fail open when the deployment config cannot be applied.

Deprecatedusage_model: String
All new projects now use the Standard usage model.

The usage model for Pages Functions.

ai_bindings: Map[Attributes]

Constellation bindings used for Pages Functions.

project_id: String
analytics_engine_datasets: Map[Attributes]

Analytics Engine bindings used for Pages Functions.

dataset: String

Name of the dataset.

browsers: Map[Attributes]

Browser bindings used for Pages Functions.

d1_databases: Map[Attributes]

D1 databases used for Pages Functions.

id: String

UUID of the D1 database.

durable_object_namespaces: Map[Attributes]

Durable Object namespaces used for Pages Functions.

namespace_id: String

ID of the Durable Object namespace.

hyperdrive_bindings: Map[Attributes]

Hyperdrive bindings used for Pages Functions.

id: String
kv_namespaces: Map[Attributes]

KV namespaces used for Pages Functions.

namespace_id: String

ID of the KV namespace.

limits: Attributes

Limits for Pages Functions.

cpu_ms: Int64

CPU time limit in milliseconds.

mtls_certificates: Map[Attributes]

mTLS bindings used for Pages Functions.

certificate_id: String
placement: Attributes

Placement setting used for Pages Functions.

mode: String

Placement mode.

queue_producers: Map[Attributes]

Queue Producer bindings used for Pages Functions.

name: String

Name of the Queue.

r2_buckets: Map[Attributes]

R2 buckets used for Pages Functions.

name: String

Name of the R2 bucket.

jurisdiction: String

Jurisdiction of the R2 bucket.

services: Map[Attributes]

Services used for Pages Functions.

environment: String

The Service environment.

service: String

The Service name.

entrypoint: String

The entrypoint to bind to.

vectorize_bindings: Map[Attributes]

Vectorize bindings used for Pages Functions.

index_name: String
wrangler_config_hash: String

Hash of the Wrangler configuration used for the deployment.

latest_deployment: Attributes

Most recent deployment of the project.

id: String

Id of the deployment.

aliases: List[String]

A list of alias URLs pointing to this deployment.

build_config: Attributes

Configs for the project build process.

web_analytics_tag: String

The classifying tag for analytics.

web_analytics_token: String

The auth token for analytics.

build_caching: Bool

Enable build caching for the project.

build_command: String

Command used to build project.

destination_dir: String

Assets output directory of the build.

root_dir: String

Directory to run the command.

created_on: Time

When the deployment was created.

deployment_trigger: Attributes

Info about what caused the deployment.

metadata: Attributes

Additional info about the trigger.

branch: String

Where the trigger happened.

commit_dirty: Bool

Whether the deployment trigger commit was dirty.

commit_hash: String

Hash of the deployment trigger commit.

commit_message: String

Message of the deployment trigger commit.

type: String

What caused the deployment.

env_vars: Map[Attributes]

Environment variables used for builds and Pages Functions.

type: String
value: String

Environment variable value.

environment: String

Type of deploy.

is_skipped: Bool

If the deployment has been skipped.

latest_stage: Attributes

The status of the deployment.

ended_on: Time

When the stage ended.

name: String

The current build stage.

started_on: Time

When the stage started.

status: String

State of the current stage.

modified_on: Time

When the deployment was last modified.

project_id: String

Id of the project.

project_name: String

Name of the project.

short_id: String

Short Id (8 character) of the deployment.

source: Attributes

Configs for the project source control.

config: Attributes
Deprecateddeployments_enabled: Bool
Use `production_deployments_enabled` and `preview_deployment_setting` for more granular control.

Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically.

owner: String

The owner of the repository.

owner_id: String

The owner ID of the repository.

path_excludes: List[String]

A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (*) is supported.

path_includes: List[String]

A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (*) is supported.

pr_comments_enabled: Bool

Whether to enable PR comments.

preview_branch_excludes: List[String]

A list of branches that should not trigger a preview deployment. Wildcard syntax (*) is supported. Must be used with preview_deployment_setting set to custom.

preview_branch_includes: List[String]

A list of branches that should trigger a preview deployment. Wildcard syntax (*) is supported. Must be used with preview_deployment_setting set to custom.

preview_deployment_setting: String

Controls whether commits to preview branches trigger a preview deployment.

production_branch: String

The production branch of the repository.

production_deployments_enabled: Bool

Whether to trigger a production deployment on commits to the production branch.

repo_id: String

The ID of the repository.

repo_name: String

The name of the repository.

type: String

The source control management provider.

stages: List[Attributes]

List of past stages.

ended_on: Time

When the stage ended.

name: String

The current build stage.

started_on: Time

When the stage started.

status: String

State of the current stage.

url: String

The live URL to view this deployment.

uses_functions: Bool

Whether the deployment uses functions.

source: Attributes

Configs for the project source control.

config: Attributes
Deprecateddeployments_enabled: Bool
Use `production_deployments_enabled` and `preview_deployment_setting` for more granular control.

Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically.

owner: String

The owner of the repository.

owner_id: String

The owner ID of the repository.

path_excludes: List[String]

A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (*) is supported.

path_includes: List[String]

A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (*) is supported.

pr_comments_enabled: Bool

Whether to enable PR comments.

preview_branch_excludes: List[String]

A list of branches that should not trigger a preview deployment. Wildcard syntax (*) is supported. Must be used with preview_deployment_setting set to custom.

preview_branch_includes: List[String]

A list of branches that should trigger a preview deployment. Wildcard syntax (*) is supported. Must be used with preview_deployment_setting set to custom.

preview_deployment_setting: String

Controls whether commits to preview branches trigger a preview deployment.

production_branch: String

The production branch of the repository.

production_deployments_enabled: Bool

Whether to trigger a production deployment on commits to the production branch.

repo_id: String

The ID of the repository.

repo_name: String

The name of the repository.

type: String

The source control management provider.

cloudflare_pages_project

data "cloudflare_pages_project" "example_pages_project" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  project_name = "this-is-my-project-01"
}

data cloudflare_pages_projects

required Expand Collapse
account_id: String

Identifier.

optional Expand Collapse
max_items?: Int64

Max items to fetch, default: 1000

computed Expand Collapse
result: List[Attributes]

The items returned by the data source

id: String

ID of the project.

canonical_deployment: Attributes

Most recent production deployment of the project.

id: String

Id of the deployment.

aliases: List[String]

A list of alias URLs pointing to this deployment.

build_config: Attributes

Configs for the project build process.

web_analytics_tag: String

The classifying tag for analytics.

web_analytics_token: String

The auth token for analytics.

build_caching: Bool

Enable build caching for the project.

build_command: String

Command used to build project.

destination_dir: String

Assets output directory of the build.

root_dir: String

Directory to run the command.

created_on: Time

When the deployment was created.

deployment_trigger: Attributes

Info about what caused the deployment.

metadata: Attributes

Additional info about the trigger.

branch: String

Where the trigger happened.

commit_dirty: Bool

Whether the deployment trigger commit was dirty.

commit_hash: String

Hash of the deployment trigger commit.

commit_message: String

Message of the deployment trigger commit.

type: String

What caused the deployment.

env_vars: Map[Attributes]

Environment variables used for builds and Pages Functions.

type: String
value: String

Environment variable value.

environment: String

Type of deploy.

is_skipped: Bool

If the deployment has been skipped.

latest_stage: Attributes

The status of the deployment.

ended_on: Time

When the stage ended.

name: String

The current build stage.

started_on: Time

When the stage started.

status: String

State of the current stage.

modified_on: Time

When the deployment was last modified.

project_id: String

Id of the project.

project_name: String

Name of the project.

short_id: String

Short Id (8 character) of the deployment.

source: Attributes

Configs for the project source control.

config: Attributes
Deprecateddeployments_enabled: Bool
Use `production_deployments_enabled` and `preview_deployment_setting` for more granular control.

Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically.

owner: String

The owner of the repository.

owner_id: String

The owner ID of the repository.

path_excludes: List[String]

A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (*) is supported.

path_includes: List[String]

A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (*) is supported.

pr_comments_enabled: Bool

Whether to enable PR comments.

preview_branch_excludes: List[String]

A list of branches that should not trigger a preview deployment. Wildcard syntax (*) is supported. Must be used with preview_deployment_setting set to custom.

preview_branch_includes: List[String]

A list of branches that should trigger a preview deployment. Wildcard syntax (*) is supported. Must be used with preview_deployment_setting set to custom.

preview_deployment_setting: String

Controls whether commits to preview branches trigger a preview deployment.

production_branch: String

The production branch of the repository.

production_deployments_enabled: Bool

Whether to trigger a production deployment on commits to the production branch.

repo_id: String

The ID of the repository.

repo_name: String

The name of the repository.

type: String

The source control management provider.

stages: List[Attributes]

List of past stages.

ended_on: Time

When the stage ended.

name: String

The current build stage.

started_on: Time

When the stage started.

status: String

State of the current stage.

url: String

The live URL to view this deployment.

uses_functions: Bool

Whether the deployment uses functions.

created_on: Time

When the project was created.

deployment_configs: Attributes

Configs for deployments in a project.

preview: Attributes

Configs for preview deploys.

always_use_latest_compatibility_date: Bool

Whether to always use the latest compatibility date for Pages Functions.

build_image_major_version: Int64

The major version of the build image to use for Pages Functions.

compatibility_date: String

Compatibility date used for Pages Functions.

compatibility_flags: List[String]

Compatibility flags used for Pages Functions.

env_vars: Map[Attributes]

Environment variables used for builds and Pages Functions.

type: String
value: String

Environment variable value.

fail_open: Bool

Whether to fail open when the deployment config cannot be applied.

Deprecatedusage_model: String
All new projects now use the Standard usage model.

The usage model for Pages Functions.

ai_bindings: Map[Attributes]

Constellation bindings used for Pages Functions.

project_id: String
analytics_engine_datasets: Map[Attributes]

Analytics Engine bindings used for Pages Functions.

dataset: String

Name of the dataset.

browsers: Map[Attributes]

Browser bindings used for Pages Functions.

d1_databases: Map[Attributes]

D1 databases used for Pages Functions.

id: String

UUID of the D1 database.

durable_object_namespaces: Map[Attributes]

Durable Object namespaces used for Pages Functions.

namespace_id: String

ID of the Durable Object namespace.

hyperdrive_bindings: Map[Attributes]

Hyperdrive bindings used for Pages Functions.

id: String
kv_namespaces: Map[Attributes]

KV namespaces used for Pages Functions.

namespace_id: String

ID of the KV namespace.

limits: Attributes

Limits for Pages Functions.

cpu_ms: Int64

CPU time limit in milliseconds.

mtls_certificates: Map[Attributes]

mTLS bindings used for Pages Functions.

certificate_id: String
placement: Attributes

Placement setting used for Pages Functions.

mode: String

Placement mode.

queue_producers: Map[Attributes]

Queue Producer bindings used for Pages Functions.

name: String

Name of the Queue.

r2_buckets: Map[Attributes]

R2 buckets used for Pages Functions.

name: String

Name of the R2 bucket.

jurisdiction: String

Jurisdiction of the R2 bucket.

services: Map[Attributes]

Services used for Pages Functions.

environment: String

The Service environment.

service: String

The Service name.

entrypoint: String

The entrypoint to bind to.

vectorize_bindings: Map[Attributes]

Vectorize bindings used for Pages Functions.

index_name: String
wrangler_config_hash: String

Hash of the Wrangler configuration used for the deployment.

production: Attributes

Configs for production deploys.

always_use_latest_compatibility_date: Bool

Whether to always use the latest compatibility date for Pages Functions.

build_image_major_version: Int64

The major version of the build image to use for Pages Functions.

compatibility_date: String

Compatibility date used for Pages Functions.

compatibility_flags: List[String]

Compatibility flags used for Pages Functions.

env_vars: Map[Attributes]

Environment variables used for builds and Pages Functions.

type: String
value: String

Environment variable value.

fail_open: Bool

Whether to fail open when the deployment config cannot be applied.

Deprecatedusage_model: String
All new projects now use the Standard usage model.

The usage model for Pages Functions.

ai_bindings: Map[Attributes]

Constellation bindings used for Pages Functions.

project_id: String
analytics_engine_datasets: Map[Attributes]

Analytics Engine bindings used for Pages Functions.

dataset: String

Name of the dataset.

browsers: Map[Attributes]

Browser bindings used for Pages Functions.

d1_databases: Map[Attributes]

D1 databases used for Pages Functions.

id: String

UUID of the D1 database.

durable_object_namespaces: Map[Attributes]

Durable Object namespaces used for Pages Functions.

namespace_id: String

ID of the Durable Object namespace.

hyperdrive_bindings: Map[Attributes]

Hyperdrive bindings used for Pages Functions.

id: String
kv_namespaces: Map[Attributes]

KV namespaces used for Pages Functions.

namespace_id: String

ID of the KV namespace.

limits: Attributes

Limits for Pages Functions.

cpu_ms: Int64

CPU time limit in milliseconds.

mtls_certificates: Map[Attributes]

mTLS bindings used for Pages Functions.

certificate_id: String
placement: Attributes

Placement setting used for Pages Functions.

mode: String

Placement mode.

queue_producers: Map[Attributes]

Queue Producer bindings used for Pages Functions.

name: String

Name of the Queue.

r2_buckets: Map[Attributes]

R2 buckets used for Pages Functions.

name: String

Name of the R2 bucket.

jurisdiction: String

Jurisdiction of the R2 bucket.

services: Map[Attributes]

Services used for Pages Functions.

environment: String

The Service environment.

service: String

The Service name.

entrypoint: String

The entrypoint to bind to.

vectorize_bindings: Map[Attributes]

Vectorize bindings used for Pages Functions.

index_name: String
wrangler_config_hash: String

Hash of the Wrangler configuration used for the deployment.

framework: String

Framework the project is using.

framework_version: String

Version of the framework the project is using.

latest_deployment: Attributes

Most recent deployment of the project.

id: String

Id of the deployment.

aliases: List[String]

A list of alias URLs pointing to this deployment.

build_config: Attributes

Configs for the project build process.

web_analytics_tag: String

The classifying tag for analytics.

web_analytics_token: String

The auth token for analytics.

build_caching: Bool

Enable build caching for the project.

build_command: String

Command used to build project.

destination_dir: String

Assets output directory of the build.

root_dir: String

Directory to run the command.

created_on: Time

When the deployment was created.

deployment_trigger: Attributes

Info about what caused the deployment.

metadata: Attributes

Additional info about the trigger.

branch: String

Where the trigger happened.

commit_dirty: Bool

Whether the deployment trigger commit was dirty.

commit_hash: String

Hash of the deployment trigger commit.

commit_message: String

Message of the deployment trigger commit.

type: String

What caused the deployment.

env_vars: Map[Attributes]

Environment variables used for builds and Pages Functions.

type: String
value: String

Environment variable value.

environment: String

Type of deploy.

is_skipped: Bool

If the deployment has been skipped.

latest_stage: Attributes

The status of the deployment.

ended_on: Time

When the stage ended.

name: String

The current build stage.

started_on: Time

When the stage started.

status: String

State of the current stage.

modified_on: Time

When the deployment was last modified.

project_id: String

Id of the project.

project_name: String

Name of the project.

short_id: String

Short Id (8 character) of the deployment.

source: Attributes

Configs for the project source control.

config: Attributes
Deprecateddeployments_enabled: Bool
Use `production_deployments_enabled` and `preview_deployment_setting` for more granular control.

Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically.

owner: String

The owner of the repository.

owner_id: String

The owner ID of the repository.

path_excludes: List[String]

A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (*) is supported.

path_includes: List[String]

A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (*) is supported.

pr_comments_enabled: Bool

Whether to enable PR comments.

preview_branch_excludes: List[String]

A list of branches that should not trigger a preview deployment. Wildcard syntax (*) is supported. Must be used with preview_deployment_setting set to custom.

preview_branch_includes: List[String]

A list of branches that should trigger a preview deployment. Wildcard syntax (*) is supported. Must be used with preview_deployment_setting set to custom.

preview_deployment_setting: String

Controls whether commits to preview branches trigger a preview deployment.

production_branch: String

The production branch of the repository.

production_deployments_enabled: Bool

Whether to trigger a production deployment on commits to the production branch.

repo_id: String

The ID of the repository.

repo_name: String

The name of the repository.

type: String

The source control management provider.

stages: List[Attributes]

List of past stages.

ended_on: Time

When the stage ended.

name: String

The current build stage.

started_on: Time

When the stage started.

status: String

State of the current stage.

url: String

The live URL to view this deployment.

uses_functions: Bool

Whether the deployment uses functions.

name: String

Name of the project.

preview_script_name: String

Name of the preview script.

production_branch: String

Production branch of the project. Used to identify production deployments.

production_script_name: String

Name of the production script.

uses_functions: Bool

Whether the project uses functions.

build_config: Attributes

Configs for the project build process.

web_analytics_tag: String

The classifying tag for analytics.

web_analytics_token: String

The auth token for analytics.

build_caching: Bool

Enable build caching for the project.

build_command: String

Command used to build project.

destination_dir: String

Assets output directory of the build.

root_dir: String

Directory to run the command.

domains: List[String]

A list of associated custom domains for the project.

source: Attributes

Configs for the project source control.

config: Attributes
Deprecateddeployments_enabled: Bool
Use `production_deployments_enabled` and `preview_deployment_setting` for more granular control.

Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically.

owner: String

The owner of the repository.

owner_id: String

The owner ID of the repository.

path_excludes: List[String]

A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (*) is supported.

path_includes: List[String]

A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (*) is supported.

pr_comments_enabled: Bool

Whether to enable PR comments.

preview_branch_excludes: List[String]

A list of branches that should not trigger a preview deployment. Wildcard syntax (*) is supported. Must be used with preview_deployment_setting set to custom.

preview_branch_includes: List[String]

A list of branches that should trigger a preview deployment. Wildcard syntax (*) is supported. Must be used with preview_deployment_setting set to custom.

preview_deployment_setting: String

Controls whether commits to preview branches trigger a preview deployment.

production_branch: String

The production branch of the repository.

production_deployments_enabled: Bool

Whether to trigger a production deployment on commits to the production branch.

repo_id: String

The ID of the repository.

repo_name: String

The name of the repository.

type: String

The source control management provider.

subdomain: String

The Cloudflare subdomain associated with the project.

cloudflare_pages_projects

data "cloudflare_pages_projects" "example_pages_projects" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
}

PagesProjectsDomains

resource cloudflare_pages_domain

required Expand Collapse
name: String

The domain name.

account_id: String

Identifier.

project_name: String

Name of the project.

computed Expand Collapse
id: String

The domain name.

certificate_authority: String
created_on: String
domain_id: String
status: String
zone_tag: String
validation_data: Attributes
method: String
status: String
error_message: String
txt_name: String
txt_value: String
verification_data: Attributes
status: String
error_message: String

cloudflare_pages_domain

resource "cloudflare_pages_domain" "example_pages_domain" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  project_name = "this-is-my-project-01"
  name = "this-is-my-domain-01.com"
}

data cloudflare_pages_domain

required Expand Collapse
domain_name: String

The domain name.

account_id: String

Identifier.

project_name: String

Name of the project.

computed Expand Collapse
id: String

The domain name.

certificate_authority: String
created_on: String
domain_id: String
name: String

The domain name.

status: String
zone_tag: String
validation_data: Attributes
method: String
status: String
error_message: String
txt_name: String
txt_value: String
verification_data: Attributes
status: String
error_message: String

cloudflare_pages_domain

data "cloudflare_pages_domain" "example_pages_domain" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  project_name = "this-is-my-project-01"
  domain_name = "this-is-my-domain-01.com"
}

data cloudflare_pages_domains

required Expand Collapse
account_id: String

Identifier.

project_name: String

Name of the project.

optional Expand Collapse
max_items?: Int64

Max items to fetch, default: 1000

computed Expand Collapse
result: List[Attributes]

The items returned by the data source

id: String
certificate_authority: String
created_on: String
domain_id: String
name: String

The domain name.

status: String
validation_data: Attributes
method: String
status: String
error_message: String
txt_name: String
txt_value: String
verification_data: Attributes
status: String
error_message: String
zone_tag: String

cloudflare_pages_domains

data "cloudflare_pages_domains" "example_pages_domains" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  project_name = "this-is-my-project-01"
}