cloudflare.Zone
Explore with Pulumi AI
Provides a Cloudflare Zone resource. Zone is the basic resource for working with Cloudflare and is roughly equivalent to a domain name that the user purchases.
If you are attempting to sign up a subdomain of a zone you must first have Subdomain Support entitlement for your account.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";
const example = new cloudflare.Zone("example", {
accountId: "f037e56e89293a057740de681ac9abbe",
zone: "example.com",
});
import pulumi
import pulumi_cloudflare as cloudflare
example = cloudflare.Zone("example",
account_id="f037e56e89293a057740de681ac9abbe",
zone="example.com")
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.NewZone(ctx, "example", &cloudflare.ZoneArgs{
AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
Zone: pulumi.String("example.com"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
return await Deployment.RunAsync(() =>
{
var example = new Cloudflare.Zone("example", new()
{
AccountId = "f037e56e89293a057740de681ac9abbe",
ZoneName = "example.com",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.Zone;
import com.pulumi.cloudflare.ZoneArgs;
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 Zone("example", ZoneArgs.builder()
.accountId("f037e56e89293a057740de681ac9abbe")
.zone("example.com")
.build());
}
}
resources:
example:
type: cloudflare:Zone
properties:
accountId: f037e56e89293a057740de681ac9abbe
zone: example.com
Create Zone Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Zone(name: string, args: ZoneArgs, opts?: CustomResourceOptions);
@overload
def Zone(resource_name: str,
args: ZoneArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Zone(resource_name: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[str] = None,
zone: Optional[str] = None,
jump_start: Optional[bool] = None,
paused: Optional[bool] = None,
plan: Optional[str] = None,
type: Optional[str] = None,
vanity_name_servers: Optional[Sequence[str]] = None)
func NewZone(ctx *Context, name string, args ZoneArgs, opts ...ResourceOption) (*Zone, error)
public Zone(string name, ZoneArgs args, CustomResourceOptions? opts = null)
type: cloudflare:Zone
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ZoneArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ZoneArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ZoneArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ZoneArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ZoneArgs
- 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 zoneResource = new Cloudflare.Zone("zoneResource", new()
{
AccountId = "string",
ZoneName = "string",
JumpStart = false,
Paused = false,
Plan = "string",
Type = "string",
VanityNameServers = new[]
{
"string",
},
});
example, err := cloudflare.NewZone(ctx, "zoneResource", &cloudflare.ZoneArgs{
AccountId: pulumi.String("string"),
Zone: pulumi.String("string"),
JumpStart: pulumi.Bool(false),
Paused: pulumi.Bool(false),
Plan: pulumi.String("string"),
Type: pulumi.String("string"),
VanityNameServers: pulumi.StringArray{
pulumi.String("string"),
},
})
var zoneResource = new Zone("zoneResource", ZoneArgs.builder()
.accountId("string")
.zone("string")
.jumpStart(false)
.paused(false)
.plan("string")
.type("string")
.vanityNameServers("string")
.build());
zone_resource = cloudflare.Zone("zoneResource",
account_id="string",
zone="string",
jump_start=False,
paused=False,
plan="string",
type="string",
vanity_name_servers=["string"])
const zoneResource = new cloudflare.Zone("zoneResource", {
accountId: "string",
zone: "string",
jumpStart: false,
paused: false,
plan: "string",
type: "string",
vanityNameServers: ["string"],
});
type: cloudflare:Zone
properties:
accountId: string
jumpStart: false
paused: false
plan: string
type: string
vanityNameServers:
- string
zone: string
Zone 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 Zone resource accepts the following input properties:
- Account
Id string - Account ID to manage the zone resource in.
- Zone
Name string - The DNS zone name which will be added. Modifying this attribute will force creation of a new resource.
- Jump
Start bool - Whether to scan for DNS records on creation. Ignored after zone is created.
- Paused bool
- Whether this zone is paused (traffic bypasses Cloudflare). Defaults to
false
. - Plan string
- The name of the commercial plan to apply to the zone. Available values:
free
,lite
,pro
,pro_plus
,business
,enterprise
,partners_free
,partners_pro
,partners_business
,partners_enterprise
. - Type string
- A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup. Available values:
full
,partial
,secondary
. Defaults tofull
. - Vanity
Name List<string>Servers - List of Vanity Nameservers (if set).
- Account
Id string - Account ID to manage the zone resource in.
- Zone string
- The DNS zone name which will be added. Modifying this attribute will force creation of a new resource.
- Jump
Start bool - Whether to scan for DNS records on creation. Ignored after zone is created.
- Paused bool
- Whether this zone is paused (traffic bypasses Cloudflare). Defaults to
false
. - Plan string
- The name of the commercial plan to apply to the zone. Available values:
free
,lite
,pro
,pro_plus
,business
,enterprise
,partners_free
,partners_pro
,partners_business
,partners_enterprise
. - Type string
- A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup. Available values:
full
,partial
,secondary
. Defaults tofull
. - Vanity
Name []stringServers - List of Vanity Nameservers (if set).
- account
Id String - Account ID to manage the zone resource in.
- zone String
- The DNS zone name which will be added. Modifying this attribute will force creation of a new resource.
- jump
Start Boolean - Whether to scan for DNS records on creation. Ignored after zone is created.
- paused Boolean
- Whether this zone is paused (traffic bypasses Cloudflare). Defaults to
false
. - plan String
- The name of the commercial plan to apply to the zone. Available values:
free
,lite
,pro
,pro_plus
,business
,enterprise
,partners_free
,partners_pro
,partners_business
,partners_enterprise
. - type String
- A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup. Available values:
full
,partial
,secondary
. Defaults tofull
. - vanity
Name List<String>Servers - List of Vanity Nameservers (if set).
- account
Id string - Account ID to manage the zone resource in.
- zone string
- The DNS zone name which will be added. Modifying this attribute will force creation of a new resource.
- jump
Start boolean - Whether to scan for DNS records on creation. Ignored after zone is created.
- paused boolean
- Whether this zone is paused (traffic bypasses Cloudflare). Defaults to
false
. - plan string
- The name of the commercial plan to apply to the zone. Available values:
free
,lite
,pro
,pro_plus
,business
,enterprise
,partners_free
,partners_pro
,partners_business
,partners_enterprise
. - type string
- A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup. Available values:
full
,partial
,secondary
. Defaults tofull
. - vanity
Name string[]Servers - List of Vanity Nameservers (if set).
- account_
id str - Account ID to manage the zone resource in.
- zone str
- The DNS zone name which will be added. Modifying this attribute will force creation of a new resource.
- jump_
start bool - Whether to scan for DNS records on creation. Ignored after zone is created.
- paused bool
- Whether this zone is paused (traffic bypasses Cloudflare). Defaults to
false
. - plan str
- The name of the commercial plan to apply to the zone. Available values:
free
,lite
,pro
,pro_plus
,business
,enterprise
,partners_free
,partners_pro
,partners_business
,partners_enterprise
. - type str
- A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup. Available values:
full
,partial
,secondary
. Defaults tofull
. - vanity_
name_ Sequence[str]servers - List of Vanity Nameservers (if set).
- account
Id String - Account ID to manage the zone resource in.
- zone String
- The DNS zone name which will be added. Modifying this attribute will force creation of a new resource.
- jump
Start Boolean - Whether to scan for DNS records on creation. Ignored after zone is created.
- paused Boolean
- Whether this zone is paused (traffic bypasses Cloudflare). Defaults to
false
. - plan String
- The name of the commercial plan to apply to the zone. Available values:
free
,lite
,pro
,pro_plus
,business
,enterprise
,partners_free
,partners_pro
,partners_business
,partners_enterprise
. - type String
- A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup. Available values:
full
,partial
,secondary
. Defaults tofull
. - vanity
Name List<String>Servers - List of Vanity Nameservers (if set).
Outputs
All input properties are implicitly available as output properties. Additionally, the Zone resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Meta Dictionary<string, bool>
- Name
Servers List<string> - Cloudflare-assigned name servers. This is only populated for zones that use Cloudflare DNS.
- Status string
- Status of the zone. Available values:
active
,pending
,initializing
,moved
,deleted
,deactivated
. - Verification
Key string - Contains the TXT record value to validate domain ownership. This is only populated for zones of type
partial
.
- Id string
- The provider-assigned unique ID for this managed resource.
- Meta map[string]bool
- Name
Servers []string - Cloudflare-assigned name servers. This is only populated for zones that use Cloudflare DNS.
- Status string
- Status of the zone. Available values:
active
,pending
,initializing
,moved
,deleted
,deactivated
. - Verification
Key string - Contains the TXT record value to validate domain ownership. This is only populated for zones of type
partial
.
- id String
- The provider-assigned unique ID for this managed resource.
- meta Map<String,Boolean>
- name
Servers List<String> - Cloudflare-assigned name servers. This is only populated for zones that use Cloudflare DNS.
- status String
- Status of the zone. Available values:
active
,pending
,initializing
,moved
,deleted
,deactivated
. - verification
Key String - Contains the TXT record value to validate domain ownership. This is only populated for zones of type
partial
.
- id string
- The provider-assigned unique ID for this managed resource.
- meta {[key: string]: boolean}
- name
Servers string[] - Cloudflare-assigned name servers. This is only populated for zones that use Cloudflare DNS.
- status string
- Status of the zone. Available values:
active
,pending
,initializing
,moved
,deleted
,deactivated
. - verification
Key string - Contains the TXT record value to validate domain ownership. This is only populated for zones of type
partial
.
- id str
- The provider-assigned unique ID for this managed resource.
- meta Mapping[str, bool]
- name_
servers Sequence[str] - Cloudflare-assigned name servers. This is only populated for zones that use Cloudflare DNS.
- status str
- Status of the zone. Available values:
active
,pending
,initializing
,moved
,deleted
,deactivated
. - verification_
key str - Contains the TXT record value to validate domain ownership. This is only populated for zones of type
partial
.
- id String
- The provider-assigned unique ID for this managed resource.
- meta Map<Boolean>
- name
Servers List<String> - Cloudflare-assigned name servers. This is only populated for zones that use Cloudflare DNS.
- status String
- Status of the zone. Available values:
active
,pending
,initializing
,moved
,deleted
,deactivated
. - verification
Key String - Contains the TXT record value to validate domain ownership. This is only populated for zones of type
partial
.
Look up Existing Zone Resource
Get an existing Zone 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?: ZoneState, opts?: CustomResourceOptions): Zone
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[str] = None,
jump_start: Optional[bool] = None,
meta: Optional[Mapping[str, bool]] = None,
name_servers: Optional[Sequence[str]] = None,
paused: Optional[bool] = None,
plan: Optional[str] = None,
status: Optional[str] = None,
type: Optional[str] = None,
vanity_name_servers: Optional[Sequence[str]] = None,
verification_key: Optional[str] = None,
zone: Optional[str] = None) -> Zone
func GetZone(ctx *Context, name string, id IDInput, state *ZoneState, opts ...ResourceOption) (*Zone, error)
public static Zone Get(string name, Input<string> id, ZoneState? state, CustomResourceOptions? opts = null)
public static Zone get(String name, Output<String> id, ZoneState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- 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.
- Account
Id string - Account ID to manage the zone resource in.
- Jump
Start bool - Whether to scan for DNS records on creation. Ignored after zone is created.
- Meta Dictionary<string, bool>
- Name
Servers List<string> - Cloudflare-assigned name servers. This is only populated for zones that use Cloudflare DNS.
- Paused bool
- Whether this zone is paused (traffic bypasses Cloudflare). Defaults to
false
. - Plan string
- The name of the commercial plan to apply to the zone. Available values:
free
,lite
,pro
,pro_plus
,business
,enterprise
,partners_free
,partners_pro
,partners_business
,partners_enterprise
. - Status string
- Status of the zone. Available values:
active
,pending
,initializing
,moved
,deleted
,deactivated
. - Type string
- A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup. Available values:
full
,partial
,secondary
. Defaults tofull
. - Vanity
Name List<string>Servers - List of Vanity Nameservers (if set).
- Verification
Key string - Contains the TXT record value to validate domain ownership. This is only populated for zones of type
partial
. - Zone
Name string - The DNS zone name which will be added. Modifying this attribute will force creation of a new resource.
- Account
Id string - Account ID to manage the zone resource in.
- Jump
Start bool - Whether to scan for DNS records on creation. Ignored after zone is created.
- Meta map[string]bool
- Name
Servers []string - Cloudflare-assigned name servers. This is only populated for zones that use Cloudflare DNS.
- Paused bool
- Whether this zone is paused (traffic bypasses Cloudflare). Defaults to
false
. - Plan string
- The name of the commercial plan to apply to the zone. Available values:
free
,lite
,pro
,pro_plus
,business
,enterprise
,partners_free
,partners_pro
,partners_business
,partners_enterprise
. - Status string
- Status of the zone. Available values:
active
,pending
,initializing
,moved
,deleted
,deactivated
. - Type string
- A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup. Available values:
full
,partial
,secondary
. Defaults tofull
. - Vanity
Name []stringServers - List of Vanity Nameservers (if set).
- Verification
Key string - Contains the TXT record value to validate domain ownership. This is only populated for zones of type
partial
. - Zone string
- The DNS zone name which will be added. Modifying this attribute will force creation of a new resource.
- account
Id String - Account ID to manage the zone resource in.
- jump
Start Boolean - Whether to scan for DNS records on creation. Ignored after zone is created.
- meta Map<String,Boolean>
- name
Servers List<String> - Cloudflare-assigned name servers. This is only populated for zones that use Cloudflare DNS.
- paused Boolean
- Whether this zone is paused (traffic bypasses Cloudflare). Defaults to
false
. - plan String
- The name of the commercial plan to apply to the zone. Available values:
free
,lite
,pro
,pro_plus
,business
,enterprise
,partners_free
,partners_pro
,partners_business
,partners_enterprise
. - status String
- Status of the zone. Available values:
active
,pending
,initializing
,moved
,deleted
,deactivated
. - type String
- A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup. Available values:
full
,partial
,secondary
. Defaults tofull
. - vanity
Name List<String>Servers - List of Vanity Nameservers (if set).
- verification
Key String - Contains the TXT record value to validate domain ownership. This is only populated for zones of type
partial
. - zone String
- The DNS zone name which will be added. Modifying this attribute will force creation of a new resource.
- account
Id string - Account ID to manage the zone resource in.
- jump
Start boolean - Whether to scan for DNS records on creation. Ignored after zone is created.
- meta {[key: string]: boolean}
- name
Servers string[] - Cloudflare-assigned name servers. This is only populated for zones that use Cloudflare DNS.
- paused boolean
- Whether this zone is paused (traffic bypasses Cloudflare). Defaults to
false
. - plan string
- The name of the commercial plan to apply to the zone. Available values:
free
,lite
,pro
,pro_plus
,business
,enterprise
,partners_free
,partners_pro
,partners_business
,partners_enterprise
. - status string
- Status of the zone. Available values:
active
,pending
,initializing
,moved
,deleted
,deactivated
. - type string
- A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup. Available values:
full
,partial
,secondary
. Defaults tofull
. - vanity
Name string[]Servers - List of Vanity Nameservers (if set).
- verification
Key string - Contains the TXT record value to validate domain ownership. This is only populated for zones of type
partial
. - zone string
- The DNS zone name which will be added. Modifying this attribute will force creation of a new resource.
- account_
id str - Account ID to manage the zone resource in.
- jump_
start bool - Whether to scan for DNS records on creation. Ignored after zone is created.
- meta Mapping[str, bool]
- name_
servers Sequence[str] - Cloudflare-assigned name servers. This is only populated for zones that use Cloudflare DNS.
- paused bool
- Whether this zone is paused (traffic bypasses Cloudflare). Defaults to
false
. - plan str
- The name of the commercial plan to apply to the zone. Available values:
free
,lite
,pro
,pro_plus
,business
,enterprise
,partners_free
,partners_pro
,partners_business
,partners_enterprise
. - status str
- Status of the zone. Available values:
active
,pending
,initializing
,moved
,deleted
,deactivated
. - type str
- A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup. Available values:
full
,partial
,secondary
. Defaults tofull
. - vanity_
name_ Sequence[str]servers - List of Vanity Nameservers (if set).
- verification_
key str - Contains the TXT record value to validate domain ownership. This is only populated for zones of type
partial
. - zone str
- The DNS zone name which will be added. Modifying this attribute will force creation of a new resource.
- account
Id String - Account ID to manage the zone resource in.
- jump
Start Boolean - Whether to scan for DNS records on creation. Ignored after zone is created.
- meta Map<Boolean>
- name
Servers List<String> - Cloudflare-assigned name servers. This is only populated for zones that use Cloudflare DNS.
- paused Boolean
- Whether this zone is paused (traffic bypasses Cloudflare). Defaults to
false
. - plan String
- The name of the commercial plan to apply to the zone. Available values:
free
,lite
,pro
,pro_plus
,business
,enterprise
,partners_free
,partners_pro
,partners_business
,partners_enterprise
. - status String
- Status of the zone. Available values:
active
,pending
,initializing
,moved
,deleted
,deactivated
. - type String
- A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup. Available values:
full
,partial
,secondary
. Defaults tofull
. - vanity
Name List<String>Servers - List of Vanity Nameservers (if set).
- verification
Key String - Contains the TXT record value to validate domain ownership. This is only populated for zones of type
partial
. - zone String
- The DNS zone name which will be added. Modifying this attribute will force creation of a new resource.
Import
$ pulumi import cloudflare:index/zone:Zone example <zone_id>
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.