ns1.Record
Explore with Pulumi AI
Provides a NS1 Record resource. This can be used to create, modify, and delete records.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as external from "@pulumi/external";
import * as ns1 from "@pulumi/ns1";
import * as std from "@pulumi/std";
const example = new ns1.Zone("example", {zone: "terraform.example.io"});
const ns1 = new ns1.DataSource("ns1", {
name: "ns1_source",
sourcetype: "nsone_v1",
});
const foo = new ns1.DataFeed("foo", {
name: "foo_feed",
sourceId: ns1.id,
config: {
label: "foo",
},
});
const bar = new ns1.DataFeed("bar", {
name: "bar_feed",
sourceId: ns1.id,
config: {
label: "bar",
},
});
const www = new ns1.Record("www", {
zone: tld.zone,
domain: `www.${tld.zone}`,
type: "CNAME",
ttl: 60,
meta: {
up: "true",
},
regions: [
{
name: "east",
meta: {
georegion: "US-EAST",
},
},
{
name: "usa",
meta: {
country: "US",
},
},
],
answers: [
{
answer: `sub1.${tld.zone}`,
region: "east",
meta: {
up: pulumi.interpolate`{"feed":"${foo.id}"}`,
},
},
{
answer: `sub2.${tld.zone}`,
meta: {
up: pulumi.interpolate`{"feed":"${bar.id}"}`,
connections: "3",
},
},
{
answer: `sub3.${tld.zone}`,
meta: {
pulsar: JSON.stringify([{
job_id: "abcdef",
bias: "*0.55",
a5m_cutoff: 0.9,
}]),
subdivisions: JSON.stringify({
BR: [
"SP",
"SC",
],
DZ: [
"01",
"02",
"03",
],
}),
},
},
],
filters: [{
filter: "select_first_n",
config: {
N: "1",
},
}],
});
// Some other non-NS1 provider that returns a zone with a trailing dot and a domain with a leading dot.
const baz = new external.index.Source("baz", {
zone: "terraform.example.io.",
domain: ".www.terraform.example.io",
});
// Basic record showing how to clean a zone or domain field that comes from
// another non-NS1 resource. DNS names often end in '.' characters to signify
// the root of the DNS tree, but the NS1 provider does not support this.
//
// In other cases, a domain or zone may be passed in with a preceding dot ('.')
// character which would likewise lead the system to fail.
const external = new ns1.Record("external", {
zone: std.replace({
text: zone,
search: "/(^\\.)|(\\.$)/",
replace: "",
}).then(invoke => invoke.result),
domain: std.replace({
text: domain,
search: "/(^\\.)|(\\.$)/",
replace: "",
}).then(invoke => invoke.result),
type: "CNAME",
});
import pulumi
import json
import pulumi_external as external
import pulumi_ns1 as ns1
import pulumi_std as std
example = ns1.Zone("example", zone="terraform.example.io")
ns1 = ns1.DataSource("ns1",
name="ns1_source",
sourcetype="nsone_v1")
foo = ns1.DataFeed("foo",
name="foo_feed",
source_id=ns1.id,
config={
"label": "foo",
})
bar = ns1.DataFeed("bar",
name="bar_feed",
source_id=ns1.id,
config={
"label": "bar",
})
www = ns1.Record("www",
zone=tld["zone"],
domain=f"www.{tld['zone']}",
type="CNAME",
ttl=60,
meta={
"up": "true",
},
regions=[
{
"name": "east",
"meta": {
"georegion": "US-EAST",
},
},
{
"name": "usa",
"meta": {
"country": "US",
},
},
],
answers=[
{
"answer": f"sub1.{tld['zone']}",
"region": "east",
"meta": {
"up": foo.id.apply(lambda id: f"{{\"feed\":\"{id}\"}}"),
},
},
{
"answer": f"sub2.{tld['zone']}",
"meta": {
"up": bar.id.apply(lambda id: f"{{\"feed\":\"{id}\"}}"),
"connections": "3",
},
},
{
"answer": f"sub3.{tld['zone']}",
"meta": {
"pulsar": json.dumps([{
"job_id": "abcdef",
"bias": "*0.55",
"a5m_cutoff": 0.9,
}]),
"subdivisions": json.dumps({
"br": [
"SP",
"SC",
],
"dz": [
"01",
"02",
"03",
],
}),
},
},
],
filters=[{
"filter": "select_first_n",
"config": {
"n": "1",
},
}])
# Some other non-NS1 provider that returns a zone with a trailing dot and a domain with a leading dot.
baz = external.index.Source("baz",
zone=terraform.example.io.,
domain=.www.terraform.example.io)
# Basic record showing how to clean a zone or domain field that comes from
# another non-NS1 resource. DNS names often end in '.' characters to signify
# the root of the DNS tree, but the NS1 provider does not support this.
#
# In other cases, a domain or zone may be passed in with a preceding dot ('.')
# character which would likewise lead the system to fail.
external = ns1.Record("external",
zone=std.replace(text=zone,
search="/(^\\.)|(\\.$)/",
replace="").result,
domain=std.replace(text=domain,
search="/(^\\.)|(\\.$)/",
replace="").result,
type="CNAME")
package main
import (
"encoding/json"
"fmt"
"github.com/pulumi/pulumi-external/sdk/go/external"
"github.com/pulumi/pulumi-ns1/sdk/v3/go/ns1"
"github.com/pulumi/pulumi-std/sdk/go/std"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ns1.NewZone(ctx, "example", &ns1.ZoneArgs{
Zone: pulumi.String("terraform.example.io"),
})
if err != nil {
return err
}
ns1, err := ns1.NewDataSource(ctx, "ns1", &ns1.DataSourceArgs{
Name: pulumi.String("ns1_source"),
Sourcetype: pulumi.String("nsone_v1"),
})
if err != nil {
return err
}
foo, err := ns1.NewDataFeed(ctx, "foo", &ns1.DataFeedArgs{
Name: pulumi.String("foo_feed"),
SourceId: ns1.ID(),
Config: pulumi.StringMap{
"label": pulumi.String("foo"),
},
})
if err != nil {
return err
}
bar, err := ns1.NewDataFeed(ctx, "bar", &ns1.DataFeedArgs{
Name: pulumi.String("bar_feed"),
SourceId: ns1.ID(),
Config: pulumi.StringMap{
"label": pulumi.String("bar"),
},
})
if err != nil {
return err
}
tmpJSON0, err := json.Marshal([]map[string]interface{}{
map[string]interface{}{
"job_id": "abcdef",
"bias": "*0.55",
"a5m_cutoff": 0.9,
},
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
tmpJSON1, err := json.Marshal(map[string]interface{}{
"BR": []string{
"SP",
"SC",
},
"DZ": []string{
"01",
"02",
"03",
},
})
if err != nil {
return err
}
json1 := string(tmpJSON1)
_, err = ns1.NewRecord(ctx, "www", &ns1.RecordArgs{
Zone: pulumi.Any(tld.Zone),
Domain: pulumi.Sprintf("www.%v", tld.Zone),
Type: pulumi.String("CNAME"),
Ttl: pulumi.Int(60),
Meta: pulumi.StringMap{
"up": pulumi.String("true"),
},
Regions: ns1.RecordRegionArray{
&ns1.RecordRegionArgs{
Name: pulumi.String("east"),
Meta: pulumi.StringMap{
"georegion": pulumi.String("US-EAST"),
},
},
&ns1.RecordRegionArgs{
Name: pulumi.String("usa"),
Meta: pulumi.StringMap{
"country": pulumi.String("US"),
},
},
},
Answers: ns1.RecordAnswerArray{
&ns1.RecordAnswerArgs{
Answer: pulumi.Sprintf("sub1.%v", tld.Zone),
Region: pulumi.String("east"),
Meta: pulumi.StringMap{
"up": foo.ID().ApplyT(func(id string) (string, error) {
return fmt.Sprintf("{\"feed\":\"%v\"}", id), nil
}).(pulumi.StringOutput),
},
},
&ns1.RecordAnswerArgs{
Answer: pulumi.Sprintf("sub2.%v", tld.Zone),
Meta: pulumi.StringMap{
"up": bar.ID().ApplyT(func(id string) (string, error) {
return fmt.Sprintf("{\"feed\":\"%v\"}", id), nil
}).(pulumi.StringOutput),
"connections": pulumi.String("3"),
},
},
&ns1.RecordAnswerArgs{
Answer: pulumi.Sprintf("sub3.%v", tld.Zone),
Meta: pulumi.StringMap{
"pulsar": pulumi.String(json0),
"subdivisions": pulumi.String(json1),
},
},
},
Filters: ns1.RecordFilterArray{
&ns1.RecordFilterArgs{
Filter: pulumi.String("select_first_n"),
Config: pulumi.StringMap{
"N": pulumi.String("1"),
},
},
},
})
if err != nil {
return err
}
// Some other non-NS1 provider that returns a zone with a trailing dot and a domain with a leading dot.
_, err = external.NewSource(ctx, "baz", &external.SourceArgs{
Zone: "terraform.example.io.",
Domain: ".www.terraform.example.io",
})
if err != nil {
return err
}
invokeReplace, err := std.Replace(ctx, &std.ReplaceArgs{
Text: zone,
Search: "/(^\\.)|(\\.$)/",
Replace: "",
}, nil)
if err != nil {
return err
}
invokeReplace1, err := std.Replace(ctx, &std.ReplaceArgs{
Text: domain,
Search: "/(^\\.)|(\\.$)/",
Replace: "",
}, nil)
if err != nil {
return err
}
// Basic record showing how to clean a zone or domain field that comes from
// another non-NS1 resource. DNS names often end in '.' characters to signify
// the root of the DNS tree, but the NS1 provider does not support this.
//
// In other cases, a domain or zone may be passed in with a preceding dot ('.')
// character which would likewise lead the system to fail.
_, err = ns1.NewRecord(ctx, "external", &ns1.RecordArgs{
Zone: pulumi.String(invokeReplace.Result),
Domain: pulumi.String(invokeReplace1.Result),
Type: pulumi.String("CNAME"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using External = Pulumi.External;
using Ns1 = Pulumi.Ns1;
using Std = Pulumi.Std;
return await Deployment.RunAsync(() =>
{
var example = new Ns1.Zone("example", new()
{
ZoneName = "terraform.example.io",
});
var ns1 = new Ns1.DataSource("ns1", new()
{
Name = "ns1_source",
Sourcetype = "nsone_v1",
});
var foo = new Ns1.DataFeed("foo", new()
{
Name = "foo_feed",
SourceId = ns1.Id,
Config =
{
{ "label", "foo" },
},
});
var bar = new Ns1.DataFeed("bar", new()
{
Name = "bar_feed",
SourceId = ns1.Id,
Config =
{
{ "label", "bar" },
},
});
var www = new Ns1.Record("www", new()
{
Zone = tld.Zone,
Domain = $"www.{tld.Zone}",
Type = "CNAME",
Ttl = 60,
Meta =
{
{ "up", "true" },
},
Regions = new[]
{
new Ns1.Inputs.RecordRegionArgs
{
Name = "east",
Meta =
{
{ "georegion", "US-EAST" },
},
},
new Ns1.Inputs.RecordRegionArgs
{
Name = "usa",
Meta =
{
{ "country", "US" },
},
},
},
Answers = new[]
{
new Ns1.Inputs.RecordAnswerArgs
{
Answer = $"sub1.{tld.Zone}",
Region = "east",
Meta =
{
{ "up", foo.Id.Apply(id => $"{{\"feed\":\"{id}\"}}") },
},
},
new Ns1.Inputs.RecordAnswerArgs
{
Answer = $"sub2.{tld.Zone}",
Meta =
{
{ "up", bar.Id.Apply(id => $"{{\"feed\":\"{id}\"}}") },
{ "connections", "3" },
},
},
new Ns1.Inputs.RecordAnswerArgs
{
Answer = $"sub3.{tld.Zone}",
Meta =
{
{ "pulsar", JsonSerializer.Serialize(new[]
{
new Dictionary<string, object?>
{
["job_id"] = "abcdef",
["bias"] = "*0.55",
["a5m_cutoff"] = 0.9,
},
}) },
{ "subdivisions", JsonSerializer.Serialize(new Dictionary<string, object?>
{
["BR"] = new[]
{
"SP",
"SC",
},
["DZ"] = new[]
{
"01",
"02",
"03",
},
}) },
},
},
},
Filters = new[]
{
new Ns1.Inputs.RecordFilterArgs
{
Filter = "select_first_n",
Config =
{
{ "N", "1" },
},
},
},
});
// Some other non-NS1 provider that returns a zone with a trailing dot and a domain with a leading dot.
var baz = new External.Index.Source("baz", new()
{
Zone = "terraform.example.io.",
Domain = ".www.terraform.example.io",
});
// Basic record showing how to clean a zone or domain field that comes from
// another non-NS1 resource. DNS names often end in '.' characters to signify
// the root of the DNS tree, but the NS1 provider does not support this.
//
// In other cases, a domain or zone may be passed in with a preceding dot ('.')
// character which would likewise lead the system to fail.
var external = new Ns1.Record("external", new()
{
Zone = Std.Replace.Invoke(new()
{
Text = zone,
Search = "/(^\\.)|(\\.$)/",
Replace = "",
}).Apply(invoke => invoke.Result),
Domain = Std.Replace.Invoke(new()
{
Text = domain,
Search = "/(^\\.)|(\\.$)/",
Replace = "",
}).Apply(invoke => invoke.Result),
Type = "CNAME",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ns1.Zone;
import com.pulumi.ns1.ZoneArgs;
import com.pulumi.ns1.DataSource;
import com.pulumi.ns1.DataSourceArgs;
import com.pulumi.ns1.DataFeed;
import com.pulumi.ns1.DataFeedArgs;
import com.pulumi.ns1.Record;
import com.pulumi.ns1.RecordArgs;
import com.pulumi.ns1.inputs.RecordRegionArgs;
import com.pulumi.ns1.inputs.RecordAnswerArgs;
import com.pulumi.ns1.inputs.RecordFilterArgs;
import com.pulumi.external.source;
import com.pulumi.external.SourceArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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 Zone("example", ZoneArgs.builder()
.zone("terraform.example.io")
.build());
var ns1 = new DataSource("ns1", DataSourceArgs.builder()
.name("ns1_source")
.sourcetype("nsone_v1")
.build());
var foo = new DataFeed("foo", DataFeedArgs.builder()
.name("foo_feed")
.sourceId(ns1.id())
.config(Map.of("label", "foo"))
.build());
var bar = new DataFeed("bar", DataFeedArgs.builder()
.name("bar_feed")
.sourceId(ns1.id())
.config(Map.of("label", "bar"))
.build());
var www = new Record("www", RecordArgs.builder()
.zone(tld.zone())
.domain(String.format("www.%s", tld.zone()))
.type("CNAME")
.ttl(60)
.meta(Map.of("up", true))
.regions(
RecordRegionArgs.builder()
.name("east")
.meta(Map.of("georegion", "US-EAST"))
.build(),
RecordRegionArgs.builder()
.name("usa")
.meta(Map.of("country", "US"))
.build())
.answers(
RecordAnswerArgs.builder()
.answer(String.format("sub1.%s", tld.zone()))
.region("east")
.meta(Map.of("up", foo.id().applyValue(id -> String.format("{{\"feed\":\"%s\"}}", id))))
.build(),
RecordAnswerArgs.builder()
.answer(String.format("sub2.%s", tld.zone()))
.meta(Map.ofEntries(
Map.entry("up", bar.id().applyValue(id -> String.format("{{\"feed\":\"%s\"}}", id))),
Map.entry("connections", 3)
))
.build(),
RecordAnswerArgs.builder()
.answer(String.format("sub3.%s", tld.zone()))
.meta(Map.ofEntries(
Map.entry("pulsar", serializeJson(
jsonArray(jsonObject(
jsonProperty("job_id", "abcdef"),
jsonProperty("bias", "*0.55"),
jsonProperty("a5m_cutoff", 0.9)
)))),
Map.entry("subdivisions", serializeJson(
jsonObject(
jsonProperty("BR", jsonArray(
"SP",
"SC"
)),
jsonProperty("DZ", jsonArray(
"01",
"02",
"03"
))
)))
))
.build())
.filters(RecordFilterArgs.builder()
.filter("select_first_n")
.config(Map.of("N", 1))
.build())
.build());
// Some other non-NS1 provider that returns a zone with a trailing dot and a domain with a leading dot.
var baz = new Source("baz", SourceArgs.builder()
.zone("terraform.example.io.")
.domain(".www.terraform.example.io")
.build());
// Basic record showing how to clean a zone or domain field that comes from
// another non-NS1 resource. DNS names often end in '.' characters to signify
// the root of the DNS tree, but the NS1 provider does not support this.
//
// In other cases, a domain or zone may be passed in with a preceding dot ('.')
// character which would likewise lead the system to fail.
var external = new Record("external", RecordArgs.builder()
.zone(StdFunctions.replace(ReplaceArgs.builder()
.text(zone)
.search("/(^\\.)|(\\.$)/")
.replace("")
.build()).result())
.domain(StdFunctions.replace(ReplaceArgs.builder()
.text(domain)
.search("/(^\\.)|(\\.$)/")
.replace("")
.build()).result())
.type("CNAME")
.build());
}
}
resources:
example:
type: ns1:Zone
properties:
zone: terraform.example.io
ns1:
type: ns1:DataSource
properties:
name: ns1_source
sourcetype: nsone_v1
foo:
type: ns1:DataFeed
properties:
name: foo_feed
sourceId: ${ns1.id}
config:
label: foo
bar:
type: ns1:DataFeed
properties:
name: bar_feed
sourceId: ${ns1.id}
config:
label: bar
www:
type: ns1:Record
properties:
zone: ${tld.zone}
domain: www.${tld.zone}
type: CNAME
ttl: 60
meta:
up: true
regions:
- name: east
meta:
georegion: US-EAST
- name: usa
meta:
country: US
answers:
- answer: sub1.${tld.zone}
region: east
meta:
up: '{"feed":"${foo.id}"}'
- answer: sub2.${tld.zone}
meta:
up: '{"feed":"${bar.id}"}'
connections: 3
- answer: sub3.${tld.zone}
meta:
pulsar:
fn::toJSON:
- job_id: abcdef
bias: '*0.55'
a5m_cutoff: 0.9
subdivisions:
fn::toJSON:
BR:
- SP
- SC
DZ:
- '01'
- '02'
- '03'
filters:
- filter: select_first_n
config:
N: 1
# Some other non-NS1 provider that returns a zone with a trailing dot and a domain with a leading dot.
baz:
type: external:source
properties:
zone: terraform.example.io.
domain: .www.terraform.example.io
# Basic record showing how to clean a zone or domain field that comes from
# another non-NS1 resource. DNS names often end in '.' characters to signify
# the root of the DNS tree, but the NS1 provider does not support this.
#
# In other cases, a domain or zone may be passed in with a preceding dot ('.')
# character which would likewise lead the system to fail.
external:
type: ns1:Record
properties:
zone:
fn::invoke:
Function: std:replace
Arguments:
text: ${zone}
search: /(^\.)|(\.$)/
replace:
Return: result
domain:
fn::invoke:
Function: std:replace
Arguments:
text: ${domain}
search: /(^\.)|(\.$)/
replace:
Return: result
type: CNAME
NS1 Documentation
Create Record Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Record(name: string, args: RecordArgs, opts?: CustomResourceOptions);
@overload
def Record(resource_name: str,
args: RecordArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Record(resource_name: str,
opts: Optional[ResourceOptions] = None,
type: Optional[str] = None,
zone: Optional[str] = None,
domain: Optional[str] = None,
override_address_records: Optional[bool] = None,
link: Optional[str] = None,
meta: Optional[Mapping[str, str]] = None,
answers: Optional[Sequence[RecordAnswerArgs]] = None,
override_ttl: Optional[bool] = None,
regions: Optional[Sequence[RecordRegionArgs]] = None,
short_answers: Optional[Sequence[str]] = None,
tags: Optional[Mapping[str, str]] = None,
ttl: Optional[int] = None,
filters: Optional[Sequence[RecordFilterArgs]] = None,
use_client_subnet: Optional[bool] = None,
blocked_tags: Optional[Sequence[str]] = None)
func NewRecord(ctx *Context, name string, args RecordArgs, opts ...ResourceOption) (*Record, error)
public Record(string name, RecordArgs args, CustomResourceOptions? opts = null)
public Record(String name, RecordArgs args)
public Record(String name, RecordArgs args, CustomResourceOptions options)
type: ns1:Record
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 RecordArgs
- 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 RecordArgs
- 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 RecordArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RecordArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RecordArgs
- 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 recordResource = new Ns1.Record("recordResource", new()
{
Type = "string",
Zone = "string",
Domain = "string",
OverrideAddressRecords = false,
Link = "string",
Meta =
{
{ "string", "string" },
},
Answers = new[]
{
new Ns1.Inputs.RecordAnswerArgs
{
Answer = "string",
Meta =
{
{ "string", "string" },
},
Region = "string",
},
},
OverrideTtl = false,
Regions = new[]
{
new Ns1.Inputs.RecordRegionArgs
{
Name = "string",
Meta =
{
{ "string", "string" },
},
},
},
Tags =
{
{ "string", "string" },
},
Ttl = 0,
Filters = new[]
{
new Ns1.Inputs.RecordFilterArgs
{
Filter = "string",
Config =
{
{ "string", "string" },
},
Disabled = false,
},
},
UseClientSubnet = false,
BlockedTags = new[]
{
"string",
},
});
example, err := ns1.NewRecord(ctx, "recordResource", &ns1.RecordArgs{
Type: pulumi.String("string"),
Zone: pulumi.String("string"),
Domain: pulumi.String("string"),
OverrideAddressRecords: pulumi.Bool(false),
Link: pulumi.String("string"),
Meta: pulumi.StringMap{
"string": pulumi.String("string"),
},
Answers: ns1.RecordAnswerArray{
&ns1.RecordAnswerArgs{
Answer: pulumi.String("string"),
Meta: pulumi.StringMap{
"string": pulumi.String("string"),
},
Region: pulumi.String("string"),
},
},
OverrideTtl: pulumi.Bool(false),
Regions: ns1.RecordRegionArray{
&ns1.RecordRegionArgs{
Name: pulumi.String("string"),
Meta: pulumi.StringMap{
"string": pulumi.String("string"),
},
},
},
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
Ttl: pulumi.Int(0),
Filters: ns1.RecordFilterArray{
&ns1.RecordFilterArgs{
Filter: pulumi.String("string"),
Config: pulumi.StringMap{
"string": pulumi.String("string"),
},
Disabled: pulumi.Bool(false),
},
},
UseClientSubnet: pulumi.Bool(false),
BlockedTags: pulumi.StringArray{
pulumi.String("string"),
},
})
var recordResource = new Record("recordResource", RecordArgs.builder()
.type("string")
.zone("string")
.domain("string")
.overrideAddressRecords(false)
.link("string")
.meta(Map.of("string", "string"))
.answers(RecordAnswerArgs.builder()
.answer("string")
.meta(Map.of("string", "string"))
.region("string")
.build())
.overrideTtl(false)
.regions(RecordRegionArgs.builder()
.name("string")
.meta(Map.of("string", "string"))
.build())
.tags(Map.of("string", "string"))
.ttl(0)
.filters(RecordFilterArgs.builder()
.filter("string")
.config(Map.of("string", "string"))
.disabled(false)
.build())
.useClientSubnet(false)
.blockedTags("string")
.build());
record_resource = ns1.Record("recordResource",
type="string",
zone="string",
domain="string",
override_address_records=False,
link="string",
meta={
"string": "string",
},
answers=[{
"answer": "string",
"meta": {
"string": "string",
},
"region": "string",
}],
override_ttl=False,
regions=[{
"name": "string",
"meta": {
"string": "string",
},
}],
tags={
"string": "string",
},
ttl=0,
filters=[{
"filter": "string",
"config": {
"string": "string",
},
"disabled": False,
}],
use_client_subnet=False,
blocked_tags=["string"])
const recordResource = new ns1.Record("recordResource", {
type: "string",
zone: "string",
domain: "string",
overrideAddressRecords: false,
link: "string",
meta: {
string: "string",
},
answers: [{
answer: "string",
meta: {
string: "string",
},
region: "string",
}],
overrideTtl: false,
regions: [{
name: "string",
meta: {
string: "string",
},
}],
tags: {
string: "string",
},
ttl: 0,
filters: [{
filter: "string",
config: {
string: "string",
},
disabled: false,
}],
useClientSubnet: false,
blockedTags: ["string"],
});
type: ns1:Record
properties:
answers:
- answer: string
meta:
string: string
region: string
blockedTags:
- string
domain: string
filters:
- config:
string: string
disabled: false
filter: string
link: string
meta:
string: string
overrideAddressRecords: false
overrideTtl: false
regions:
- meta:
string: string
name: string
tags:
string: string
ttl: 0
type: string
useClientSubnet: false
zone: string
Record 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 Record resource accepts the following input properties:
- Domain string
- The records' domain. Cannot have leading or trailing
dots - see the example above and
FQDN formatting
below. - Type string
- The records' RR type.
- Zone string
- The zone the record belongs to. Cannot have leading or
trailing dots (".") - see the example above and
FQDN formatting
below. - Answers
List<Record
Answer> - One or more NS1 answers for the records' specified type. Answers are documented below.
- List<string>
- Filters
List<Record
Filter> - One or more NS1 filters for the record(order matters). Filters are documented below.
- Link string
- The target record to link to. This means this record is a 'linked' record, and it inherits all properties from its target.
- Meta Dictionary<string, string>
- Override
Address boolRecords - Override
Ttl bool - Regions
List<Record
Region> - One or more "regions" for the record. These are really
just groupings based on metadata, and are called "Answer Groups" in the NS1 UI,
but remain
regions
here for legacy reasons. Regions are documented below. Please note the ordering requirement! - Short
Answers List<string> - Dictionary<string, string>
- map of tags in the form of
"key" = "value"
where both key and value are strings - Ttl int
- The records' time to live (in seconds).
- Use
Client boolSubnet - Whether to use EDNS client subnet data when
available(in filter chain).
meta
- (Optional) meta is supported at therecord
level. Meta is documented below.
- Domain string
- The records' domain. Cannot have leading or trailing
dots - see the example above and
FQDN formatting
below. - Type string
- The records' RR type.
- Zone string
- The zone the record belongs to. Cannot have leading or
trailing dots (".") - see the example above and
FQDN formatting
below. - Answers
[]Record
Answer Args - One or more NS1 answers for the records' specified type. Answers are documented below.
- []string
- Filters
[]Record
Filter Args - One or more NS1 filters for the record(order matters). Filters are documented below.
- Link string
- The target record to link to. This means this record is a 'linked' record, and it inherits all properties from its target.
- Meta map[string]string
- Override
Address boolRecords - Override
Ttl bool - Regions
[]Record
Region Args - One or more "regions" for the record. These are really
just groupings based on metadata, and are called "Answer Groups" in the NS1 UI,
but remain
regions
here for legacy reasons. Regions are documented below. Please note the ordering requirement! - Short
Answers []string - map[string]string
- map of tags in the form of
"key" = "value"
where both key and value are strings - Ttl int
- The records' time to live (in seconds).
- Use
Client boolSubnet - Whether to use EDNS client subnet data when
available(in filter chain).
meta
- (Optional) meta is supported at therecord
level. Meta is documented below.
- domain String
- The records' domain. Cannot have leading or trailing
dots - see the example above and
FQDN formatting
below. - type String
- The records' RR type.
- zone String
- The zone the record belongs to. Cannot have leading or
trailing dots (".") - see the example above and
FQDN formatting
below. - answers
List<Record
Answer> - One or more NS1 answers for the records' specified type. Answers are documented below.
- List<String>
- filters
List<Record
Filter> - One or more NS1 filters for the record(order matters). Filters are documented below.
- link String
- The target record to link to. This means this record is a 'linked' record, and it inherits all properties from its target.
- meta Map<String,String>
- override
Address BooleanRecords - override
Ttl Boolean - regions
List<Record
Region> - One or more "regions" for the record. These are really
just groupings based on metadata, and are called "Answer Groups" in the NS1 UI,
but remain
regions
here for legacy reasons. Regions are documented below. Please note the ordering requirement! - short
Answers List<String> - Map<String,String>
- map of tags in the form of
"key" = "value"
where both key and value are strings - ttl Integer
- The records' time to live (in seconds).
- use
Client BooleanSubnet - Whether to use EDNS client subnet data when
available(in filter chain).
meta
- (Optional) meta is supported at therecord
level. Meta is documented below.
- domain string
- The records' domain. Cannot have leading or trailing
dots - see the example above and
FQDN formatting
below. - type string
- The records' RR type.
- zone string
- The zone the record belongs to. Cannot have leading or
trailing dots (".") - see the example above and
FQDN formatting
below. - answers
Record
Answer[] - One or more NS1 answers for the records' specified type. Answers are documented below.
- string[]
- filters
Record
Filter[] - One or more NS1 filters for the record(order matters). Filters are documented below.
- link string
- The target record to link to. This means this record is a 'linked' record, and it inherits all properties from its target.
- meta {[key: string]: string}
- override
Address booleanRecords - override
Ttl boolean - regions
Record
Region[] - One or more "regions" for the record. These are really
just groupings based on metadata, and are called "Answer Groups" in the NS1 UI,
but remain
regions
here for legacy reasons. Regions are documented below. Please note the ordering requirement! - short
Answers string[] - {[key: string]: string}
- map of tags in the form of
"key" = "value"
where both key and value are strings - ttl number
- The records' time to live (in seconds).
- use
Client booleanSubnet - Whether to use EDNS client subnet data when
available(in filter chain).
meta
- (Optional) meta is supported at therecord
level. Meta is documented below.
- domain str
- The records' domain. Cannot have leading or trailing
dots - see the example above and
FQDN formatting
below. - type str
- The records' RR type.
- zone str
- The zone the record belongs to. Cannot have leading or
trailing dots (".") - see the example above and
FQDN formatting
below. - answers
Sequence[Record
Answer Args] - One or more NS1 answers for the records' specified type. Answers are documented below.
- Sequence[str]
- filters
Sequence[Record
Filter Args] - One or more NS1 filters for the record(order matters). Filters are documented below.
- link str
- The target record to link to. This means this record is a 'linked' record, and it inherits all properties from its target.
- meta Mapping[str, str]
- override_
address_ boolrecords - override_
ttl bool - regions
Sequence[Record
Region Args] - One or more "regions" for the record. These are really
just groupings based on metadata, and are called "Answer Groups" in the NS1 UI,
but remain
regions
here for legacy reasons. Regions are documented below. Please note the ordering requirement! - short_
answers Sequence[str] - Mapping[str, str]
- map of tags in the form of
"key" = "value"
where both key and value are strings - ttl int
- The records' time to live (in seconds).
- use_
client_ boolsubnet - Whether to use EDNS client subnet data when
available(in filter chain).
meta
- (Optional) meta is supported at therecord
level. Meta is documented below.
- domain String
- The records' domain. Cannot have leading or trailing
dots - see the example above and
FQDN formatting
below. - type String
- The records' RR type.
- zone String
- The zone the record belongs to. Cannot have leading or
trailing dots (".") - see the example above and
FQDN formatting
below. - answers List<Property Map>
- One or more NS1 answers for the records' specified type. Answers are documented below.
- List<String>
- filters List<Property Map>
- One or more NS1 filters for the record(order matters). Filters are documented below.
- link String
- The target record to link to. This means this record is a 'linked' record, and it inherits all properties from its target.
- meta Map<String>
- override
Address BooleanRecords - override
Ttl Boolean - regions List<Property Map>
- One or more "regions" for the record. These are really
just groupings based on metadata, and are called "Answer Groups" in the NS1 UI,
but remain
regions
here for legacy reasons. Regions are documented below. Please note the ordering requirement! - short
Answers List<String> - Map<String>
- map of tags in the form of
"key" = "value"
where both key and value are strings - ttl Number
- The records' time to live (in seconds).
- use
Client BooleanSubnet - Whether to use EDNS client subnet data when
available(in filter chain).
meta
- (Optional) meta is supported at therecord
level. Meta is documented below.
Outputs
All input properties are implicitly available as output properties. Additionally, the Record 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 Record Resource
Get an existing Record 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?: RecordState, opts?: CustomResourceOptions): Record
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
answers: Optional[Sequence[RecordAnswerArgs]] = None,
blocked_tags: Optional[Sequence[str]] = None,
domain: Optional[str] = None,
filters: Optional[Sequence[RecordFilterArgs]] = None,
link: Optional[str] = None,
meta: Optional[Mapping[str, str]] = None,
override_address_records: Optional[bool] = None,
override_ttl: Optional[bool] = None,
regions: Optional[Sequence[RecordRegionArgs]] = None,
short_answers: Optional[Sequence[str]] = None,
tags: Optional[Mapping[str, str]] = None,
ttl: Optional[int] = None,
type: Optional[str] = None,
use_client_subnet: Optional[bool] = None,
zone: Optional[str] = None) -> Record
func GetRecord(ctx *Context, name string, id IDInput, state *RecordState, opts ...ResourceOption) (*Record, error)
public static Record Get(string name, Input<string> id, RecordState? state, CustomResourceOptions? opts = null)
public static Record get(String name, Output<String> id, RecordState 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.
- Answers
List<Record
Answer> - One or more NS1 answers for the records' specified type. Answers are documented below.
- List<string>
- Domain string
- The records' domain. Cannot have leading or trailing
dots - see the example above and
FQDN formatting
below. - Filters
List<Record
Filter> - One or more NS1 filters for the record(order matters). Filters are documented below.
- Link string
- The target record to link to. This means this record is a 'linked' record, and it inherits all properties from its target.
- Meta Dictionary<string, string>
- Override
Address boolRecords - Override
Ttl bool - Regions
List<Record
Region> - One or more "regions" for the record. These are really
just groupings based on metadata, and are called "Answer Groups" in the NS1 UI,
but remain
regions
here for legacy reasons. Regions are documented below. Please note the ordering requirement! - Short
Answers List<string> - Dictionary<string, string>
- map of tags in the form of
"key" = "value"
where both key and value are strings - Ttl int
- The records' time to live (in seconds).
- Type string
- The records' RR type.
- Use
Client boolSubnet - Whether to use EDNS client subnet data when
available(in filter chain).
meta
- (Optional) meta is supported at therecord
level. Meta is documented below.
- Zone string
- The zone the record belongs to. Cannot have leading or
trailing dots (".") - see the example above and
FQDN formatting
below.
- Answers
[]Record
Answer Args - One or more NS1 answers for the records' specified type. Answers are documented below.
- []string
- Domain string
- The records' domain. Cannot have leading or trailing
dots - see the example above and
FQDN formatting
below. - Filters
[]Record
Filter Args - One or more NS1 filters for the record(order matters). Filters are documented below.
- Link string
- The target record to link to. This means this record is a 'linked' record, and it inherits all properties from its target.
- Meta map[string]string
- Override
Address boolRecords - Override
Ttl bool - Regions
[]Record
Region Args - One or more "regions" for the record. These are really
just groupings based on metadata, and are called "Answer Groups" in the NS1 UI,
but remain
regions
here for legacy reasons. Regions are documented below. Please note the ordering requirement! - Short
Answers []string - map[string]string
- map of tags in the form of
"key" = "value"
where both key and value are strings - Ttl int
- The records' time to live (in seconds).
- Type string
- The records' RR type.
- Use
Client boolSubnet - Whether to use EDNS client subnet data when
available(in filter chain).
meta
- (Optional) meta is supported at therecord
level. Meta is documented below.
- Zone string
- The zone the record belongs to. Cannot have leading or
trailing dots (".") - see the example above and
FQDN formatting
below.
- answers
List<Record
Answer> - One or more NS1 answers for the records' specified type. Answers are documented below.
- List<String>
- domain String
- The records' domain. Cannot have leading or trailing
dots - see the example above and
FQDN formatting
below. - filters
List<Record
Filter> - One or more NS1 filters for the record(order matters). Filters are documented below.
- link String
- The target record to link to. This means this record is a 'linked' record, and it inherits all properties from its target.
- meta Map<String,String>
- override
Address BooleanRecords - override
Ttl Boolean - regions
List<Record
Region> - One or more "regions" for the record. These are really
just groupings based on metadata, and are called "Answer Groups" in the NS1 UI,
but remain
regions
here for legacy reasons. Regions are documented below. Please note the ordering requirement! - short
Answers List<String> - Map<String,String>
- map of tags in the form of
"key" = "value"
where both key and value are strings - ttl Integer
- The records' time to live (in seconds).
- type String
- The records' RR type.
- use
Client BooleanSubnet - Whether to use EDNS client subnet data when
available(in filter chain).
meta
- (Optional) meta is supported at therecord
level. Meta is documented below.
- zone String
- The zone the record belongs to. Cannot have leading or
trailing dots (".") - see the example above and
FQDN formatting
below.
- answers
Record
Answer[] - One or more NS1 answers for the records' specified type. Answers are documented below.
- string[]
- domain string
- The records' domain. Cannot have leading or trailing
dots - see the example above and
FQDN formatting
below. - filters
Record
Filter[] - One or more NS1 filters for the record(order matters). Filters are documented below.
- link string
- The target record to link to. This means this record is a 'linked' record, and it inherits all properties from its target.
- meta {[key: string]: string}
- override
Address booleanRecords - override
Ttl boolean - regions
Record
Region[] - One or more "regions" for the record. These are really
just groupings based on metadata, and are called "Answer Groups" in the NS1 UI,
but remain
regions
here for legacy reasons. Regions are documented below. Please note the ordering requirement! - short
Answers string[] - {[key: string]: string}
- map of tags in the form of
"key" = "value"
where both key and value are strings - ttl number
- The records' time to live (in seconds).
- type string
- The records' RR type.
- use
Client booleanSubnet - Whether to use EDNS client subnet data when
available(in filter chain).
meta
- (Optional) meta is supported at therecord
level. Meta is documented below.
- zone string
- The zone the record belongs to. Cannot have leading or
trailing dots (".") - see the example above and
FQDN formatting
below.
- answers
Sequence[Record
Answer Args] - One or more NS1 answers for the records' specified type. Answers are documented below.
- Sequence[str]
- domain str
- The records' domain. Cannot have leading or trailing
dots - see the example above and
FQDN formatting
below. - filters
Sequence[Record
Filter Args] - One or more NS1 filters for the record(order matters). Filters are documented below.
- link str
- The target record to link to. This means this record is a 'linked' record, and it inherits all properties from its target.
- meta Mapping[str, str]
- override_
address_ boolrecords - override_
ttl bool - regions
Sequence[Record
Region Args] - One or more "regions" for the record. These are really
just groupings based on metadata, and are called "Answer Groups" in the NS1 UI,
but remain
regions
here for legacy reasons. Regions are documented below. Please note the ordering requirement! - short_
answers Sequence[str] - Mapping[str, str]
- map of tags in the form of
"key" = "value"
where both key and value are strings - ttl int
- The records' time to live (in seconds).
- type str
- The records' RR type.
- use_
client_ boolsubnet - Whether to use EDNS client subnet data when
available(in filter chain).
meta
- (Optional) meta is supported at therecord
level. Meta is documented below.
- zone str
- The zone the record belongs to. Cannot have leading or
trailing dots (".") - see the example above and
FQDN formatting
below.
- answers List<Property Map>
- One or more NS1 answers for the records' specified type. Answers are documented below.
- List<String>
- domain String
- The records' domain. Cannot have leading or trailing
dots - see the example above and
FQDN formatting
below. - filters List<Property Map>
- One or more NS1 filters for the record(order matters). Filters are documented below.
- link String
- The target record to link to. This means this record is a 'linked' record, and it inherits all properties from its target.
- meta Map<String>
- override
Address BooleanRecords - override
Ttl Boolean - regions List<Property Map>
- One or more "regions" for the record. These are really
just groupings based on metadata, and are called "Answer Groups" in the NS1 UI,
but remain
regions
here for legacy reasons. Regions are documented below. Please note the ordering requirement! - short
Answers List<String> - Map<String>
- map of tags in the form of
"key" = "value"
where both key and value are strings - ttl Number
- The records' time to live (in seconds).
- type String
- The records' RR type.
- use
Client BooleanSubnet - Whether to use EDNS client subnet data when
available(in filter chain).
meta
- (Optional) meta is supported at therecord
level. Meta is documented below.
- zone String
- The zone the record belongs to. Cannot have leading or
trailing dots (".") - see the example above and
FQDN formatting
below.
Supporting Types
RecordAnswer, RecordAnswerArgs
- Answer string
Space delimited string of RDATA fields dependent on the record type.
A:
answer = "1.2.3.4"
CNAME:
answer = "www.example.com"
MX:
answer = "5 mail.example.com"
SRV:
answer = "10 0 2380 node-1.example.com"
SPF:
answer = "v=DKIM1; k=rsa; p=XXXXXXXX"
- Meta Dictionary<string, string>
- Region string
- The region (Answer Group really) that this answer
belongs to. This should be one of the names specified in
regions
. Only a singleregion
per answer is currently supported. If you want an answer in multiple regions, duplicating the answer (including metadata) is the correct approach.meta
- (Optional) meta is supported at theanswer
level. Meta is documented below.
- Answer string
Space delimited string of RDATA fields dependent on the record type.
A:
answer = "1.2.3.4"
CNAME:
answer = "www.example.com"
MX:
answer = "5 mail.example.com"
SRV:
answer = "10 0 2380 node-1.example.com"
SPF:
answer = "v=DKIM1; k=rsa; p=XXXXXXXX"
- Meta map[string]string
- Region string
- The region (Answer Group really) that this answer
belongs to. This should be one of the names specified in
regions
. Only a singleregion
per answer is currently supported. If you want an answer in multiple regions, duplicating the answer (including metadata) is the correct approach.meta
- (Optional) meta is supported at theanswer
level. Meta is documented below.
- answer String
Space delimited string of RDATA fields dependent on the record type.
A:
answer = "1.2.3.4"
CNAME:
answer = "www.example.com"
MX:
answer = "5 mail.example.com"
SRV:
answer = "10 0 2380 node-1.example.com"
SPF:
answer = "v=DKIM1; k=rsa; p=XXXXXXXX"
- meta Map<String,String>
- region String
- The region (Answer Group really) that this answer
belongs to. This should be one of the names specified in
regions
. Only a singleregion
per answer is currently supported. If you want an answer in multiple regions, duplicating the answer (including metadata) is the correct approach.meta
- (Optional) meta is supported at theanswer
level. Meta is documented below.
- answer string
Space delimited string of RDATA fields dependent on the record type.
A:
answer = "1.2.3.4"
CNAME:
answer = "www.example.com"
MX:
answer = "5 mail.example.com"
SRV:
answer = "10 0 2380 node-1.example.com"
SPF:
answer = "v=DKIM1; k=rsa; p=XXXXXXXX"
- meta {[key: string]: string}
- region string
- The region (Answer Group really) that this answer
belongs to. This should be one of the names specified in
regions
. Only a singleregion
per answer is currently supported. If you want an answer in multiple regions, duplicating the answer (including metadata) is the correct approach.meta
- (Optional) meta is supported at theanswer
level. Meta is documented below.
- answer str
Space delimited string of RDATA fields dependent on the record type.
A:
answer = "1.2.3.4"
CNAME:
answer = "www.example.com"
MX:
answer = "5 mail.example.com"
SRV:
answer = "10 0 2380 node-1.example.com"
SPF:
answer = "v=DKIM1; k=rsa; p=XXXXXXXX"
- meta Mapping[str, str]
- region str
- The region (Answer Group really) that this answer
belongs to. This should be one of the names specified in
regions
. Only a singleregion
per answer is currently supported. If you want an answer in multiple regions, duplicating the answer (including metadata) is the correct approach.meta
- (Optional) meta is supported at theanswer
level. Meta is documented below.
- answer String
Space delimited string of RDATA fields dependent on the record type.
A:
answer = "1.2.3.4"
CNAME:
answer = "www.example.com"
MX:
answer = "5 mail.example.com"
SRV:
answer = "10 0 2380 node-1.example.com"
SPF:
answer = "v=DKIM1; k=rsa; p=XXXXXXXX"
- meta Map<String>
- region String
- The region (Answer Group really) that this answer
belongs to. This should be one of the names specified in
regions
. Only a singleregion
per answer is currently supported. If you want an answer in multiple regions, duplicating the answer (including metadata) is the correct approach.meta
- (Optional) meta is supported at theanswer
level. Meta is documented below.
RecordFilter, RecordFilterArgs
RecordRegion, RecordRegionArgs
Import
$ pulumi import ns1:index/record:Record <name> <zone>/<domain>/<type>`
So for the example above:
$ pulumi import ns1:index/record:Record www terraform.example.io/www.terraform.example.io/CNAME`
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- NS1 pulumi/pulumi-ns1
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
ns1
Terraform Provider.