cloudflare.WorkersDomain
Explore with Pulumi AI
Creates a Worker Custom Domain.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";
const example = new cloudflare.WorkersDomain("example", {
accountId: "f037e56e89293a057740de681ac9abbe",
hostname: "subdomain.example.com",
service: "my-service",
zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
});
import pulumi
import pulumi_cloudflare as cloudflare
example = cloudflare.WorkersDomain("example",
account_id="f037e56e89293a057740de681ac9abbe",
hostname="subdomain.example.com",
service="my-service",
zone_id="0da42c8d2132a9ddaf714f9e7c920711")
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.NewWorkersDomain(ctx, "example", &cloudflare.WorkersDomainArgs{
AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
Hostname: pulumi.String("subdomain.example.com"),
Service: pulumi.String("my-service"),
ZoneId: pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
})
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.WorkersDomain("example", new()
{
AccountId = "f037e56e89293a057740de681ac9abbe",
Hostname = "subdomain.example.com",
Service = "my-service",
ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.WorkersDomain;
import com.pulumi.cloudflare.WorkersDomainArgs;
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 WorkersDomain("example", WorkersDomainArgs.builder()
.accountId("f037e56e89293a057740de681ac9abbe")
.hostname("subdomain.example.com")
.service("my-service")
.zoneId("0da42c8d2132a9ddaf714f9e7c920711")
.build());
}
}
resources:
example:
type: cloudflare:WorkersDomain
properties:
accountId: f037e56e89293a057740de681ac9abbe
hostname: subdomain.example.com
service: my-service
zoneId: 0da42c8d2132a9ddaf714f9e7c920711
Create WorkersDomain Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new WorkersDomain(name: string, args: WorkersDomainArgs, opts?: CustomResourceOptions);
@overload
def WorkersDomain(resource_name: str,
args: WorkersDomainArgs,
opts: Optional[ResourceOptions] = None)
@overload
def WorkersDomain(resource_name: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[str] = None,
hostname: Optional[str] = None,
service: Optional[str] = None,
zone_id: Optional[str] = None,
environment: Optional[str] = None)
func NewWorkersDomain(ctx *Context, name string, args WorkersDomainArgs, opts ...ResourceOption) (*WorkersDomain, error)
public WorkersDomain(string name, WorkersDomainArgs args, CustomResourceOptions? opts = null)
public WorkersDomain(String name, WorkersDomainArgs args)
public WorkersDomain(String name, WorkersDomainArgs args, CustomResourceOptions options)
type: cloudflare:WorkersDomain
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 WorkersDomainArgs
- 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 WorkersDomainArgs
- 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 WorkersDomainArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args WorkersDomainArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args WorkersDomainArgs
- 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 workersDomainResource = new Cloudflare.WorkersDomain("workersDomainResource", new()
{
AccountId = "string",
Hostname = "string",
Service = "string",
ZoneId = "string",
Environment = "string",
});
example, err := cloudflare.NewWorkersDomain(ctx, "workersDomainResource", &cloudflare.WorkersDomainArgs{
AccountId: pulumi.String("string"),
Hostname: pulumi.String("string"),
Service: pulumi.String("string"),
ZoneId: pulumi.String("string"),
Environment: pulumi.String("string"),
})
var workersDomainResource = new WorkersDomain("workersDomainResource", WorkersDomainArgs.builder()
.accountId("string")
.hostname("string")
.service("string")
.zoneId("string")
.environment("string")
.build());
workers_domain_resource = cloudflare.WorkersDomain("workersDomainResource",
account_id="string",
hostname="string",
service="string",
zone_id="string",
environment="string")
const workersDomainResource = new cloudflare.WorkersDomain("workersDomainResource", {
accountId: "string",
hostname: "string",
service: "string",
zoneId: "string",
environment: "string",
});
type: cloudflare:WorkersDomain
properties:
accountId: string
environment: string
hostname: string
service: string
zoneId: string
WorkersDomain 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 WorkersDomain resource accepts the following input properties:
- Account
Id string - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- Hostname string
- Hostname of the Worker Domain.
- Service string
- Name of worker script to attach the domain to.
- Zone
Id string - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- Environment string
- The name of the Worker environment. Defaults to
production
.
- Account
Id string - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- Hostname string
- Hostname of the Worker Domain.
- Service string
- Name of worker script to attach the domain to.
- Zone
Id string - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- Environment string
- The name of the Worker environment. Defaults to
production
.
- account
Id String - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- hostname String
- Hostname of the Worker Domain.
- service String
- Name of worker script to attach the domain to.
- zone
Id String - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- environment String
- The name of the Worker environment. Defaults to
production
.
- account
Id string - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- hostname string
- Hostname of the Worker Domain.
- service string
- Name of worker script to attach the domain to.
- zone
Id string - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- environment string
- The name of the Worker environment. Defaults to
production
.
- account_
id str - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- hostname str
- Hostname of the Worker Domain.
- service str
- Name of worker script to attach the domain to.
- zone_
id str - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- environment str
- The name of the Worker environment. Defaults to
production
.
- account
Id String - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- hostname String
- Hostname of the Worker Domain.
- service String
- Name of worker script to attach the domain to.
- zone
Id String - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- environment String
- The name of the Worker environment. Defaults to
production
.
Outputs
All input properties are implicitly available as output properties. Additionally, the WorkersDomain 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 string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing WorkersDomain Resource
Get an existing WorkersDomain 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?: WorkersDomainState, opts?: CustomResourceOptions): WorkersDomain
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[str] = None,
environment: Optional[str] = None,
hostname: Optional[str] = None,
service: Optional[str] = None,
zone_id: Optional[str] = None) -> WorkersDomain
func GetWorkersDomain(ctx *Context, name string, id IDInput, state *WorkersDomainState, opts ...ResourceOption) (*WorkersDomain, error)
public static WorkersDomain Get(string name, Input<string> id, WorkersDomainState? state, CustomResourceOptions? opts = null)
public static WorkersDomain get(String name, Output<String> id, WorkersDomainState 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 - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- Environment string
- The name of the Worker environment. Defaults to
production
. - Hostname string
- Hostname of the Worker Domain.
- Service string
- Name of worker script to attach the domain to.
- Zone
Id string - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- Account
Id string - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- Environment string
- The name of the Worker environment. Defaults to
production
. - Hostname string
- Hostname of the Worker Domain.
- Service string
- Name of worker script to attach the domain to.
- Zone
Id string - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- account
Id String - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- environment String
- The name of the Worker environment. Defaults to
production
. - hostname String
- Hostname of the Worker Domain.
- service String
- Name of worker script to attach the domain to.
- zone
Id String - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- account
Id string - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- environment string
- The name of the Worker environment. Defaults to
production
. - hostname string
- Hostname of the Worker Domain.
- service string
- Name of worker script to attach the domain to.
- zone
Id string - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- account_
id str - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- environment str
- The name of the Worker environment. Defaults to
production
. - hostname str
- Hostname of the Worker Domain.
- service str
- Name of worker script to attach the domain to.
- zone_
id str - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- account
Id String - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- environment String
- The name of the Worker environment. Defaults to
production
. - hostname String
- Hostname of the Worker Domain.
- service String
- Name of worker script to attach the domain to.
- zone
Id String - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
Import
$ pulumi import cloudflare:index/workersDomain:WorkersDomain example <account_id>/<worker_domain_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.