Want to learn about running containers in Lambda? Join our free hands-on workshop. Register Now

Cloudflare

The Cloudflare provider for Pulumi can be used to provision any of the resources available in Cloudflare.

See the full API documentation for complete details of the available Cloudflare provider APIs.

Setup

The Cloudflare provider supports several options for interacting with Cloudflare. See the Cloudflare setup page for details.

Example

const cloudflare = require("@pulumi/cloudflare")

const record = new cloudflare.Record("sample-record", {
  name: "my-record",
  zoneId: "xxsdfhsfkashadf",
  type: "A",
  value: "192.168.0.11",
  ttl: 3600
});
import * as cloudflare from "@pulumi/cloudflare";

const record = new cloudflare.Record("sample-record", {
  name: "my-record",
  zoneId: "xxsdfhsfkashadf",
  type: "A",
  value: "192.168.0.11",
  ttl: 3600
});
import pulumi_cloudflare as cloudflare

record = cloudflare.Record("sample-record",
  name="my-record",
  zone_id="xxsdfhsfkashadf",
  type="A",
  value="192.168.0.11",
  ttl=3600
)
import (
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
    cloudflare "github.com/pulumi/pulumi-cloudflare/sdk/v2/go/cloudflare"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        record, err := cloudflare.NewRecord(ctx, "sample-record", &cloudflare.RecordArgs{
            Name:   pulumi.String("my-record"),
            ZoneId: pulumi.String("xxsdfhsfkashadf"),
            Type:   pulumi.String("A"),
            Value:  pulumi.String("192.168.0.11"),
            Ttl:    pulumi.Int(3600),
        })
        if err != nil {
            return err
        }

        return nil
    })
}
using System.Collections.Generic;
using System.Threading.Tasks;
using Pulumi;
using Pulumi.Cloudflare;

class Program
{
    static Task Main() =>
        Deployment.Run(() => {
            var record = new Cloudflare.Record("sample-record", new Cloudflare.RecordArgs
            {
                Name = "my-record",
                ZoneId = "xxsdfhsfkashadf",
                Type = "A",
                Value = "192.168.0.11",
                Ttl = 3600,
            });
        });
}

Libraries

The following packages are available in packager managers:

The Cloudflare provider is open source and available in the pulumi/pulumi-cloudflare repo.