1. Packages
  2. stackit
  3. API Docs
  4. DnsZone
Viewing docs for stackit v0.0.4
published on Friday, Feb 20, 2026 by stackitcloud
stackit logo
Viewing docs for stackit v0.0.4
published on Friday, Feb 20, 2026 by stackitcloud

    DNS Zone resource schema.

    Example Usage

    resource "stackit_dns_zone" "example" {
      project_id    = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
      name          = "Example zone"
      dns_name      = "example-zone.com"
      contact_email = "aa@bb.ccc"
      type          = "primary"
      acl           = "192.168.0.0/24"
      description   = "Example description"
      default_ttl   = 1230
    }
    
    # Only use the import statement, if you want to import an existing dns zone
    import {
      to = stackit_dns_zone.import-example
      id = "${var.project_id},${var.zone_id}"
    }
    

    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: DnsZoneArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def DnsZone(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                dns_name: Optional[str] = None,
                project_id: Optional[str] = None,
                expire_time: Optional[int] = None,
                default_ttl: Optional[int] = None,
                description: Optional[str] = None,
                contact_email: Optional[str] = None,
                acl: Optional[str] = None,
                is_reverse_zone: Optional[bool] = None,
                name: Optional[str] = None,
                negative_cache: Optional[int] = None,
                primaries: Optional[Sequence[str]] = None,
                active: Optional[bool] = None,
                refresh_time: Optional[int] = None,
                retry_time: Optional[int] = None,
                type: Optional[str] = None)
    func NewDnsZone(ctx *Context, name string, args DnsZoneArgs, opts ...ResourceOption) (*DnsZone, error)
    public DnsZone(string name, DnsZoneArgs args, CustomResourceOptions? opts = null)
    public DnsZone(String name, DnsZoneArgs args)
    public DnsZone(String name, DnsZoneArgs args, CustomResourceOptions options)
    
    type: stackit: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 Stackit.DnsZone("dnsZoneResource", new()
    {
        DnsName = "string",
        ProjectId = "string",
        ExpireTime = 0,
        DefaultTtl = 0,
        Description = "string",
        ContactEmail = "string",
        Acl = "string",
        IsReverseZone = false,
        Name = "string",
        NegativeCache = 0,
        Primaries = new[]
        {
            "string",
        },
        Active = false,
        RefreshTime = 0,
        RetryTime = 0,
        Type = "string",
    });
    
    example, err := stackit.NewDnsZone(ctx, "dnsZoneResource", &stackit.DnsZoneArgs{
    	DnsName:       pulumi.String("string"),
    	ProjectId:     pulumi.String("string"),
    	ExpireTime:    pulumi.Int(0),
    	DefaultTtl:    pulumi.Int(0),
    	Description:   pulumi.String("string"),
    	ContactEmail:  pulumi.String("string"),
    	Acl:           pulumi.String("string"),
    	IsReverseZone: pulumi.Bool(false),
    	Name:          pulumi.String("string"),
    	NegativeCache: pulumi.Int(0),
    	Primaries: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Active:      pulumi.Bool(false),
    	RefreshTime: pulumi.Int(0),
    	RetryTime:   pulumi.Int(0),
    	Type:        pulumi.String("string"),
    })
    
    var dnsZoneResource = new DnsZone("dnsZoneResource", DnsZoneArgs.builder()
        .dnsName("string")
        .projectId("string")
        .expireTime(0)
        .defaultTtl(0)
        .description("string")
        .contactEmail("string")
        .acl("string")
        .isReverseZone(false)
        .name("string")
        .negativeCache(0)
        .primaries("string")
        .active(false)
        .refreshTime(0)
        .retryTime(0)
        .type("string")
        .build());
    
    dns_zone_resource = stackit.DnsZone("dnsZoneResource",
        dns_name="string",
        project_id="string",
        expire_time=0,
        default_ttl=0,
        description="string",
        contact_email="string",
        acl="string",
        is_reverse_zone=False,
        name="string",
        negative_cache=0,
        primaries=["string"],
        active=False,
        refresh_time=0,
        retry_time=0,
        type="string")
    
    const dnsZoneResource = new stackit.DnsZone("dnsZoneResource", {
        dnsName: "string",
        projectId: "string",
        expireTime: 0,
        defaultTtl: 0,
        description: "string",
        contactEmail: "string",
        acl: "string",
        isReverseZone: false,
        name: "string",
        negativeCache: 0,
        primaries: ["string"],
        active: false,
        refreshTime: 0,
        retryTime: 0,
        type: "string",
    });
    
    type: stackit:DnsZone
    properties:
        acl: string
        active: false
        contactEmail: string
        defaultTtl: 0
        description: string
        dnsName: string
        expireTime: 0
        isReverseZone: false
        name: string
        negativeCache: 0
        primaries:
            - string
        projectId: string
        refreshTime: 0
        retryTime: 0
        type: 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:

    DnsName string
    The zone name. E.g. example.com
    ProjectId string
    STACKIT project ID to which the dns zone is associated.
    Acl string
    The access control list. E.g. 0.0.0.0/0,::/0
    Active bool
    ContactEmail string
    A contact e-mail for the zone.
    DefaultTtl int
    Default time to live. E.g. 3600.
    Description string
    Description of the zone.
    ExpireTime int
    Expire time. E.g. 1209600.
    IsReverseZone bool
    Specifies, if the zone is a reverse zone or not. Defaults to false
    Name string
    The user given name of the zone.
    NegativeCache int
    Negative caching. E.g. 60
    Primaries List<string>
    Primary name server for secondary zone. E.g. ["1.2.3.4"]
    RefreshTime int
    Refresh time. E.g. 3600
    RetryTime int
    Retry time. E.g. 600
    Type string
    Zone type. Defaults to primary. Possible values are: primary, secondary.
    DnsName string
    The zone name. E.g. example.com
    ProjectId string
    STACKIT project ID to which the dns zone is associated.
    Acl string
    The access control list. E.g. 0.0.0.0/0,::/0
    Active bool
    ContactEmail string
    A contact e-mail for the zone.
    DefaultTtl int
    Default time to live. E.g. 3600.
    Description string
    Description of the zone.
    ExpireTime int
    Expire time. E.g. 1209600.
    IsReverseZone bool
    Specifies, if the zone is a reverse zone or not. Defaults to false
    Name string
    The user given name of the zone.
    NegativeCache int
    Negative caching. E.g. 60
    Primaries []string
    Primary name server for secondary zone. E.g. ["1.2.3.4"]
    RefreshTime int
    Refresh time. E.g. 3600
    RetryTime int
    Retry time. E.g. 600
    Type string
    Zone type. Defaults to primary. Possible values are: primary, secondary.
    dnsName String
    The zone name. E.g. example.com
    projectId String
    STACKIT project ID to which the dns zone is associated.
    acl String
    The access control list. E.g. 0.0.0.0/0,::/0
    active Boolean
    contactEmail String
    A contact e-mail for the zone.
    defaultTtl Integer
    Default time to live. E.g. 3600.
    description String
    Description of the zone.
    expireTime Integer
    Expire time. E.g. 1209600.
    isReverseZone Boolean
    Specifies, if the zone is a reverse zone or not. Defaults to false
    name String
    The user given name of the zone.
    negativeCache Integer
    Negative caching. E.g. 60
    primaries List<String>
    Primary name server for secondary zone. E.g. ["1.2.3.4"]
    refreshTime Integer
    Refresh time. E.g. 3600
    retryTime Integer
    Retry time. E.g. 600
    type String
    Zone type. Defaults to primary. Possible values are: primary, secondary.
    dnsName string
    The zone name. E.g. example.com
    projectId string
    STACKIT project ID to which the dns zone is associated.
    acl string
    The access control list. E.g. 0.0.0.0/0,::/0
    active boolean
    contactEmail string
    A contact e-mail for the zone.
    defaultTtl number
    Default time to live. E.g. 3600.
    description string
    Description of the zone.
    expireTime number
    Expire time. E.g. 1209600.
    isReverseZone boolean
    Specifies, if the zone is a reverse zone or not. Defaults to false
    name string
    The user given name of the zone.
    negativeCache number
    Negative caching. E.g. 60
    primaries string[]
    Primary name server for secondary zone. E.g. ["1.2.3.4"]
    refreshTime number
    Refresh time. E.g. 3600
    retryTime number
    Retry time. E.g. 600
    type string
    Zone type. Defaults to primary. Possible values are: primary, secondary.
    dns_name str
    The zone name. E.g. example.com
    project_id str
    STACKIT project ID to which the dns zone is associated.
    acl str
    The access control list. E.g. 0.0.0.0/0,::/0
    active bool
    contact_email str
    A contact e-mail for the zone.
    default_ttl int
    Default time to live. E.g. 3600.
    description str
    Description of the zone.
    expire_time int
    Expire time. E.g. 1209600.
    is_reverse_zone bool
    Specifies, if the zone is a reverse zone or not. Defaults to false
    name str
    The user given name of the zone.
    negative_cache int
    Negative caching. E.g. 60
    primaries Sequence[str]
    Primary name server for secondary zone. E.g. ["1.2.3.4"]
    refresh_time int
    Refresh time. E.g. 3600
    retry_time int
    Retry time. E.g. 600
    type str
    Zone type. Defaults to primary. Possible values are: primary, secondary.
    dnsName String
    The zone name. E.g. example.com
    projectId String
    STACKIT project ID to which the dns zone is associated.
    acl String
    The access control list. E.g. 0.0.0.0/0,::/0
    active Boolean
    contactEmail String
    A contact e-mail for the zone.
    defaultTtl Number
    Default time to live. E.g. 3600.
    description String
    Description of the zone.
    expireTime Number
    Expire time. E.g. 1209600.
    isReverseZone Boolean
    Specifies, if the zone is a reverse zone or not. Defaults to false
    name String
    The user given name of the zone.
    negativeCache Number
    Negative caching. E.g. 60
    primaries List<String>
    Primary name server for secondary zone. E.g. ["1.2.3.4"]
    refreshTime Number
    Refresh time. E.g. 3600
    retryTime Number
    Retry time. E.g. 600
    type String
    Zone type. Defaults to primary. Possible values are: primary, secondary.

    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.
    PrimaryNameServer string
    Primary name server. FQDN.
    RecordCount int
    Record count how many records are in the zone.
    SerialNumber int
    Serial number. E.g. 2022111400.
    State string
    Zone state. E.g. CREATE_SUCCEEDED.
    Visibility string
    Visibility of the zone. E.g. public.
    ZoneId string
    The zone ID.
    Id string
    The provider-assigned unique ID for this managed resource.
    PrimaryNameServer string
    Primary name server. FQDN.
    RecordCount int
    Record count how many records are in the zone.
    SerialNumber int
    Serial number. E.g. 2022111400.
    State string
    Zone state. E.g. CREATE_SUCCEEDED.
    Visibility string
    Visibility of the zone. E.g. public.
    ZoneId string
    The zone ID.
    id String
    The provider-assigned unique ID for this managed resource.
    primaryNameServer String
    Primary name server. FQDN.
    recordCount Integer
    Record count how many records are in the zone.
    serialNumber Integer
    Serial number. E.g. 2022111400.
    state String
    Zone state. E.g. CREATE_SUCCEEDED.
    visibility String
    Visibility of the zone. E.g. public.
    zoneId String
    The zone ID.
    id string
    The provider-assigned unique ID for this managed resource.
    primaryNameServer string
    Primary name server. FQDN.
    recordCount number
    Record count how many records are in the zone.
    serialNumber number
    Serial number. E.g. 2022111400.
    state string
    Zone state. E.g. CREATE_SUCCEEDED.
    visibility string
    Visibility of the zone. E.g. public.
    zoneId string
    The zone ID.
    id str
    The provider-assigned unique ID for this managed resource.
    primary_name_server str
    Primary name server. FQDN.
    record_count int
    Record count how many records are in the zone.
    serial_number int
    Serial number. E.g. 2022111400.
    state str
    Zone state. E.g. CREATE_SUCCEEDED.
    visibility str
    Visibility of the zone. E.g. public.
    zone_id str
    The zone ID.
    id String
    The provider-assigned unique ID for this managed resource.
    primaryNameServer String
    Primary name server. FQDN.
    recordCount Number
    Record count how many records are in the zone.
    serialNumber Number
    Serial number. E.g. 2022111400.
    state String
    Zone state. E.g. CREATE_SUCCEEDED.
    visibility String
    Visibility of the zone. E.g. public.
    zoneId String
    The zone ID.

    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,
            acl: Optional[str] = None,
            active: Optional[bool] = None,
            contact_email: Optional[str] = None,
            default_ttl: Optional[int] = None,
            description: Optional[str] = None,
            dns_name: Optional[str] = None,
            expire_time: Optional[int] = None,
            is_reverse_zone: Optional[bool] = None,
            name: Optional[str] = None,
            negative_cache: Optional[int] = None,
            primaries: Optional[Sequence[str]] = None,
            primary_name_server: Optional[str] = None,
            project_id: Optional[str] = None,
            record_count: Optional[int] = None,
            refresh_time: Optional[int] = None,
            retry_time: Optional[int] = None,
            serial_number: Optional[int] = None,
            state: Optional[str] = None,
            type: Optional[str] = None,
            visibility: Optional[str] = None,
            zone_id: Optional[str] = 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: stackit: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:
    Acl string
    The access control list. E.g. 0.0.0.0/0,::/0
    Active bool
    ContactEmail string
    A contact e-mail for the zone.
    DefaultTtl int
    Default time to live. E.g. 3600.
    Description string
    Description of the zone.
    DnsName string
    The zone name. E.g. example.com
    ExpireTime int
    Expire time. E.g. 1209600.
    IsReverseZone bool
    Specifies, if the zone is a reverse zone or not. Defaults to false
    Name string
    The user given name of the zone.
    NegativeCache int
    Negative caching. E.g. 60
    Primaries List<string>
    Primary name server for secondary zone. E.g. ["1.2.3.4"]
    PrimaryNameServer string
    Primary name server. FQDN.
    ProjectId string
    STACKIT project ID to which the dns zone is associated.
    RecordCount int
    Record count how many records are in the zone.
    RefreshTime int
    Refresh time. E.g. 3600
    RetryTime int
    Retry time. E.g. 600
    SerialNumber int
    Serial number. E.g. 2022111400.
    State string
    Zone state. E.g. CREATE_SUCCEEDED.
    Type string
    Zone type. Defaults to primary. Possible values are: primary, secondary.
    Visibility string
    Visibility of the zone. E.g. public.
    ZoneId string
    The zone ID.
    Acl string
    The access control list. E.g. 0.0.0.0/0,::/0
    Active bool
    ContactEmail string
    A contact e-mail for the zone.
    DefaultTtl int
    Default time to live. E.g. 3600.
    Description string
    Description of the zone.
    DnsName string
    The zone name. E.g. example.com
    ExpireTime int
    Expire time. E.g. 1209600.
    IsReverseZone bool
    Specifies, if the zone is a reverse zone or not. Defaults to false
    Name string
    The user given name of the zone.
    NegativeCache int
    Negative caching. E.g. 60
    Primaries []string
    Primary name server for secondary zone. E.g. ["1.2.3.4"]
    PrimaryNameServer string
    Primary name server. FQDN.
    ProjectId string
    STACKIT project ID to which the dns zone is associated.
    RecordCount int
    Record count how many records are in the zone.
    RefreshTime int
    Refresh time. E.g. 3600
    RetryTime int
    Retry time. E.g. 600
    SerialNumber int
    Serial number. E.g. 2022111400.
    State string
    Zone state. E.g. CREATE_SUCCEEDED.
    Type string
    Zone type. Defaults to primary. Possible values are: primary, secondary.
    Visibility string
    Visibility of the zone. E.g. public.
    ZoneId string
    The zone ID.
    acl String
    The access control list. E.g. 0.0.0.0/0,::/0
    active Boolean
    contactEmail String
    A contact e-mail for the zone.
    defaultTtl Integer
    Default time to live. E.g. 3600.
    description String
    Description of the zone.
    dnsName String
    The zone name. E.g. example.com
    expireTime Integer
    Expire time. E.g. 1209600.
    isReverseZone Boolean
    Specifies, if the zone is a reverse zone or not. Defaults to false
    name String
    The user given name of the zone.
    negativeCache Integer
    Negative caching. E.g. 60
    primaries List<String>
    Primary name server for secondary zone. E.g. ["1.2.3.4"]
    primaryNameServer String
    Primary name server. FQDN.
    projectId String
    STACKIT project ID to which the dns zone is associated.
    recordCount Integer
    Record count how many records are in the zone.
    refreshTime Integer
    Refresh time. E.g. 3600
    retryTime Integer
    Retry time. E.g. 600
    serialNumber Integer
    Serial number. E.g. 2022111400.
    state String
    Zone state. E.g. CREATE_SUCCEEDED.
    type String
    Zone type. Defaults to primary. Possible values are: primary, secondary.
    visibility String
    Visibility of the zone. E.g. public.
    zoneId String
    The zone ID.
    acl string
    The access control list. E.g. 0.0.0.0/0,::/0
    active boolean
    contactEmail string
    A contact e-mail for the zone.
    defaultTtl number
    Default time to live. E.g. 3600.
    description string
    Description of the zone.
    dnsName string
    The zone name. E.g. example.com
    expireTime number
    Expire time. E.g. 1209600.
    isReverseZone boolean
    Specifies, if the zone is a reverse zone or not. Defaults to false
    name string
    The user given name of the zone.
    negativeCache number
    Negative caching. E.g. 60
    primaries string[]
    Primary name server for secondary zone. E.g. ["1.2.3.4"]
    primaryNameServer string
    Primary name server. FQDN.
    projectId string
    STACKIT project ID to which the dns zone is associated.
    recordCount number
    Record count how many records are in the zone.
    refreshTime number
    Refresh time. E.g. 3600
    retryTime number
    Retry time. E.g. 600
    serialNumber number
    Serial number. E.g. 2022111400.
    state string
    Zone state. E.g. CREATE_SUCCEEDED.
    type string
    Zone type. Defaults to primary. Possible values are: primary, secondary.
    visibility string
    Visibility of the zone. E.g. public.
    zoneId string
    The zone ID.
    acl str
    The access control list. E.g. 0.0.0.0/0,::/0
    active bool
    contact_email str
    A contact e-mail for the zone.
    default_ttl int
    Default time to live. E.g. 3600.
    description str
    Description of the zone.
    dns_name str
    The zone name. E.g. example.com
    expire_time int
    Expire time. E.g. 1209600.
    is_reverse_zone bool
    Specifies, if the zone is a reverse zone or not. Defaults to false
    name str
    The user given name of the zone.
    negative_cache int
    Negative caching. E.g. 60
    primaries Sequence[str]
    Primary name server for secondary zone. E.g. ["1.2.3.4"]
    primary_name_server str
    Primary name server. FQDN.
    project_id str
    STACKIT project ID to which the dns zone is associated.
    record_count int
    Record count how many records are in the zone.
    refresh_time int
    Refresh time. E.g. 3600
    retry_time int
    Retry time. E.g. 600
    serial_number int
    Serial number. E.g. 2022111400.
    state str
    Zone state. E.g. CREATE_SUCCEEDED.
    type str
    Zone type. Defaults to primary. Possible values are: primary, secondary.
    visibility str
    Visibility of the zone. E.g. public.
    zone_id str
    The zone ID.
    acl String
    The access control list. E.g. 0.0.0.0/0,::/0
    active Boolean
    contactEmail String
    A contact e-mail for the zone.
    defaultTtl Number
    Default time to live. E.g. 3600.
    description String
    Description of the zone.
    dnsName String
    The zone name. E.g. example.com
    expireTime Number
    Expire time. E.g. 1209600.
    isReverseZone Boolean
    Specifies, if the zone is a reverse zone or not. Defaults to false
    name String
    The user given name of the zone.
    negativeCache Number
    Negative caching. E.g. 60
    primaries List<String>
    Primary name server for secondary zone. E.g. ["1.2.3.4"]
    primaryNameServer String
    Primary name server. FQDN.
    projectId String
    STACKIT project ID to which the dns zone is associated.
    recordCount Number
    Record count how many records are in the zone.
    refreshTime Number
    Refresh time. E.g. 3600
    retryTime Number
    Retry time. E.g. 600
    serialNumber Number
    Serial number. E.g. 2022111400.
    state String
    Zone state. E.g. CREATE_SUCCEEDED.
    type String
    Zone type. Defaults to primary. Possible values are: primary, secondary.
    visibility String
    Visibility of the zone. E.g. public.
    zoneId String
    The zone ID.

    Package Details

    Repository
    stackit stackitcloud/pulumi-stackit
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the stackit Terraform Provider.
    stackit logo
    Viewing docs for stackit v0.0.4
    published on Friday, Feb 20, 2026 by stackitcloud
      Try Pulumi Cloud free. Your team will thank you.