1. Packages
  2. Digitalocean Provider
  3. API Docs
  4. Domain
DigitalOcean v4.35.0 published on Tuesday, Nov 19, 2024 by Pulumi

digitalocean.Domain

Explore with Pulumi AI

digitalocean logo
DigitalOcean v4.35.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Provides a DigitalOcean domain resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as digitalocean from "@pulumi/digitalocean";
    
    // Create a new domain
    const _default = new digitalocean.Domain("default", {
        name: "example.com",
        ipAddress: foo.ipv4Address,
    });
    
    import pulumi
    import pulumi_digitalocean as digitalocean
    
    # Create a new domain
    default = digitalocean.Domain("default",
        name="example.com",
        ip_address=foo["ipv4Address"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Create a new domain
    		_, err := digitalocean.NewDomain(ctx, "default", &digitalocean.DomainArgs{
    			Name:      pulumi.String("example.com"),
    			IpAddress: pulumi.Any(foo.Ipv4Address),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using DigitalOcean = Pulumi.DigitalOcean;
    
    return await Deployment.RunAsync(() => 
    {
        // Create a new domain
        var @default = new DigitalOcean.Domain("default", new()
        {
            Name = "example.com",
            IpAddress = foo.Ipv4Address,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.digitalocean.Domain;
    import com.pulumi.digitalocean.DomainArgs;
    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) {
            // Create a new domain
            var default_ = new Domain("default", DomainArgs.builder()
                .name("example.com")
                .ipAddress(foo.ipv4Address())
                .build());
    
        }
    }
    
    resources:
      # Create a new domain
      default:
        type: digitalocean:Domain
        properties:
          name: example.com
          ipAddress: ${foo.ipv4Address}
    

    Create Domain Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Domain(name: string, args: DomainArgs, opts?: CustomResourceOptions);
    @overload
    def Domain(resource_name: str,
               args: DomainArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Domain(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               name: Optional[str] = None,
               ip_address: Optional[str] = None)
    func NewDomain(ctx *Context, name string, args DomainArgs, opts ...ResourceOption) (*Domain, error)
    public Domain(string name, DomainArgs args, CustomResourceOptions? opts = null)
    public Domain(String name, DomainArgs args)
    public Domain(String name, DomainArgs args, CustomResourceOptions options)
    
    type: digitalocean:Domain
    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 DomainArgs
    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 DomainArgs
    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 DomainArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DomainArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DomainArgs
    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 domainResource = new DigitalOcean.Domain("domainResource", new()
    {
        Name = "string",
        IpAddress = "string",
    });
    
    example, err := digitalocean.NewDomain(ctx, "domainResource", &digitalocean.DomainArgs{
    	Name:      pulumi.String("string"),
    	IpAddress: pulumi.String("string"),
    })
    
    var domainResource = new Domain("domainResource", DomainArgs.builder()
        .name("string")
        .ipAddress("string")
        .build());
    
    domain_resource = digitalocean.Domain("domainResource",
        name="string",
        ip_address="string")
    
    const domainResource = new digitalocean.Domain("domainResource", {
        name: "string",
        ipAddress: "string",
    });
    
    type: digitalocean:Domain
    properties:
        ipAddress: string
        name: string
    

    Domain 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 Domain resource accepts the following input properties:

    Name string
    The name of the domain
    IpAddress string
    The IP address of the domain. If specified, this IP is used to created an initial A record for the domain.
    Name string
    The name of the domain
    IpAddress string
    The IP address of the domain. If specified, this IP is used to created an initial A record for the domain.
    name String
    The name of the domain
    ipAddress String
    The IP address of the domain. If specified, this IP is used to created an initial A record for the domain.
    name string
    The name of the domain
    ipAddress string
    The IP address of the domain. If specified, this IP is used to created an initial A record for the domain.
    name str
    The name of the domain
    ip_address str
    The IP address of the domain. If specified, this IP is used to created an initial A record for the domain.
    name String
    The name of the domain
    ipAddress String
    The IP address of the domain. If specified, this IP is used to created an initial A record for the domain.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Domain resource produces the following output properties:

    DomainUrn string
    The uniform resource name of the domain
    Id string
    The provider-assigned unique ID for this managed resource.
    Ttl int
    The TTL value of the domain
    DomainUrn string
    The uniform resource name of the domain
    Id string
    The provider-assigned unique ID for this managed resource.
    Ttl int
    The TTL value of the domain
    domainUrn String
    The uniform resource name of the domain
    id String
    The provider-assigned unique ID for this managed resource.
    ttl Integer
    The TTL value of the domain
    domainUrn string
    The uniform resource name of the domain
    id string
    The provider-assigned unique ID for this managed resource.
    ttl number
    The TTL value of the domain
    domain_urn str
    The uniform resource name of the domain
    id str
    The provider-assigned unique ID for this managed resource.
    ttl int
    The TTL value of the domain
    domainUrn String
    The uniform resource name of the domain
    id String
    The provider-assigned unique ID for this managed resource.
    ttl Number
    The TTL value of the domain

    Look up Existing Domain Resource

    Get an existing Domain 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?: DomainState, opts?: CustomResourceOptions): Domain
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            domain_urn: Optional[str] = None,
            ip_address: Optional[str] = None,
            name: Optional[str] = None,
            ttl: Optional[int] = None) -> Domain
    func GetDomain(ctx *Context, name string, id IDInput, state *DomainState, opts ...ResourceOption) (*Domain, error)
    public static Domain Get(string name, Input<string> id, DomainState? state, CustomResourceOptions? opts = null)
    public static Domain get(String name, Output<String> id, DomainState 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.
    The following state arguments are supported:
    DomainUrn string
    The uniform resource name of the domain
    IpAddress string
    The IP address of the domain. If specified, this IP is used to created an initial A record for the domain.
    Name string
    The name of the domain
    Ttl int
    The TTL value of the domain
    DomainUrn string
    The uniform resource name of the domain
    IpAddress string
    The IP address of the domain. If specified, this IP is used to created an initial A record for the domain.
    Name string
    The name of the domain
    Ttl int
    The TTL value of the domain
    domainUrn String
    The uniform resource name of the domain
    ipAddress String
    The IP address of the domain. If specified, this IP is used to created an initial A record for the domain.
    name String
    The name of the domain
    ttl Integer
    The TTL value of the domain
    domainUrn string
    The uniform resource name of the domain
    ipAddress string
    The IP address of the domain. If specified, this IP is used to created an initial A record for the domain.
    name string
    The name of the domain
    ttl number
    The TTL value of the domain
    domain_urn str
    The uniform resource name of the domain
    ip_address str
    The IP address of the domain. If specified, this IP is used to created an initial A record for the domain.
    name str
    The name of the domain
    ttl int
    The TTL value of the domain
    domainUrn String
    The uniform resource name of the domain
    ipAddress String
    The IP address of the domain. If specified, this IP is used to created an initial A record for the domain.
    name String
    The name of the domain
    ttl Number
    The TTL value of the domain

    Import

    Domains can be imported using the domain name, e.g.

    $ pulumi import digitalocean:index/domain:Domain mydomain mytestdomain.com
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    DigitalOcean pulumi/pulumi-digitalocean
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the digitalocean Terraform Provider.
    digitalocean logo
    DigitalOcean v4.35.0 published on Tuesday, Nov 19, 2024 by Pulumi