1. Packages
  2. Infoblox Provider
  3. API Docs
  4. TxtRecord
infoblox 2.10.0 published on Friday, Apr 25, 2025 by infobloxopen

infoblox.TxtRecord

Explore with Pulumi AI

infoblox logo
infoblox 2.10.0 published on Friday, Apr 25, 2025 by infobloxopen

    # TXT-record Resource

    The infoblox.TxtRecord resource associates a text value with a domain name.

    The following list describes the parameters you can define in the resource block of the record:

    • fqdn: required, specifies the fully qualified domain name which you want to assign the text value for. Example: host43.zone12.org
    • text: required, specifies the text value for the TXT-record. It can contain substrings of up to 255 bytes and a total of up to 512 bytes. If you enter leading, trailing, or embedded spaces in the text string, enclose the entire string within \" characters to preserve the spaces.
    • dns_view: optional, specifies the DNS view which the zone exists in. If a value is not specified, the name default is used for DNS view. Example: dns_view_1
    • ttl: optional, specifies the “time to live” value for the record. There is no default value for this parameter. If a value is not specified, then in NIOS, the value is inherited from the parent zone of the DNS record for this resource. A TTL value of 0 (zero) means caching should be disabled for this record. Example: 600
    • comment: optional, describes the record. Example: auto-created test record #1
    • ext_attrs: optional, a set of NIOS extensible attributes that are attached to the record. Example: jsonencode({})

    Examples

    import * as pulumi from "@pulumi/pulumi";
    import * as infoblox from "@pulumi/infoblox";
    
    // TXT-Record, minimal set of parameters
    const rec1 = new infoblox.TxtRecord("rec1", {
        fqdn: "sample1.example.org",
        text: "\"this is just a sample\"",
    });
    // some parameters for a TXT-Record
    const rec2 = new infoblox.TxtRecord("rec2", {
        dnsView: "default",
        fqdn: "sample2.example.org",
        text: "\"data for TXT-record #2\"",
        ttl: 120,
    });
    // 120s
    // all the parameters for a TXT-Record
    const rec3 = new infoblox.TxtRecord("rec3", {
        dnsView: "nondefault_dnsview1",
        fqdn: "example3.example2.org",
        text: "\"data for TXT-record #3\"",
        ttl: 300,
        comment: "example TXT record #3",
        extAttrs: JSON.stringify({
            Location: "65.8665701230204, -37.00791763398113",
        }),
    });
    
    import pulumi
    import json
    import pulumi_infoblox as infoblox
    
    # TXT-Record, minimal set of parameters
    rec1 = infoblox.TxtRecord("rec1",
        fqdn="sample1.example.org",
        text="\"this is just a sample\"")
    # some parameters for a TXT-Record
    rec2 = infoblox.TxtRecord("rec2",
        dns_view="default",
        fqdn="sample2.example.org",
        text="\"data for TXT-record #2\"",
        ttl=120)
    # 120s
    # all the parameters for a TXT-Record
    rec3 = infoblox.TxtRecord("rec3",
        dns_view="nondefault_dnsview1",
        fqdn="example3.example2.org",
        text="\"data for TXT-record #3\"",
        ttl=300,
        comment="example TXT record #3",
        ext_attrs=json.dumps({
            "Location": "65.8665701230204, -37.00791763398113",
        }))
    
    package main
    
    import (
    	"encoding/json"
    
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/infoblox/v2/infoblox"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// TXT-Record, minimal set of parameters
    		_, err := infoblox.NewTxtRecord(ctx, "rec1", &infoblox.TxtRecordArgs{
    			Fqdn: pulumi.String("sample1.example.org"),
    			Text: pulumi.String("\"this is just a sample\""),
    		})
    		if err != nil {
    			return err
    		}
    		// some parameters for a TXT-Record
    		_, err = infoblox.NewTxtRecord(ctx, "rec2", &infoblox.TxtRecordArgs{
    			DnsView: pulumi.String("default"),
    			Fqdn:    pulumi.String("sample2.example.org"),
    			Text:    pulumi.String("\"data for TXT-record #2\""),
    			Ttl:     pulumi.Float64(120),
    		})
    		if err != nil {
    			return err
    		}
    		tmpJSON0, err := json.Marshal(map[string]interface{}{
    			"Location": "65.8665701230204, -37.00791763398113",
    		})
    		if err != nil {
    			return err
    		}
    		json0 := string(tmpJSON0)
    		// all the parameters for a TXT-Record
    		_, err = infoblox.NewTxtRecord(ctx, "rec3", &infoblox.TxtRecordArgs{
    			DnsView:  pulumi.String("nondefault_dnsview1"),
    			Fqdn:     pulumi.String("example3.example2.org"),
    			Text:     pulumi.String("\"data for TXT-record #3\""),
    			Ttl:      pulumi.Float64(300),
    			Comment:  pulumi.String("example TXT record #3"),
    			ExtAttrs: pulumi.String(json0),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.Json;
    using Pulumi;
    using Infoblox = Pulumi.Infoblox;
    
    return await Deployment.RunAsync(() => 
    {
        // TXT-Record, minimal set of parameters
        var rec1 = new Infoblox.TxtRecord("rec1", new()
        {
            Fqdn = "sample1.example.org",
            Text = "\"this is just a sample\"",
        });
    
        // some parameters for a TXT-Record
        var rec2 = new Infoblox.TxtRecord("rec2", new()
        {
            DnsView = "default",
            Fqdn = "sample2.example.org",
            Text = "\"data for TXT-record #2\"",
            Ttl = 120,
        });
    
        // 120s
        // all the parameters for a TXT-Record
        var rec3 = new Infoblox.TxtRecord("rec3", new()
        {
            DnsView = "nondefault_dnsview1",
            Fqdn = "example3.example2.org",
            Text = "\"data for TXT-record #3\"",
            Ttl = 300,
            Comment = "example TXT record #3",
            ExtAttrs = JsonSerializer.Serialize(new Dictionary<string, object?>
            {
                ["Location"] = "65.8665701230204, -37.00791763398113",
            }),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.infoblox.TxtRecord;
    import com.pulumi.infoblox.TxtRecordArgs;
    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) {
            // TXT-Record, minimal set of parameters
            var rec1 = new TxtRecord("rec1", TxtRecordArgs.builder()
                .fqdn("sample1.example.org")
                .text("\"this is just a sample\"")
                .build());
    
            // some parameters for a TXT-Record
            var rec2 = new TxtRecord("rec2", TxtRecordArgs.builder()
                .dnsView("default")
                .fqdn("sample2.example.org")
                .text("\"data for TXT-record #2\"")
                .ttl(120)
                .build());
    
            // 120s
            // all the parameters for a TXT-Record
            var rec3 = new TxtRecord("rec3", TxtRecordArgs.builder()
                .dnsView("nondefault_dnsview1")
                .fqdn("example3.example2.org")
                .text("\"data for TXT-record #3\"")
                .ttl(300)
                .comment("example TXT record #3")
                .extAttrs(serializeJson(
                    jsonObject(
                        jsonProperty("Location", "65.8665701230204, -37.00791763398113")
                    )))
                .build());
    
        }
    }
    
    resources:
      # TXT-Record, minimal set of parameters
      rec1:
        type: infoblox:TxtRecord
        properties:
          fqdn: sample1.example.org
          text: '"this is just a sample"'
      # some parameters for a TXT-Record
      rec2:
        type: infoblox:TxtRecord
        properties:
          dnsView: default
          # may be omitted
          fqdn: sample2.example.org
          text: '"data for TXT-record #2"'
          ttl: 120
      # all the parameters for a TXT-Record
      rec3:
        type: infoblox:TxtRecord
        properties:
          dnsView: nondefault_dnsview1
          fqdn: example3.example2.org
          text: '"data for TXT-record #3"'
          ttl: 300
          comment: 'example TXT record #3'
          extAttrs:
            fn::toJSON:
              Location: 65.8665701230204, -37.00791763398113
    

    Create TxtRecord Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new TxtRecord(name: string, args: TxtRecordArgs, opts?: CustomResourceOptions);
    @overload
    def TxtRecord(resource_name: str,
                  args: TxtRecordArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def TxtRecord(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  fqdn: Optional[str] = None,
                  comment: Optional[str] = None,
                  dns_view: Optional[str] = None,
                  ext_attrs: Optional[str] = None,
                  text: Optional[str] = None,
                  ttl: Optional[float] = None,
                  txt_record_id: Optional[str] = None)
    func NewTxtRecord(ctx *Context, name string, args TxtRecordArgs, opts ...ResourceOption) (*TxtRecord, error)
    public TxtRecord(string name, TxtRecordArgs args, CustomResourceOptions? opts = null)
    public TxtRecord(String name, TxtRecordArgs args)
    public TxtRecord(String name, TxtRecordArgs args, CustomResourceOptions options)
    
    type: infoblox:TxtRecord
    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 TxtRecordArgs
    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 TxtRecordArgs
    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 TxtRecordArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TxtRecordArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TxtRecordArgs
    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 txtRecordResource = new Infoblox.TxtRecord("txtRecordResource", new()
    {
        Fqdn = "string",
        Comment = "string",
        DnsView = "string",
        ExtAttrs = "string",
        Text = "string",
        Ttl = 0,
        TxtRecordId = "string",
    });
    
    example, err := infoblox.NewTxtRecord(ctx, "txtRecordResource", &infoblox.TxtRecordArgs{
    	Fqdn:        pulumi.String("string"),
    	Comment:     pulumi.String("string"),
    	DnsView:     pulumi.String("string"),
    	ExtAttrs:    pulumi.String("string"),
    	Text:        pulumi.String("string"),
    	Ttl:         pulumi.Float64(0),
    	TxtRecordId: pulumi.String("string"),
    })
    
    var txtRecordResource = new TxtRecord("txtRecordResource", TxtRecordArgs.builder()
        .fqdn("string")
        .comment("string")
        .dnsView("string")
        .extAttrs("string")
        .text("string")
        .ttl(0)
        .txtRecordId("string")
        .build());
    
    txt_record_resource = infoblox.TxtRecord("txtRecordResource",
        fqdn="string",
        comment="string",
        dns_view="string",
        ext_attrs="string",
        text="string",
        ttl=0,
        txt_record_id="string")
    
    const txtRecordResource = new infoblox.TxtRecord("txtRecordResource", {
        fqdn: "string",
        comment: "string",
        dnsView: "string",
        extAttrs: "string",
        text: "string",
        ttl: 0,
        txtRecordId: "string",
    });
    
    type: infoblox:TxtRecord
    properties:
        comment: string
        dnsView: string
        extAttrs: string
        fqdn: string
        text: string
        ttl: 0
        txtRecordId: string
    

    TxtRecord 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 TxtRecord resource accepts the following input properties:

    Fqdn string
    FQDN for the TXT-Record.
    Comment string
    Description of the TXT-record.
    DnsView string
    DNS view in which the record's zone exists.
    ExtAttrs string
    Extensible attributes of the TXT-record to be added/updated, as a map in JSON format
    Text string
    Data to be associated with TXT_Record.
    Ttl double
    TTL value of the TXT-Record
    TxtRecordId string
    Fqdn string
    FQDN for the TXT-Record.
    Comment string
    Description of the TXT-record.
    DnsView string
    DNS view in which the record's zone exists.
    ExtAttrs string
    Extensible attributes of the TXT-record to be added/updated, as a map in JSON format
    Text string
    Data to be associated with TXT_Record.
    Ttl float64
    TTL value of the TXT-Record
    TxtRecordId string
    fqdn String
    FQDN for the TXT-Record.
    comment String
    Description of the TXT-record.
    dnsView String
    DNS view in which the record's zone exists.
    extAttrs String
    Extensible attributes of the TXT-record to be added/updated, as a map in JSON format
    text String
    Data to be associated with TXT_Record.
    ttl Double
    TTL value of the TXT-Record
    txtRecordId String
    fqdn string
    FQDN for the TXT-Record.
    comment string
    Description of the TXT-record.
    dnsView string
    DNS view in which the record's zone exists.
    extAttrs string
    Extensible attributes of the TXT-record to be added/updated, as a map in JSON format
    text string
    Data to be associated with TXT_Record.
    ttl number
    TTL value of the TXT-Record
    txtRecordId string
    fqdn str
    FQDN for the TXT-Record.
    comment str
    Description of the TXT-record.
    dns_view str
    DNS view in which the record's zone exists.
    ext_attrs str
    Extensible attributes of the TXT-record to be added/updated, as a map in JSON format
    text str
    Data to be associated with TXT_Record.
    ttl float
    TTL value of the TXT-Record
    txt_record_id str
    fqdn String
    FQDN for the TXT-Record.
    comment String
    Description of the TXT-record.
    dnsView String
    DNS view in which the record's zone exists.
    extAttrs String
    Extensible attributes of the TXT-record to be added/updated, as a map in JSON format
    text String
    Data to be associated with TXT_Record.
    ttl Number
    TTL value of the TXT-Record
    txtRecordId String

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    InternalId string
    Ref string
    NIOS object's reference, not to be set by a user.
    Id string
    The provider-assigned unique ID for this managed resource.
    InternalId string
    Ref string
    NIOS object's reference, not to be set by a user.
    id String
    The provider-assigned unique ID for this managed resource.
    internalId String
    ref String
    NIOS object's reference, not to be set by a user.
    id string
    The provider-assigned unique ID for this managed resource.
    internalId string
    ref string
    NIOS object's reference, not to be set by a user.
    id str
    The provider-assigned unique ID for this managed resource.
    internal_id str
    ref str
    NIOS object's reference, not to be set by a user.
    id String
    The provider-assigned unique ID for this managed resource.
    internalId String
    ref String
    NIOS object's reference, not to be set by a user.

    Look up Existing TxtRecord Resource

    Get an existing TxtRecord 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?: TxtRecordState, opts?: CustomResourceOptions): TxtRecord
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            comment: Optional[str] = None,
            dns_view: Optional[str] = None,
            ext_attrs: Optional[str] = None,
            fqdn: Optional[str] = None,
            internal_id: Optional[str] = None,
            ref: Optional[str] = None,
            text: Optional[str] = None,
            ttl: Optional[float] = None,
            txt_record_id: Optional[str] = None) -> TxtRecord
    func GetTxtRecord(ctx *Context, name string, id IDInput, state *TxtRecordState, opts ...ResourceOption) (*TxtRecord, error)
    public static TxtRecord Get(string name, Input<string> id, TxtRecordState? state, CustomResourceOptions? opts = null)
    public static TxtRecord get(String name, Output<String> id, TxtRecordState state, CustomResourceOptions options)
    resources:  _:    type: infoblox:TxtRecord    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Comment string
    Description of the TXT-record.
    DnsView string
    DNS view in which the record's zone exists.
    ExtAttrs string
    Extensible attributes of the TXT-record to be added/updated, as a map in JSON format
    Fqdn string
    FQDN for the TXT-Record.
    InternalId string
    Ref string
    NIOS object's reference, not to be set by a user.
    Text string
    Data to be associated with TXT_Record.
    Ttl double
    TTL value of the TXT-Record
    TxtRecordId string
    Comment string
    Description of the TXT-record.
    DnsView string
    DNS view in which the record's zone exists.
    ExtAttrs string
    Extensible attributes of the TXT-record to be added/updated, as a map in JSON format
    Fqdn string
    FQDN for the TXT-Record.
    InternalId string
    Ref string
    NIOS object's reference, not to be set by a user.
    Text string
    Data to be associated with TXT_Record.
    Ttl float64
    TTL value of the TXT-Record
    TxtRecordId string
    comment String
    Description of the TXT-record.
    dnsView String
    DNS view in which the record's zone exists.
    extAttrs String
    Extensible attributes of the TXT-record to be added/updated, as a map in JSON format
    fqdn String
    FQDN for the TXT-Record.
    internalId String
    ref String
    NIOS object's reference, not to be set by a user.
    text String
    Data to be associated with TXT_Record.
    ttl Double
    TTL value of the TXT-Record
    txtRecordId String
    comment string
    Description of the TXT-record.
    dnsView string
    DNS view in which the record's zone exists.
    extAttrs string
    Extensible attributes of the TXT-record to be added/updated, as a map in JSON format
    fqdn string
    FQDN for the TXT-Record.
    internalId string
    ref string
    NIOS object's reference, not to be set by a user.
    text string
    Data to be associated with TXT_Record.
    ttl number
    TTL value of the TXT-Record
    txtRecordId string
    comment str
    Description of the TXT-record.
    dns_view str
    DNS view in which the record's zone exists.
    ext_attrs str
    Extensible attributes of the TXT-record to be added/updated, as a map in JSON format
    fqdn str
    FQDN for the TXT-Record.
    internal_id str
    ref str
    NIOS object's reference, not to be set by a user.
    text str
    Data to be associated with TXT_Record.
    ttl float
    TTL value of the TXT-Record
    txt_record_id str
    comment String
    Description of the TXT-record.
    dnsView String
    DNS view in which the record's zone exists.
    extAttrs String
    Extensible attributes of the TXT-record to be added/updated, as a map in JSON format
    fqdn String
    FQDN for the TXT-Record.
    internalId String
    ref String
    NIOS object's reference, not to be set by a user.
    text String
    Data to be associated with TXT_Record.
    ttl Number
    TTL value of the TXT-Record
    txtRecordId String

    Package Details

    Repository
    infoblox infobloxopen/terraform-provider-infoblox
    License
    Notes
    This Pulumi package is based on the infoblox Terraform Provider.
    infoblox logo
    infoblox 2.10.0 published on Friday, Apr 25, 2025 by infobloxopen