PagesProjectArgs

data class PagesProjectArgs(val accountId: Output<String>? = null, val buildConfig: Output<PagesProjectBuildConfigArgs>? = null, val deploymentConfigs: Output<PagesProjectDeploymentConfigsArgs>? = null, val name: Output<String>? = null, val productionBranch: Output<String>? = null, val source: Output<PagesProjectSourceArgs>? = null) : ConvertibleToJava<PagesProjectArgs>

Provides a resource which manages Cloudflare Pages projects.

If you are using a source block configuration, you must first have a connected GitHub or GitLab account connected to Cloudflare. See the Getting Started with Pages documentation on how to link your accounts.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.PagesProject;
import com.pulumi.cloudflare.PagesProjectArgs;
import com.pulumi.cloudflare.inputs.PagesProjectBuildConfigArgs;
import com.pulumi.cloudflare.inputs.PagesProjectSourceArgs;
import com.pulumi.cloudflare.inputs.PagesProjectSourceConfigArgs;
import com.pulumi.cloudflare.inputs.PagesProjectDeploymentConfigsArgs;
import com.pulumi.cloudflare.inputs.PagesProjectDeploymentConfigsPreviewArgs;
import com.pulumi.cloudflare.inputs.PagesProjectDeploymentConfigsProductionArgs;
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 basicProject = new PagesProject("basicProject", PagesProjectArgs.builder()
.accountId("f037e56e89293a057740de681ac9abbe")
.name("this-is-my-project-01")
.productionBranch("main")
.build());
var buildConfig = new PagesProject("buildConfig", PagesProjectArgs.builder()
.accountId("f037e56e89293a057740de681ac9abbe")
.buildConfig(PagesProjectBuildConfigArgs.builder()
.buildCommand("npm run build")
.destinationDir("build")
.rootDir("/")
.webAnalyticsTag("cee1c73f6e4743d0b5e6bb1a0bcaabcc")
.webAnalyticsToken("021e1057c18547eca7b79f2516f06o7x")
.build())
.name("this-is-my-project-01")
.productionBranch("main")
.build());
var sourceConfig = new PagesProject("sourceConfig", PagesProjectArgs.builder()
.accountId("f037e56e89293a057740de681ac9abbe")
.name("this-is-my-project-01")
.productionBranch("main")
.source(PagesProjectSourceArgs.builder()
.config(PagesProjectSourceConfigArgs.builder()
.deploymentsEnabled(true)
.owner("cloudflare")
.prCommentsEnabled(true)
.previewBranchExcludes(
"main",
"prod")
.previewBranchIncludes(
"dev",
"preview")
.previewDeploymentSetting("custom")
.productionBranch("main")
.productionDeploymentEnabled(true)
.repoName("ninjakittens")
.build())
.type("github")
.build())
.build());
var deploymentConfigs = new PagesProject("deploymentConfigs", PagesProjectArgs.builder()
.accountId("f037e56e89293a057740de681ac9abbe")
.deploymentConfigs(PagesProjectDeploymentConfigsArgs.builder()
.preview(PagesProjectDeploymentConfigsPreviewArgs.builder()
.compatibilityDate("2022-08-15")
.compatibilityFlags("preview_flag")
.d1Databases(Map.of("D1BINDING", "445e2955-951a-4358-a35b-a4d0c813f63"))
.durableObjectNamespaces(Map.of("DOBINDING", "5eb63bbbe01eeed093cb22bb8f5acdc3"))
.environmentVariables(Map.of("ENVIRONMENT", "preview"))
.kvNamespaces(Map.of("KVBINDING", "5eb63bbbe01eeed093cb22bb8f5acdc3"))
.r2Buckets(Map.of("R2BINDING", "some-bucket"))
.build())
.production(PagesProjectDeploymentConfigsProductionArgs.builder()
.compatibilityDate("2022-08-16")
.compatibilityFlags(
"production_flag",
"second flag")
.d1Databases(Map.ofEntries(
Map.entry("D1BINDING1", "445e2955-951a-4358-a35b-a4d0c813f63"),
Map.entry("D1BINDING2", "a399414b-c697-409a-a688-377db6433cd9")
))
.durableObjectNamespaces(Map.ofEntries(
Map.entry("DOBINDING1", "5eb63bbbe01eeed093cb22bb8f5acdc3"),
Map.entry("DOBINDING2", "3cdca5f8bb22bc390deee10ebbb36be5")
))
.environmentVariables(Map.ofEntries(
Map.entry("ENVIRONMENT", "production"),
Map.entry("OTHERVALUE", "other value")
))
.kvNamespaces(Map.ofEntries(
Map.entry("KVBINDING1", "5eb63bbbe01eeed093cb22bb8f5acdc3"),
Map.entry("KVBINDING2", "3cdca5f8bb22bc390deee10ebbb36be5")
))
.r2Buckets(Map.ofEntries(
Map.entry("R2BINDING1", "some-bucket"),
Map.entry("R2BINDING2", "other-bucket")
))
.build())
.build())
.name("this-is-my-project-01")
.productionBranch("main")
.build());
}
}

Import

$ pulumi import cloudflare:index/pagesProject:PagesProject example <account_id>/<project_name>

Getting Started with Pageshttps://developers.cloudflare.com/pages/get-started/#connect-your-git-provider-to-pages

Constructors

Link copied to clipboard
constructor(accountId: Output<String>? = null, buildConfig: Output<PagesProjectBuildConfigArgs>? = null, deploymentConfigs: Output<PagesProjectDeploymentConfigsArgs>? = null, name: Output<String>? = null, productionBranch: Output<String>? = null, source: Output<PagesProjectSourceArgs>? = null)

Properties

Link copied to clipboard
val accountId: Output<String>? = null

The account identifier to target for the resource.

Link copied to clipboard

Configuration for the project build process.

Link copied to clipboard

Configuration for deployments in a project.

Link copied to clipboard
val name: Output<String>? = null

Name of the project. Modifying this attribute will force creation of a new resource.

Link copied to clipboard
val productionBranch: Output<String>? = null

The name of the branch that is used for the production environment.

Link copied to clipboard
val source: Output<PagesProjectSourceArgs>? = null

Configuration for the project source.

Functions

Link copied to clipboard
open override fun toJava(): PagesProjectArgs