Creates and manages a private DNS zone and its record sets using public API v1. For more information about private DNS, see the official Selectel documentation.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as selectel from "@pulumi/selectel";
const zone1 = new selectel.PrivateDnsZoneV1("zone_1", {
region: "ru-1",
projectId: project1.id,
domain: "example.com.",
records: [{
domain: "sub.example.com.",
type: "A",
values: ["192.168.0.2"],
}],
});
import pulumi
import pulumi_selectel as selectel
zone1 = selectel.PrivateDnsZoneV1("zone_1",
region="ru-1",
project_id=project1["id"],
domain="example.com.",
records=[{
"domain": "sub.example.com.",
"type": "A",
"values": ["192.168.0.2"],
}])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/selectel/v7/selectel"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := selectel.NewPrivateDnsZoneV1(ctx, "zone_1", &selectel.PrivateDnsZoneV1Args{
Region: pulumi.String("ru-1"),
ProjectId: pulumi.Any(project1.Id),
Domain: pulumi.String("example.com."),
Records: selectel.PrivateDnsZoneV1RecordArray{
&selectel.PrivateDnsZoneV1RecordArgs{
Domain: pulumi.String("sub.example.com."),
Type: pulumi.String("A"),
Values: pulumi.StringArray{
pulumi.String("192.168.0.2"),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Selectel = Pulumi.Selectel;
return await Deployment.RunAsync(() =>
{
var zone1 = new Selectel.PrivateDnsZoneV1("zone_1", new()
{
Region = "ru-1",
ProjectId = project1.Id,
Domain = "example.com.",
Records = new[]
{
new Selectel.Inputs.PrivateDnsZoneV1RecordArgs
{
Domain = "sub.example.com.",
Type = "A",
Values = new[]
{
"192.168.0.2",
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.selectel.PrivateDnsZoneV1;
import com.pulumi.selectel.PrivateDnsZoneV1Args;
import com.pulumi.selectel.inputs.PrivateDnsZoneV1RecordArgs;
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 zone1 = new PrivateDnsZoneV1("zone1", PrivateDnsZoneV1Args.builder()
.region("ru-1")
.projectId(project1.id())
.domain("example.com.")
.records(PrivateDnsZoneV1RecordArgs.builder()
.domain("sub.example.com.")
.type("A")
.values("192.168.0.2")
.build())
.build());
}
}
resources:
zone1:
type: selectel:PrivateDnsZoneV1
name: zone_1
properties:
region: ru-1
projectId: ${project1.id}
domain: example.com.
records:
- domain: sub.example.com.
type: A
values:
- 192.168.0.2
Create PrivateDnsZoneV1 Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PrivateDnsZoneV1(name: string, args: PrivateDnsZoneV1Args, opts?: CustomResourceOptions);@overload
def PrivateDnsZoneV1(resource_name: str,
args: PrivateDnsZoneV1Args,
opts: Optional[ResourceOptions] = None)
@overload
def PrivateDnsZoneV1(resource_name: str,
opts: Optional[ResourceOptions] = None,
domain: Optional[str] = None,
project_id: Optional[str] = None,
region: Optional[str] = None,
private_dns_zone_v1_id: Optional[str] = None,
records: Optional[Sequence[PrivateDnsZoneV1RecordArgs]] = None,
ttl: Optional[float] = None)func NewPrivateDnsZoneV1(ctx *Context, name string, args PrivateDnsZoneV1Args, opts ...ResourceOption) (*PrivateDnsZoneV1, error)public PrivateDnsZoneV1(string name, PrivateDnsZoneV1Args args, CustomResourceOptions? opts = null)
public PrivateDnsZoneV1(String name, PrivateDnsZoneV1Args args)
public PrivateDnsZoneV1(String name, PrivateDnsZoneV1Args args, CustomResourceOptions options)
type: selectel:PrivateDnsZoneV1
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 PrivateDnsZoneV1Args
- 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 PrivateDnsZoneV1Args
- 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 PrivateDnsZoneV1Args
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PrivateDnsZoneV1Args
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PrivateDnsZoneV1Args
- 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 privateDnsZoneV1Resource = new Selectel.PrivateDnsZoneV1("privateDnsZoneV1Resource", new()
{
Domain = "string",
ProjectId = "string",
Region = "string",
PrivateDnsZoneV1Id = "string",
Records = new[]
{
new Selectel.Inputs.PrivateDnsZoneV1RecordArgs
{
Domain = "string",
Type = "string",
Values = new[]
{
"string",
},
Ttl = 0,
},
},
Ttl = 0,
});
example, err := selectel.NewPrivateDnsZoneV1(ctx, "privateDnsZoneV1Resource", &selectel.PrivateDnsZoneV1Args{
Domain: pulumi.String("string"),
ProjectId: pulumi.String("string"),
Region: pulumi.String("string"),
PrivateDnsZoneV1Id: pulumi.String("string"),
Records: selectel.PrivateDnsZoneV1RecordArray{
&selectel.PrivateDnsZoneV1RecordArgs{
Domain: pulumi.String("string"),
Type: pulumi.String("string"),
Values: pulumi.StringArray{
pulumi.String("string"),
},
Ttl: pulumi.Float64(0),
},
},
Ttl: pulumi.Float64(0),
})
var privateDnsZoneV1Resource = new PrivateDnsZoneV1("privateDnsZoneV1Resource", PrivateDnsZoneV1Args.builder()
.domain("string")
.projectId("string")
.region("string")
.privateDnsZoneV1Id("string")
.records(PrivateDnsZoneV1RecordArgs.builder()
.domain("string")
.type("string")
.values("string")
.ttl(0.0)
.build())
.ttl(0.0)
.build());
private_dns_zone_v1_resource = selectel.PrivateDnsZoneV1("privateDnsZoneV1Resource",
domain="string",
project_id="string",
region="string",
private_dns_zone_v1_id="string",
records=[{
"domain": "string",
"type": "string",
"values": ["string"],
"ttl": 0,
}],
ttl=0)
const privateDnsZoneV1Resource = new selectel.PrivateDnsZoneV1("privateDnsZoneV1Resource", {
domain: "string",
projectId: "string",
region: "string",
privateDnsZoneV1Id: "string",
records: [{
domain: "string",
type: "string",
values: ["string"],
ttl: 0,
}],
ttl: 0,
});
type: selectel:PrivateDnsZoneV1
properties:
domain: string
privateDnsZoneV1Id: string
projectId: string
records:
- domain: string
ttl: 0
type: string
values:
- string
region: string
ttl: 0
PrivateDnsZoneV1 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 PrivateDnsZoneV1 resource accepts the following input properties:
- Domain string
- DNS zone domain (domain name), must be an FQDN.
- Project
Id string - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- Region string
- Pool where the DNS zone is located, for example,
ru-3. Learn more about available pools in the Availability matrix. - Private
Dns stringZone V1Id - Records
List<Private
Dns Zone V1Record> - List of the zone record sets:
- Ttl double
- Time to live in seconds for the zone, default value is 3600.
- Domain string
- DNS zone domain (domain name), must be an FQDN.
- Project
Id string - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- Region string
- Pool where the DNS zone is located, for example,
ru-3. Learn more about available pools in the Availability matrix. - Private
Dns stringZone V1Id - Records
[]Private
Dns Zone V1Record Args - List of the zone record sets:
- Ttl float64
- Time to live in seconds for the zone, default value is 3600.
- domain String
- DNS zone domain (domain name), must be an FQDN.
- project
Id String - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- region String
- Pool where the DNS zone is located, for example,
ru-3. Learn more about available pools in the Availability matrix. - private
Dns StringZone V1Id - records
List<Private
Dns Zone V1Record> - List of the zone record sets:
- ttl Double
- Time to live in seconds for the zone, default value is 3600.
- domain string
- DNS zone domain (domain name), must be an FQDN.
- project
Id string - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- region string
- Pool where the DNS zone is located, for example,
ru-3. Learn more about available pools in the Availability matrix. - private
Dns stringZone V1Id - records
Private
Dns Zone V1Record[] - List of the zone record sets:
- ttl number
- Time to live in seconds for the zone, default value is 3600.
- domain str
- DNS zone domain (domain name), must be an FQDN.
- project_
id str - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- region str
- Pool where the DNS zone is located, for example,
ru-3. Learn more about available pools in the Availability matrix. - private_
dns_ strzone_ v1_ id - records
Sequence[Private
Dns Zone V1Record Args] - List of the zone record sets:
- ttl float
- Time to live in seconds for the zone, default value is 3600.
- domain String
- DNS zone domain (domain name), must be an FQDN.
- project
Id String - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- region String
- Pool where the DNS zone is located, for example,
ru-3. Learn more about available pools in the Availability matrix. - private
Dns StringZone V1Id - records List<Property Map>
- List of the zone record sets:
- ttl Number
- Time to live in seconds for the zone, default value is 3600.
Outputs
All input properties are implicitly available as output properties. Additionally, the PrivateDnsZoneV1 resource produces the following output properties:
- Bindings
List<Private
Dns Zone V1Binding> - Id string
- The provider-assigned unique ID for this managed resource.
- Serial
Number double - Zone SOA serial number.
- Bindings
[]Private
Dns Zone V1Binding - Id string
- The provider-assigned unique ID for this managed resource.
- Serial
Number float64 - Zone SOA serial number.
- bindings
List<Private
Dns Zone V1Binding> - id String
- The provider-assigned unique ID for this managed resource.
- serial
Number Double - Zone SOA serial number.
- bindings
Private
Dns Zone V1Binding[] - id string
- The provider-assigned unique ID for this managed resource.
- serial
Number number - Zone SOA serial number.
- bindings
Sequence[Private
Dns Zone V1Binding] - id str
- The provider-assigned unique ID for this managed resource.
- serial_
number float - Zone SOA serial number.
- bindings List<Property Map>
- id String
- The provider-assigned unique ID for this managed resource.
- serial
Number Number - Zone SOA serial number.
Look up Existing PrivateDnsZoneV1 Resource
Get an existing PrivateDnsZoneV1 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?: PrivateDnsZoneV1State, opts?: CustomResourceOptions): PrivateDnsZoneV1@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
bindings: Optional[Sequence[PrivateDnsZoneV1BindingArgs]] = None,
domain: Optional[str] = None,
private_dns_zone_v1_id: Optional[str] = None,
project_id: Optional[str] = None,
records: Optional[Sequence[PrivateDnsZoneV1RecordArgs]] = None,
region: Optional[str] = None,
serial_number: Optional[float] = None,
ttl: Optional[float] = None) -> PrivateDnsZoneV1func GetPrivateDnsZoneV1(ctx *Context, name string, id IDInput, state *PrivateDnsZoneV1State, opts ...ResourceOption) (*PrivateDnsZoneV1, error)public static PrivateDnsZoneV1 Get(string name, Input<string> id, PrivateDnsZoneV1State? state, CustomResourceOptions? opts = null)public static PrivateDnsZoneV1 get(String name, Output<String> id, PrivateDnsZoneV1State state, CustomResourceOptions options)resources: _: type: selectel:PrivateDnsZoneV1 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.
- Bindings
List<Private
Dns Zone V1Binding> - Domain string
- DNS zone domain (domain name), must be an FQDN.
- Private
Dns stringZone V1Id - Project
Id string - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- Records
List<Private
Dns Zone V1Record> - List of the zone record sets:
- Region string
- Pool where the DNS zone is located, for example,
ru-3. Learn more about available pools in the Availability matrix. - Serial
Number double - Zone SOA serial number.
- Ttl double
- Time to live in seconds for the zone, default value is 3600.
- Bindings
[]Private
Dns Zone V1Binding Args - Domain string
- DNS zone domain (domain name), must be an FQDN.
- Private
Dns stringZone V1Id - Project
Id string - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- Records
[]Private
Dns Zone V1Record Args - List of the zone record sets:
- Region string
- Pool where the DNS zone is located, for example,
ru-3. Learn more about available pools in the Availability matrix. - Serial
Number float64 - Zone SOA serial number.
- Ttl float64
- Time to live in seconds for the zone, default value is 3600.
- bindings
List<Private
Dns Zone V1Binding> - domain String
- DNS zone domain (domain name), must be an FQDN.
- private
Dns StringZone V1Id - project
Id String - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- records
List<Private
Dns Zone V1Record> - List of the zone record sets:
- region String
- Pool where the DNS zone is located, for example,
ru-3. Learn more about available pools in the Availability matrix. - serial
Number Double - Zone SOA serial number.
- ttl Double
- Time to live in seconds for the zone, default value is 3600.
- bindings
Private
Dns Zone V1Binding[] - domain string
- DNS zone domain (domain name), must be an FQDN.
- private
Dns stringZone V1Id - project
Id string - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- records
Private
Dns Zone V1Record[] - List of the zone record sets:
- region string
- Pool where the DNS zone is located, for example,
ru-3. Learn more about available pools in the Availability matrix. - serial
Number number - Zone SOA serial number.
- ttl number
- Time to live in seconds for the zone, default value is 3600.
- bindings
Sequence[Private
Dns Zone V1Binding Args] - domain str
- DNS zone domain (domain name), must be an FQDN.
- private_
dns_ strzone_ v1_ id - project_
id str - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- records
Sequence[Private
Dns Zone V1Record Args] - List of the zone record sets:
- region str
- Pool where the DNS zone is located, for example,
ru-3. Learn more about available pools in the Availability matrix. - serial_
number float - Zone SOA serial number.
- ttl float
- Time to live in seconds for the zone, default value is 3600.
- bindings List<Property Map>
- domain String
- DNS zone domain (domain name), must be an FQDN.
- private
Dns StringZone V1Id - project
Id String - Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- records List<Property Map>
- List of the zone record sets:
- region String
- Pool where the DNS zone is located, for example,
ru-3. Learn more about available pools in the Availability matrix. - serial
Number Number - Zone SOA serial number.
- ttl Number
- Time to live in seconds for the zone, default value is 3600.
Supporting Types
PrivateDnsZoneV1Binding, PrivateDnsZoneV1BindingArgs
- Resource
Id string - Resource
Type string
- Resource
Id string - Resource
Type string
- resource
Id String - resource
Type String
- resource
Id string - resource
Type string
- resource_
id str - resource_
type str
- resource
Id String - resource
Type String
PrivateDnsZoneV1Record, PrivateDnsZoneV1RecordArgs
Package Details
- Repository
- selectel selectel/terraform-provider-selectel
- License
- Notes
- This Pulumi package is based on the
selectelTerraform Provider.
