1. Packages
  2. Ionoscloud Provider
  3. API Docs
  4. DnsZone
ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud

ionoscloud.DnsZone

Explore with Pulumi AI

ionoscloud logo
ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud

    Manages a DNS Zone.

    ⚠️ Only tokens are accepted for authorization in the ionoscloud_dns_zone resource. Please ensure you are using tokens as other methods will not be valid.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const example = new ionoscloud.DnsZone("example", {
        description: "description",
        enabled: false,
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.DnsZone("example",
        description="description",
        enabled=False)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ionoscloud.NewDnsZone(ctx, "example", &ionoscloud.DnsZoneArgs{
    			Description: pulumi.String("description"),
    			Enabled:     pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ionoscloud = Pulumi.Ionoscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Ionoscloud.DnsZone("example", new()
        {
            Description = "description",
            Enabled = false,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.DnsZone;
    import com.pulumi.ionoscloud.DnsZoneArgs;
    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 DnsZone("example", DnsZoneArgs.builder()
                .description("description")
                .enabled(false)
                .build());
    
        }
    }
    
    resources:
      example:
        type: ionoscloud:DnsZone
        properties:
          description: description
          enabled: false
    

    Create DnsZone Resource

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

    Constructor syntax

    new DnsZone(name: string, args?: DnsZoneArgs, opts?: CustomResourceOptions);
    @overload
    def DnsZone(resource_name: str,
                args: Optional[DnsZoneArgs] = None,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def DnsZone(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                description: Optional[str] = None,
                dns_zone_id: Optional[str] = None,
                enabled: Optional[bool] = None,
                name: Optional[str] = None,
                timeouts: Optional[DnsZoneTimeoutsArgs] = None)
    func NewDnsZone(ctx *Context, name string, args *DnsZoneArgs, opts ...ResourceOption) (*DnsZone, error)
    public DnsZone(string name, DnsZoneArgs? args = null, CustomResourceOptions? opts = null)
    public DnsZone(String name, DnsZoneArgs args)
    public DnsZone(String name, DnsZoneArgs args, CustomResourceOptions options)
    
    type: ionoscloud:DnsZone
    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 DnsZoneArgs
    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 DnsZoneArgs
    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 DnsZoneArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DnsZoneArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DnsZoneArgs
    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 dnsZoneResource = new Ionoscloud.DnsZone("dnsZoneResource", new()
    {
        Description = "string",
        DnsZoneId = "string",
        Enabled = false,
        Name = "string",
        Timeouts = new Ionoscloud.Inputs.DnsZoneTimeoutsArgs
        {
            Create = "string",
            Default = "string",
            Delete = "string",
            Update = "string",
        },
    });
    
    example, err := ionoscloud.NewDnsZone(ctx, "dnsZoneResource", &ionoscloud.DnsZoneArgs{
    	Description: pulumi.String("string"),
    	DnsZoneId:   pulumi.String("string"),
    	Enabled:     pulumi.Bool(false),
    	Name:        pulumi.String("string"),
    	Timeouts: &ionoscloud.DnsZoneTimeoutsArgs{
    		Create:  pulumi.String("string"),
    		Default: pulumi.String("string"),
    		Delete:  pulumi.String("string"),
    		Update:  pulumi.String("string"),
    	},
    })
    
    var dnsZoneResource = new DnsZone("dnsZoneResource", DnsZoneArgs.builder()
        .description("string")
        .dnsZoneId("string")
        .enabled(false)
        .name("string")
        .timeouts(DnsZoneTimeoutsArgs.builder()
            .create("string")
            .default_("string")
            .delete("string")
            .update("string")
            .build())
        .build());
    
    dns_zone_resource = ionoscloud.DnsZone("dnsZoneResource",
        description="string",
        dns_zone_id="string",
        enabled=False,
        name="string",
        timeouts={
            "create": "string",
            "default": "string",
            "delete": "string",
            "update": "string",
        })
    
    const dnsZoneResource = new ionoscloud.DnsZone("dnsZoneResource", {
        description: "string",
        dnsZoneId: "string",
        enabled: false,
        name: "string",
        timeouts: {
            create: "string",
            "default": "string",
            "delete": "string",
            update: "string",
        },
    });
    
    type: ionoscloud:DnsZone
    properties:
        description: string
        dnsZoneId: string
        enabled: false
        name: string
        timeouts:
            create: string
            default: string
            delete: string
            update: string
    

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

    Description string
    [string] The description for the DNS Zone.
    DnsZoneId string
    Enabled bool
    [bool] Indicates if the DNS Zone is active or not. Default is true.
    Name string
    [string] The name of the DNS Zone.
    Timeouts DnsZoneTimeouts
    Description string
    [string] The description for the DNS Zone.
    DnsZoneId string
    Enabled bool
    [bool] Indicates if the DNS Zone is active or not. Default is true.
    Name string
    [string] The name of the DNS Zone.
    Timeouts DnsZoneTimeoutsArgs
    description String
    [string] The description for the DNS Zone.
    dnsZoneId String
    enabled Boolean
    [bool] Indicates if the DNS Zone is active or not. Default is true.
    name String
    [string] The name of the DNS Zone.
    timeouts DnsZoneTimeouts
    description string
    [string] The description for the DNS Zone.
    dnsZoneId string
    enabled boolean
    [bool] Indicates if the DNS Zone is active or not. Default is true.
    name string
    [string] The name of the DNS Zone.
    timeouts DnsZoneTimeouts
    description str
    [string] The description for the DNS Zone.
    dns_zone_id str
    enabled bool
    [bool] Indicates if the DNS Zone is active or not. Default is true.
    name str
    [string] The name of the DNS Zone.
    timeouts DnsZoneTimeoutsArgs
    description String
    [string] The description for the DNS Zone.
    dnsZoneId String
    enabled Boolean
    [bool] Indicates if the DNS Zone is active or not. Default is true.
    name String
    [string] The name of the DNS Zone.
    timeouts Property Map

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Nameservers List<string>
    A list of available name servers.
    Id string
    The provider-assigned unique ID for this managed resource.
    Nameservers []string
    A list of available name servers.
    id String
    The provider-assigned unique ID for this managed resource.
    nameservers List<String>
    A list of available name servers.
    id string
    The provider-assigned unique ID for this managed resource.
    nameservers string[]
    A list of available name servers.
    id str
    The provider-assigned unique ID for this managed resource.
    nameservers Sequence[str]
    A list of available name servers.
    id String
    The provider-assigned unique ID for this managed resource.
    nameservers List<String>
    A list of available name servers.

    Look up Existing DnsZone Resource

    Get an existing DnsZone 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?: DnsZoneState, opts?: CustomResourceOptions): DnsZone
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            dns_zone_id: Optional[str] = None,
            enabled: Optional[bool] = None,
            name: Optional[str] = None,
            nameservers: Optional[Sequence[str]] = None,
            timeouts: Optional[DnsZoneTimeoutsArgs] = None) -> DnsZone
    func GetDnsZone(ctx *Context, name string, id IDInput, state *DnsZoneState, opts ...ResourceOption) (*DnsZone, error)
    public static DnsZone Get(string name, Input<string> id, DnsZoneState? state, CustomResourceOptions? opts = null)
    public static DnsZone get(String name, Output<String> id, DnsZoneState state, CustomResourceOptions options)
    resources:  _:    type: ionoscloud:DnsZone    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:
    Description string
    [string] The description for the DNS Zone.
    DnsZoneId string
    Enabled bool
    [bool] Indicates if the DNS Zone is active or not. Default is true.
    Name string
    [string] The name of the DNS Zone.
    Nameservers List<string>
    A list of available name servers.
    Timeouts DnsZoneTimeouts
    Description string
    [string] The description for the DNS Zone.
    DnsZoneId string
    Enabled bool
    [bool] Indicates if the DNS Zone is active or not. Default is true.
    Name string
    [string] The name of the DNS Zone.
    Nameservers []string
    A list of available name servers.
    Timeouts DnsZoneTimeoutsArgs
    description String
    [string] The description for the DNS Zone.
    dnsZoneId String
    enabled Boolean
    [bool] Indicates if the DNS Zone is active or not. Default is true.
    name String
    [string] The name of the DNS Zone.
    nameservers List<String>
    A list of available name servers.
    timeouts DnsZoneTimeouts
    description string
    [string] The description for the DNS Zone.
    dnsZoneId string
    enabled boolean
    [bool] Indicates if the DNS Zone is active or not. Default is true.
    name string
    [string] The name of the DNS Zone.
    nameservers string[]
    A list of available name servers.
    timeouts DnsZoneTimeouts
    description str
    [string] The description for the DNS Zone.
    dns_zone_id str
    enabled bool
    [bool] Indicates if the DNS Zone is active or not. Default is true.
    name str
    [string] The name of the DNS Zone.
    nameservers Sequence[str]
    A list of available name servers.
    timeouts DnsZoneTimeoutsArgs
    description String
    [string] The description for the DNS Zone.
    dnsZoneId String
    enabled Boolean
    [bool] Indicates if the DNS Zone is active or not. Default is true.
    name String
    [string] The name of the DNS Zone.
    nameservers List<String>
    A list of available name servers.
    timeouts Property Map

    Supporting Types

    DnsZoneTimeouts, DnsZoneTimeoutsArgs

    Create string
    Default string
    Delete string
    Update string
    Create string
    Default string
    Delete string
    Update string
    create String
    default_ String
    delete String
    update String
    create string
    default string
    delete string
    update string
    create String
    default String
    delete String
    update String

    Import

    In order to import a DNS Zone, you can define an empty DNS Zone resource in the plan:

    hcl

    resource “ionoscloud_dns_zone” “example” {

    }

    The resource can be imported using the zone_id, for example:

    $ pulumi import ionoscloud:index/dnsZone:DnsZone examplezone_id 
    

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

    Package Details

    Repository
    ionoscloud ionos-cloud/terraform-provider-ionoscloud
    License
    Notes
    This Pulumi package is based on the ionoscloud Terraform Provider.
    ionoscloud logo
    ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud