openstack.dns.Zone
Explore with Pulumi AI
Manages a DNS zone in the OpenStack DNS Service.
Example Usage
Automatically detect the correct network
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";
const exampleCom = new openstack.dns.Zone("example_com", {
name: "example.com.",
email: "jdoe@example.com",
description: "An example zone",
ttl: 3000,
type: "PRIMARY",
});
import pulumi
import pulumi_openstack as openstack
example_com = openstack.dns.Zone("example_com",
name="example.com.",
email="jdoe@example.com",
description="An example zone",
ttl=3000,
type="PRIMARY")
package main
import (
"github.com/pulumi/pulumi-openstack/sdk/v5/go/openstack/dns"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dns.NewZone(ctx, "example_com", &dns.ZoneArgs{
Name: pulumi.String("example.com."),
Email: pulumi.String("jdoe@example.com"),
Description: pulumi.String("An example zone"),
Ttl: pulumi.Int(3000),
Type: pulumi.String("PRIMARY"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using OpenStack = Pulumi.OpenStack;
return await Deployment.RunAsync(() =>
{
var exampleCom = new OpenStack.Dns.Zone("example_com", new()
{
Name = "example.com.",
Email = "jdoe@example.com",
Description = "An example zone",
Ttl = 3000,
Type = "PRIMARY",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.openstack.dns.Zone;
import com.pulumi.openstack.dns.ZoneArgs;
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 exampleCom = new Zone("exampleCom", ZoneArgs.builder()
.name("example.com.")
.email("jdoe@example.com")
.description("An example zone")
.ttl(3000)
.type("PRIMARY")
.build());
}
}
resources:
exampleCom:
type: openstack:dns:Zone
name: example_com
properties:
name: example.com.
email: jdoe@example.com
description: An example zone
ttl: 3000
type: PRIMARY
Create Zone Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Zone(name: string, args?: ZoneArgs, opts?: CustomResourceOptions);
@overload
def Zone(resource_name: str,
args: Optional[ZoneArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Zone(resource_name: str,
opts: Optional[ResourceOptions] = None,
attributes: Optional[Mapping[str, str]] = None,
description: Optional[str] = None,
disable_status_check: Optional[bool] = None,
email: Optional[str] = None,
masters: Optional[Sequence[str]] = None,
name: Optional[str] = None,
project_id: Optional[str] = None,
region: Optional[str] = None,
ttl: Optional[int] = None,
type: Optional[str] = None,
value_specs: Optional[Mapping[str, str]] = None)
func NewZone(ctx *Context, name string, args *ZoneArgs, opts ...ResourceOption) (*Zone, error)
public Zone(string name, ZoneArgs? args = null, CustomResourceOptions? opts = null)
type: openstack:dns:Zone
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 ZoneArgs
- 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 ZoneArgs
- 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 ZoneArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ZoneArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ZoneArgs
- 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 zoneResource = new OpenStack.Dns.Zone("zoneResource", new()
{
Attributes =
{
{ "string", "string" },
},
Description = "string",
DisableStatusCheck = false,
Email = "string",
Masters = new[]
{
"string",
},
Name = "string",
ProjectId = "string",
Region = "string",
Ttl = 0,
Type = "string",
ValueSpecs =
{
{ "string", "string" },
},
});
example, err := dns.NewZone(ctx, "zoneResource", &dns.ZoneArgs{
Attributes: pulumi.StringMap{
"string": pulumi.String("string"),
},
Description: pulumi.String("string"),
DisableStatusCheck: pulumi.Bool(false),
Email: pulumi.String("string"),
Masters: pulumi.StringArray{
pulumi.String("string"),
},
Name: pulumi.String("string"),
ProjectId: pulumi.String("string"),
Region: pulumi.String("string"),
Ttl: pulumi.Int(0),
Type: pulumi.String("string"),
ValueSpecs: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var zoneResource = new Zone("zoneResource", ZoneArgs.builder()
.attributes(Map.of("string", "string"))
.description("string")
.disableStatusCheck(false)
.email("string")
.masters("string")
.name("string")
.projectId("string")
.region("string")
.ttl(0)
.type("string")
.valueSpecs(Map.of("string", "string"))
.build());
zone_resource = openstack.dns.Zone("zoneResource",
attributes={
"string": "string",
},
description="string",
disable_status_check=False,
email="string",
masters=["string"],
name="string",
project_id="string",
region="string",
ttl=0,
type="string",
value_specs={
"string": "string",
})
const zoneResource = new openstack.dns.Zone("zoneResource", {
attributes: {
string: "string",
},
description: "string",
disableStatusCheck: false,
email: "string",
masters: ["string"],
name: "string",
projectId: "string",
region: "string",
ttl: 0,
type: "string",
valueSpecs: {
string: "string",
},
});
type: openstack:dns:Zone
properties:
attributes:
string: string
description: string
disableStatusCheck: false
email: string
masters:
- string
name: string
projectId: string
region: string
ttl: 0
type: string
valueSpecs:
string: string
Zone 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 Zone resource accepts the following input properties:
- Attributes Dictionary<string, string>
- Attributes for the DNS Service scheduler. Changing this creates a new zone.
- Description string
- A description of the zone.
- Disable
Status boolCheck - Disable wait for zone to reach ACTIVE status. The check is enabled by default. If this argument is true, zone will be considered as created/updated if OpenStack request returned success.
- Email string
- The email contact for the zone record.
- Masters List<string>
- An array of master DNS servers. For when
type
isSECONDARY
. - Name string
- The name of the zone. Note the
.
at the end of the name. Changing this creates a new DNS zone. - Project
Id string - The ID of the project DNS zone is created
for, sets
X-Auth-Sudo-Tenant-ID
header (requires an assigned user role in target project) - Region string
- The region in which to obtain the V2 Compute client.
Keypairs are associated with accounts, but a Compute client is needed to
create one. If omitted, the
region
argument of the provider is used. Changing this creates a new DNS zone. - Ttl int
- The time to live (TTL) of the zone.
- Type string
- The type of zone. Can either be
PRIMARY
orSECONDARY
. Changing this creates a new zone. - Value
Specs Dictionary<string, string> - Map of additional options. Changing this creates a new zone.
- Attributes map[string]string
- Attributes for the DNS Service scheduler. Changing this creates a new zone.
- Description string
- A description of the zone.
- Disable
Status boolCheck - Disable wait for zone to reach ACTIVE status. The check is enabled by default. If this argument is true, zone will be considered as created/updated if OpenStack request returned success.
- Email string
- The email contact for the zone record.
- Masters []string
- An array of master DNS servers. For when
type
isSECONDARY
. - Name string
- The name of the zone. Note the
.
at the end of the name. Changing this creates a new DNS zone. - Project
Id string - The ID of the project DNS zone is created
for, sets
X-Auth-Sudo-Tenant-ID
header (requires an assigned user role in target project) - Region string
- The region in which to obtain the V2 Compute client.
Keypairs are associated with accounts, but a Compute client is needed to
create one. If omitted, the
region
argument of the provider is used. Changing this creates a new DNS zone. - Ttl int
- The time to live (TTL) of the zone.
- Type string
- The type of zone. Can either be
PRIMARY
orSECONDARY
. Changing this creates a new zone. - Value
Specs map[string]string - Map of additional options. Changing this creates a new zone.
- attributes Map<String,String>
- Attributes for the DNS Service scheduler. Changing this creates a new zone.
- description String
- A description of the zone.
- disable
Status BooleanCheck - Disable wait for zone to reach ACTIVE status. The check is enabled by default. If this argument is true, zone will be considered as created/updated if OpenStack request returned success.
- email String
- The email contact for the zone record.
- masters List<String>
- An array of master DNS servers. For when
type
isSECONDARY
. - name String
- The name of the zone. Note the
.
at the end of the name. Changing this creates a new DNS zone. - project
Id String - The ID of the project DNS zone is created
for, sets
X-Auth-Sudo-Tenant-ID
header (requires an assigned user role in target project) - region String
- The region in which to obtain the V2 Compute client.
Keypairs are associated with accounts, but a Compute client is needed to
create one. If omitted, the
region
argument of the provider is used. Changing this creates a new DNS zone. - ttl Integer
- The time to live (TTL) of the zone.
- type String
- The type of zone. Can either be
PRIMARY
orSECONDARY
. Changing this creates a new zone. - value
Specs Map<String,String> - Map of additional options. Changing this creates a new zone.
- attributes {[key: string]: string}
- Attributes for the DNS Service scheduler. Changing this creates a new zone.
- description string
- A description of the zone.
- disable
Status booleanCheck - Disable wait for zone to reach ACTIVE status. The check is enabled by default. If this argument is true, zone will be considered as created/updated if OpenStack request returned success.
- email string
- The email contact for the zone record.
- masters string[]
- An array of master DNS servers. For when
type
isSECONDARY
. - name string
- The name of the zone. Note the
.
at the end of the name. Changing this creates a new DNS zone. - project
Id string - The ID of the project DNS zone is created
for, sets
X-Auth-Sudo-Tenant-ID
header (requires an assigned user role in target project) - region string
- The region in which to obtain the V2 Compute client.
Keypairs are associated with accounts, but a Compute client is needed to
create one. If omitted, the
region
argument of the provider is used. Changing this creates a new DNS zone. - ttl number
- The time to live (TTL) of the zone.
- type string
- The type of zone. Can either be
PRIMARY
orSECONDARY
. Changing this creates a new zone. - value
Specs {[key: string]: string} - Map of additional options. Changing this creates a new zone.
- attributes Mapping[str, str]
- Attributes for the DNS Service scheduler. Changing this creates a new zone.
- description str
- A description of the zone.
- disable_
status_ boolcheck - Disable wait for zone to reach ACTIVE status. The check is enabled by default. If this argument is true, zone will be considered as created/updated if OpenStack request returned success.
- email str
- The email contact for the zone record.
- masters Sequence[str]
- An array of master DNS servers. For when
type
isSECONDARY
. - name str
- The name of the zone. Note the
.
at the end of the name. Changing this creates a new DNS zone. - project_
id str - The ID of the project DNS zone is created
for, sets
X-Auth-Sudo-Tenant-ID
header (requires an assigned user role in target project) - region str
- The region in which to obtain the V2 Compute client.
Keypairs are associated with accounts, but a Compute client is needed to
create one. If omitted, the
region
argument of the provider is used. Changing this creates a new DNS zone. - ttl int
- The time to live (TTL) of the zone.
- type str
- The type of zone. Can either be
PRIMARY
orSECONDARY
. Changing this creates a new zone. - value_
specs Mapping[str, str] - Map of additional options. Changing this creates a new zone.
- attributes Map<String>
- Attributes for the DNS Service scheduler. Changing this creates a new zone.
- description String
- A description of the zone.
- disable
Status BooleanCheck - Disable wait for zone to reach ACTIVE status. The check is enabled by default. If this argument is true, zone will be considered as created/updated if OpenStack request returned success.
- email String
- The email contact for the zone record.
- masters List<String>
- An array of master DNS servers. For when
type
isSECONDARY
. - name String
- The name of the zone. Note the
.
at the end of the name. Changing this creates a new DNS zone. - project
Id String - The ID of the project DNS zone is created
for, sets
X-Auth-Sudo-Tenant-ID
header (requires an assigned user role in target project) - region String
- The region in which to obtain the V2 Compute client.
Keypairs are associated with accounts, but a Compute client is needed to
create one. If omitted, the
region
argument of the provider is used. Changing this creates a new DNS zone. - ttl Number
- The time to live (TTL) of the zone.
- type String
- The type of zone. Can either be
PRIMARY
orSECONDARY
. Changing this creates a new zone. - value
Specs Map<String> - Map of additional options. Changing this creates a new zone.
Outputs
All input properties are implicitly available as output properties. Additionally, the Zone 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 Zone Resource
Get an existing Zone 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?: ZoneState, opts?: CustomResourceOptions): Zone
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
attributes: Optional[Mapping[str, str]] = None,
description: Optional[str] = None,
disable_status_check: Optional[bool] = None,
email: Optional[str] = None,
masters: Optional[Sequence[str]] = None,
name: Optional[str] = None,
project_id: Optional[str] = None,
region: Optional[str] = None,
ttl: Optional[int] = None,
type: Optional[str] = None,
value_specs: Optional[Mapping[str, str]] = None) -> Zone
func GetZone(ctx *Context, name string, id IDInput, state *ZoneState, opts ...ResourceOption) (*Zone, error)
public static Zone Get(string name, Input<string> id, ZoneState? state, CustomResourceOptions? opts = null)
public static Zone get(String name, Output<String> id, ZoneState 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.
- Attributes Dictionary<string, string>
- Attributes for the DNS Service scheduler. Changing this creates a new zone.
- Description string
- A description of the zone.
- Disable
Status boolCheck - Disable wait for zone to reach ACTIVE status. The check is enabled by default. If this argument is true, zone will be considered as created/updated if OpenStack request returned success.
- Email string
- The email contact for the zone record.
- Masters List<string>
- An array of master DNS servers. For when
type
isSECONDARY
. - Name string
- The name of the zone. Note the
.
at the end of the name. Changing this creates a new DNS zone. - Project
Id string - The ID of the project DNS zone is created
for, sets
X-Auth-Sudo-Tenant-ID
header (requires an assigned user role in target project) - Region string
- The region in which to obtain the V2 Compute client.
Keypairs are associated with accounts, but a Compute client is needed to
create one. If omitted, the
region
argument of the provider is used. Changing this creates a new DNS zone. - Ttl int
- The time to live (TTL) of the zone.
- Type string
- The type of zone. Can either be
PRIMARY
orSECONDARY
. Changing this creates a new zone. - Value
Specs Dictionary<string, string> - Map of additional options. Changing this creates a new zone.
- Attributes map[string]string
- Attributes for the DNS Service scheduler. Changing this creates a new zone.
- Description string
- A description of the zone.
- Disable
Status boolCheck - Disable wait for zone to reach ACTIVE status. The check is enabled by default. If this argument is true, zone will be considered as created/updated if OpenStack request returned success.
- Email string
- The email contact for the zone record.
- Masters []string
- An array of master DNS servers. For when
type
isSECONDARY
. - Name string
- The name of the zone. Note the
.
at the end of the name. Changing this creates a new DNS zone. - Project
Id string - The ID of the project DNS zone is created
for, sets
X-Auth-Sudo-Tenant-ID
header (requires an assigned user role in target project) - Region string
- The region in which to obtain the V2 Compute client.
Keypairs are associated with accounts, but a Compute client is needed to
create one. If omitted, the
region
argument of the provider is used. Changing this creates a new DNS zone. - Ttl int
- The time to live (TTL) of the zone.
- Type string
- The type of zone. Can either be
PRIMARY
orSECONDARY
. Changing this creates a new zone. - Value
Specs map[string]string - Map of additional options. Changing this creates a new zone.
- attributes Map<String,String>
- Attributes for the DNS Service scheduler. Changing this creates a new zone.
- description String
- A description of the zone.
- disable
Status BooleanCheck - Disable wait for zone to reach ACTIVE status. The check is enabled by default. If this argument is true, zone will be considered as created/updated if OpenStack request returned success.
- email String
- The email contact for the zone record.
- masters List<String>
- An array of master DNS servers. For when
type
isSECONDARY
. - name String
- The name of the zone. Note the
.
at the end of the name. Changing this creates a new DNS zone. - project
Id String - The ID of the project DNS zone is created
for, sets
X-Auth-Sudo-Tenant-ID
header (requires an assigned user role in target project) - region String
- The region in which to obtain the V2 Compute client.
Keypairs are associated with accounts, but a Compute client is needed to
create one. If omitted, the
region
argument of the provider is used. Changing this creates a new DNS zone. - ttl Integer
- The time to live (TTL) of the zone.
- type String
- The type of zone. Can either be
PRIMARY
orSECONDARY
. Changing this creates a new zone. - value
Specs Map<String,String> - Map of additional options. Changing this creates a new zone.
- attributes {[key: string]: string}
- Attributes for the DNS Service scheduler. Changing this creates a new zone.
- description string
- A description of the zone.
- disable
Status booleanCheck - Disable wait for zone to reach ACTIVE status. The check is enabled by default. If this argument is true, zone will be considered as created/updated if OpenStack request returned success.
- email string
- The email contact for the zone record.
- masters string[]
- An array of master DNS servers. For when
type
isSECONDARY
. - name string
- The name of the zone. Note the
.
at the end of the name. Changing this creates a new DNS zone. - project
Id string - The ID of the project DNS zone is created
for, sets
X-Auth-Sudo-Tenant-ID
header (requires an assigned user role in target project) - region string
- The region in which to obtain the V2 Compute client.
Keypairs are associated with accounts, but a Compute client is needed to
create one. If omitted, the
region
argument of the provider is used. Changing this creates a new DNS zone. - ttl number
- The time to live (TTL) of the zone.
- type string
- The type of zone. Can either be
PRIMARY
orSECONDARY
. Changing this creates a new zone. - value
Specs {[key: string]: string} - Map of additional options. Changing this creates a new zone.
- attributes Mapping[str, str]
- Attributes for the DNS Service scheduler. Changing this creates a new zone.
- description str
- A description of the zone.
- disable_
status_ boolcheck - Disable wait for zone to reach ACTIVE status. The check is enabled by default. If this argument is true, zone will be considered as created/updated if OpenStack request returned success.
- email str
- The email contact for the zone record.
- masters Sequence[str]
- An array of master DNS servers. For when
type
isSECONDARY
. - name str
- The name of the zone. Note the
.
at the end of the name. Changing this creates a new DNS zone. - project_
id str - The ID of the project DNS zone is created
for, sets
X-Auth-Sudo-Tenant-ID
header (requires an assigned user role in target project) - region str
- The region in which to obtain the V2 Compute client.
Keypairs are associated with accounts, but a Compute client is needed to
create one. If omitted, the
region
argument of the provider is used. Changing this creates a new DNS zone. - ttl int
- The time to live (TTL) of the zone.
- type str
- The type of zone. Can either be
PRIMARY
orSECONDARY
. Changing this creates a new zone. - value_
specs Mapping[str, str] - Map of additional options. Changing this creates a new zone.
- attributes Map<String>
- Attributes for the DNS Service scheduler. Changing this creates a new zone.
- description String
- A description of the zone.
- disable
Status BooleanCheck - Disable wait for zone to reach ACTIVE status. The check is enabled by default. If this argument is true, zone will be considered as created/updated if OpenStack request returned success.
- email String
- The email contact for the zone record.
- masters List<String>
- An array of master DNS servers. For when
type
isSECONDARY
. - name String
- The name of the zone. Note the
.
at the end of the name. Changing this creates a new DNS zone. - project
Id String - The ID of the project DNS zone is created
for, sets
X-Auth-Sudo-Tenant-ID
header (requires an assigned user role in target project) - region String
- The region in which to obtain the V2 Compute client.
Keypairs are associated with accounts, but a Compute client is needed to
create one. If omitted, the
region
argument of the provider is used. Changing this creates a new DNS zone. - ttl Number
- The time to live (TTL) of the zone.
- type String
- The type of zone. Can either be
PRIMARY
orSECONDARY
. Changing this creates a new zone. - value
Specs Map<String> - Map of additional options. Changing this creates a new zone.
Import
This resource can be imported by specifying the zone ID with optional project ID:
$ pulumi import openstack:dns/zone:Zone zone_1 zone_id
$ pulumi import openstack:dns/zone:Zone zone_1 zone_id:project_id
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- OpenStack pulumi/pulumi-openstack
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
openstack
Terraform Provider.