Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

Yandex

v0.10.0 published on Thursday, Nov 18, 2021 by Pulumi

DnsZone

Manages a DNS Zone.

Example Usage

using Pulumi;
using Yandex = Pulumi.Yandex;

class MyStack : Stack
{
    public MyStack()
    {
        var foo = new Yandex.VpcNetwork("foo", new Yandex.VpcNetworkArgs
        {
        });
        var zone1 = new Yandex.DnsZone("zone1", new Yandex.DnsZoneArgs
        {
            Description = "desc",
            Labels = 
            {
                { "label1", "label-1-value" },
            },
            Zone = "example.com.",
            Public = false,
            PrivateNetworks = 
            {
                foo.Id,
            },
        });
        var rs1 = new Yandex.DnsRecordSet("rs1", new Yandex.DnsRecordSetArgs
        {
            ZoneId = zone1.Id,
            Type = "A",
            Ttl = 200,
            Datas = 
            {
                "10.1.0.1",
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-yandex/sdk/go/yandex"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		foo, err := yandex.NewVpcNetwork(ctx, "foo", nil)
		if err != nil {
			return err
		}
		zone1, err := yandex.NewDnsZone(ctx, "zone1", &yandex.DnsZoneArgs{
			Description: pulumi.String("desc"),
			Labels: pulumi.StringMap{
				"label1": pulumi.String("label-1-value"),
			},
			Zone:   pulumi.String("example.com."),
			Public: pulumi.Bool(false),
			PrivateNetworks: pulumi.StringArray{
				foo.ID(),
			},
		})
		if err != nil {
			return err
		}
		_, err = yandex.NewDnsRecordSet(ctx, "rs1", &yandex.DnsRecordSetArgs{
			ZoneId: zone1.ID(),
			Type:   pulumi.String("A"),
			Ttl:    pulumi.Int(200),
			Datas: pulumi.StringArray{
				pulumi.String("10.1.0.1"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_yandex as yandex

foo = yandex.VpcNetwork("foo")
zone1 = yandex.DnsZone("zone1",
    description="desc",
    labels={
        "label1": "label-1-value",
    },
    zone="example.com.",
    public=False,
    private_networks=[foo.id])
rs1 = yandex.DnsRecordSet("rs1",
    zone_id=zone1.id,
    type="A",
    ttl=200,
    datas=["10.1.0.1"])
import * as pulumi from "@pulumi/pulumi";
import * as yandex from "@pulumi/yandex";

const foo = new yandex.VpcNetwork("foo", {});
const zone1 = new yandex.DnsZone("zone1", {
    description: "desc",
    labels: {
        label1: "label-1-value",
    },
    zone: "example.com.",
    "public": false,
    privateNetworks: [foo.id],
});
const rs1 = new yandex.DnsRecordSet("rs1", {
    zoneId: zone1.id,
    type: "A",
    ttl: 200,
    datas: ["10.1.0.1"],
});

Create a DnsZone Resource

new DnsZone(name: string, args: DnsZoneArgs, opts?: CustomResourceOptions);
@overload
def DnsZone(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            folder_id: Optional[str] = None,
            labels: Optional[Mapping[str, str]] = None,
            name: Optional[str] = None,
            private_networks: Optional[Sequence[str]] = None,
            public: Optional[bool] = None,
            zone: Optional[str] = None)
@overload
def DnsZone(resource_name: str,
            args: DnsZoneArgs,
            opts: Optional[ResourceOptions] = None)
func NewDnsZone(ctx *Context, name string, args DnsZoneArgs, opts ...ResourceOption) (*DnsZone, error)
public DnsZone(string name, DnsZoneArgs args, CustomResourceOptions? opts = null)
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.

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

The DnsZone resource accepts the following input properties:

Zone string
The DNS name of this zone, e.g. “example.com.”. Must ends with dot.
Description string
Description of the DNS zone.
FolderId string
ID of the folder to create a zone in. If it is not provided, the default provider folder is used.
Labels Dictionary<string, string>
A set of key/value label pairs to assign to the DNS zone.
Name string
User assigned name of a specific resource. Must be unique within the folder.
PrivateNetworks List<string>
For privately visible zones, the set of Virtual Private Cloud resources that the zone is visible from.
Public bool
The zone’s visibility: public zones are exposed to the Internet, while private zones are visible only to Virtual Private Cloud resources.
Zone string
The DNS name of this zone, e.g. “example.com.”. Must ends with dot.
Description string
Description of the DNS zone.
FolderId string
ID of the folder to create a zone in. If it is not provided, the default provider folder is used.
Labels map[string]string
A set of key/value label pairs to assign to the DNS zone.
Name string
User assigned name of a specific resource. Must be unique within the folder.
PrivateNetworks []string
For privately visible zones, the set of Virtual Private Cloud resources that the zone is visible from.
Public bool
The zone’s visibility: public zones are exposed to the Internet, while private zones are visible only to Virtual Private Cloud resources.
zone string
The DNS name of this zone, e.g. “example.com.”. Must ends with dot.
description string
Description of the DNS zone.
folderId string
ID of the folder to create a zone in. If it is not provided, the default provider folder is used.
labels {[key: string]: string}
A set of key/value label pairs to assign to the DNS zone.
name string
User assigned name of a specific resource. Must be unique within the folder.
privateNetworks string[]
For privately visible zones, the set of Virtual Private Cloud resources that the zone is visible from.
public boolean
The zone’s visibility: public zones are exposed to the Internet, while private zones are visible only to Virtual Private Cloud resources.
zone str
The DNS name of this zone, e.g. “example.com.”. Must ends with dot.
description str
Description of the DNS zone.
folder_id str
ID of the folder to create a zone in. If it is not provided, the default provider folder is used.
labels Mapping[str, str]
A set of key/value label pairs to assign to the DNS zone.
name str
User assigned name of a specific resource. Must be unique within the folder.
private_networks Sequence[str]
For privately visible zones, the set of Virtual Private Cloud resources that the zone is visible from.
public bool
The zone’s visibility: public zones are exposed to the Internet, while private zones are visible only to Virtual Private Cloud resources.

Outputs

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

CreatedAt string
(Computed) The DNS zone creation timestamp.
Id string
The provider-assigned unique ID for this managed resource.
CreatedAt string
(Computed) The DNS zone creation timestamp.
Id string
The provider-assigned unique ID for this managed resource.
createdAt string
(Computed) The DNS zone creation timestamp.
id string
The provider-assigned unique ID for this managed resource.
created_at str
(Computed) The DNS zone creation timestamp.
id str
The provider-assigned unique ID for this managed resource.

Look up an 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,
        created_at: Optional[str] = None,
        description: Optional[str] = None,
        folder_id: Optional[str] = None,
        labels: Optional[Mapping[str, str]] = None,
        name: Optional[str] = None,
        private_networks: Optional[Sequence[str]] = None,
        public: Optional[bool] = None,
        zone: 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)
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.

The following state arguments are supported:

CreatedAt string
(Computed) The DNS zone creation timestamp.
Description string
Description of the DNS zone.
FolderId string
ID of the folder to create a zone in. If it is not provided, the default provider folder is used.
Labels Dictionary<string, string>
A set of key/value label pairs to assign to the DNS zone.
Name string
User assigned name of a specific resource. Must be unique within the folder.
PrivateNetworks List<string>
For privately visible zones, the set of Virtual Private Cloud resources that the zone is visible from.
Public bool
The zone’s visibility: public zones are exposed to the Internet, while private zones are visible only to Virtual Private Cloud resources.
Zone string
The DNS name of this zone, e.g. “example.com.”. Must ends with dot.
CreatedAt string
(Computed) The DNS zone creation timestamp.
Description string
Description of the DNS zone.
FolderId string
ID of the folder to create a zone in. If it is not provided, the default provider folder is used.
Labels map[string]string
A set of key/value label pairs to assign to the DNS zone.
Name string
User assigned name of a specific resource. Must be unique within the folder.
PrivateNetworks []string
For privately visible zones, the set of Virtual Private Cloud resources that the zone is visible from.
Public bool
The zone’s visibility: public zones are exposed to the Internet, while private zones are visible only to Virtual Private Cloud resources.
Zone string
The DNS name of this zone, e.g. “example.com.”. Must ends with dot.
createdAt string
(Computed) The DNS zone creation timestamp.
description string
Description of the DNS zone.
folderId string
ID of the folder to create a zone in. If it is not provided, the default provider folder is used.
labels {[key: string]: string}
A set of key/value label pairs to assign to the DNS zone.
name string
User assigned name of a specific resource. Must be unique within the folder.
privateNetworks string[]
For privately visible zones, the set of Virtual Private Cloud resources that the zone is visible from.
public boolean
The zone’s visibility: public zones are exposed to the Internet, while private zones are visible only to Virtual Private Cloud resources.
zone string
The DNS name of this zone, e.g. “example.com.”. Must ends with dot.
created_at str
(Computed) The DNS zone creation timestamp.
description str
Description of the DNS zone.
folder_id str
ID of the folder to create a zone in. If it is not provided, the default provider folder is used.
labels Mapping[str, str]
A set of key/value label pairs to assign to the DNS zone.
name str
User assigned name of a specific resource. Must be unique within the folder.
private_networks Sequence[str]
For privately visible zones, the set of Virtual Private Cloud resources that the zone is visible from.
public bool
The zone’s visibility: public zones are exposed to the Internet, while private zones are visible only to Virtual Private Cloud resources.
zone str
The DNS name of this zone, e.g. “example.com.”. Must ends with dot.

Package Details

Repository
https://github.com/pulumi/pulumi-yandex
License
Apache-2.0
Notes
This Pulumi package is based on the yandex Terraform Provider.