1. Packages
  2. OVH
  3. API Docs
  4. Domain
  5. NameServers
OVHCloud v2.0.7 published on Wednesday, Mar 19, 2025 by OVHcloud

ovh.Domain.NameServers

Explore with Pulumi AI

ovh logo
OVHCloud v2.0.7 published on Wednesday, Mar 19, 2025 by OVHcloud

    Use this resource to manage a domain’s name servers.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ovh from "@ovhcloud/pulumi-ovh";
    
    const nameServers = new ovh.domain.NameServers("nameServers", {
        domain: "mydomain.ovh",
        servers: [
            {
                host: "dns105.ovh.net",
                ip: "213.251.188.144",
            },
            {
                host: "ns105.ovh.net",
            },
        ],
    });
    
    import pulumi
    import pulumi_ovh as ovh
    
    name_servers = ovh.domain.NameServers("nameServers",
        domain="mydomain.ovh",
        servers=[
            {
                "host": "dns105.ovh.net",
                "ip": "213.251.188.144",
            },
            {
                "host": "ns105.ovh.net",
            },
        ])
    
    package main
    
    import (
    	"github.com/ovh/pulumi-ovh/sdk/v2/go/ovh/domain"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := domain.NewNameServers(ctx, "nameServers", &domain.NameServersArgs{
    			Domain: pulumi.String("mydomain.ovh"),
    			Servers: domain.NameServersServerArray{
    				&domain.NameServersServerArgs{
    					Host: pulumi.String("dns105.ovh.net"),
    					Ip:   pulumi.String("213.251.188.144"),
    				},
    				&domain.NameServersServerArgs{
    					Host: pulumi.String("ns105.ovh.net"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ovh = Pulumi.Ovh;
    
    return await Deployment.RunAsync(() => 
    {
        var nameServers = new Ovh.Domain.NameServers("nameServers", new()
        {
            Domain = "mydomain.ovh",
            Servers = new[]
            {
                new Ovh.Domain.Inputs.NameServersServerArgs
                {
                    Host = "dns105.ovh.net",
                    Ip = "213.251.188.144",
                },
                new Ovh.Domain.Inputs.NameServersServerArgs
                {
                    Host = "ns105.ovh.net",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ovh.Domain.NameServers;
    import com.pulumi.ovh.Domain.NameServersArgs;
    import com.pulumi.ovh.Domain.inputs.NameServersServerArgs;
    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 nameServers = new NameServers("nameServers", NameServersArgs.builder()
                .domain("mydomain.ovh")
                .servers(            
                    NameServersServerArgs.builder()
                        .host("dns105.ovh.net")
                        .ip("213.251.188.144")
                        .build(),
                    NameServersServerArgs.builder()
                        .host("ns105.ovh.net")
                        .build())
                .build());
    
        }
    }
    
    resources:
      nameServers:
        type: ovh:Domain:NameServers
        properties:
          domain: mydomain.ovh
          servers:
            - host: dns105.ovh.net
              ip: 213.251.188.144
            - host: ns105.ovh.net
    

    Create NameServers Resource

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

    Constructor syntax

    new NameServers(name: string, args: NameServersArgs, opts?: CustomResourceOptions);
    @overload
    def NameServers(resource_name: str,
                    args: NameServersArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def NameServers(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    domain: Optional[str] = None,
                    servers: Optional[Sequence[_domain.NameServersServerArgs]] = None)
    func NewNameServers(ctx *Context, name string, args NameServersArgs, opts ...ResourceOption) (*NameServers, error)
    public NameServers(string name, NameServersArgs args, CustomResourceOptions? opts = null)
    public NameServers(String name, NameServersArgs args)
    public NameServers(String name, NameServersArgs args, CustomResourceOptions options)
    
    type: ovh:Domain:NameServers
    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 NameServersArgs
    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 NameServersArgs
    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 NameServersArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args NameServersArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args NameServersArgs
    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 nameServersResource = new Ovh.Domain.NameServers("nameServersResource", new()
    {
        Domain = "string",
        Servers = new[]
        {
            new Ovh.Domain.Inputs.NameServersServerArgs
            {
                Host = "string",
                Ip = "string",
            },
        },
    });
    
    example, err := Domain.NewNameServers(ctx, "nameServersResource", &Domain.NameServersArgs{
    	Domain: pulumi.String("string"),
    	Servers: domain.NameServersServerArray{
    		&domain.NameServersServerArgs{
    			Host: pulumi.String("string"),
    			Ip:   pulumi.String("string"),
    		},
    	},
    })
    
    var nameServersResource = new NameServers("nameServersResource", NameServersArgs.builder()
        .domain("string")
        .servers(NameServersServerArgs.builder()
            .host("string")
            .ip("string")
            .build())
        .build());
    
    name_servers_resource = ovh.domain.NameServers("nameServersResource",
        domain="string",
        servers=[{
            "host": "string",
            "ip": "string",
        }])
    
    const nameServersResource = new ovh.domain.NameServers("nameServersResource", {
        domain: "string",
        servers: [{
            host: "string",
            ip: "string",
        }],
    });
    
    type: ovh:Domain:NameServers
    properties:
        domain: string
        servers:
            - host: string
              ip: string
    

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

    Domain string
    Domain name for which to manage name servers
    Servers List<NameServersServer>
    Details about a name server
    Domain string
    Domain name for which to manage name servers
    Servers []NameServersServerArgs
    Details about a name server
    domain String
    Domain name for which to manage name servers
    servers List<NameServersServer>
    Details about a name server
    domain string
    Domain name for which to manage name servers
    servers NameServersServer[]
    Details about a name server
    domain str
    Domain name for which to manage name servers
    servers Sequence[domain.NameServersServerArgs]
    Details about a name server
    domain String
    Domain name for which to manage name servers
    servers List<Property Map>
    Details about a name server

    Outputs

    All input properties are implicitly available as output properties. Additionally, the NameServers 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 NameServers Resource

    Get an existing NameServers 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?: NameServersState, opts?: CustomResourceOptions): NameServers
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            domain: Optional[str] = None,
            servers: Optional[Sequence[_domain.NameServersServerArgs]] = None) -> NameServers
    func GetNameServers(ctx *Context, name string, id IDInput, state *NameServersState, opts ...ResourceOption) (*NameServers, error)
    public static NameServers Get(string name, Input<string> id, NameServersState? state, CustomResourceOptions? opts = null)
    public static NameServers get(String name, Output<String> id, NameServersState state, CustomResourceOptions options)
    resources:  _:    type: ovh:Domain:NameServers    get:      id: ${id}
    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:
    Domain string
    Domain name for which to manage name servers
    Servers List<NameServersServer>
    Details about a name server
    Domain string
    Domain name for which to manage name servers
    Servers []NameServersServerArgs
    Details about a name server
    domain String
    Domain name for which to manage name servers
    servers List<NameServersServer>
    Details about a name server
    domain string
    Domain name for which to manage name servers
    servers NameServersServer[]
    Details about a name server
    domain str
    Domain name for which to manage name servers
    servers Sequence[domain.NameServersServerArgs]
    Details about a name server
    domain String
    Domain name for which to manage name servers
    servers List<Property Map>
    Details about a name server

    Supporting Types

    NameServersServer, NameServersServerArgs

    Host string
    The server hostname
    Ip string
    The server IP
    Host string
    The server hostname
    Ip string
    The server IP
    host String
    The server hostname
    ip String
    The server IP
    host string
    The server hostname
    ip string
    The server IP
    host str
    The server hostname
    ip str
    The server IP
    host String
    The server hostname
    ip String
    The server IP

    Import

    Name servers can be imported using their domain.

    Using the following configuration:

    hcl

    import {

    to = ovh_domain_name_servers.name_servers

    id = “

    }

    You can then run:

    bash

    $ pulumi preview -generate-config-out=name_servers.tf

    $ pulumi up

    The file name_servers.tf will then contain the imported resource’s configuration, that can be copied next to the import block above.

    See https://developer.hashicorp.com/terraform/language/import/generating-configuration for more details.

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

    Package Details

    Repository
    ovh ovh/pulumi-ovh
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ovh Terraform Provider.
    ovh logo
    OVHCloud v2.0.7 published on Wednesday, Mar 19, 2025 by OVHcloud