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

infoblox.SrvRecord

Explore with Pulumi AI

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

    # SRV-record Resource

    The infoblox.SrvRecord resource corresponds to SRV-record (service record) on NIOS side, and its purpose is to provide information about a network endpoint (host and port) which provides particular network service for the specified DNS zone.

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

    • 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
    • name: required, specifies the record’s name in the format, defined in RFC2782 document. Example: _http._tcp.acme.com
    • target: required, specifies an FQDN of the host which is responsible for providing the service specified by name. Example: www.acme.com
    • port: required, specifies a port number (0..65535) on the target host which the service expects requests on.
    • priority: required, specifies a priority number, as described in RFC2782.
    • weight: required, specifies a weight number, as described in RFC2782.
    • 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";
    
    // minimal set of parameters
    const rec1 = new infoblox.SrvRecord("rec1", {
        priority: 100,
        weight: 75,
        port: 8080,
        target: "www.example.org",
    });
    // all set of parameters for SRV record
    const rec2 = new infoblox.SrvRecord("rec2", {
        dnsView: "nondefault_dnsview1",
        priority: 12,
        weight: 10,
        port: 5060,
        target: "sip.example2.org",
        ttl: 3600,
        comment: "example SRV record",
        extAttrs: JSON.stringify({
            Location: "65.8665701230204, -37.00791763398113",
        }),
    });
    
    import pulumi
    import json
    import pulumi_infoblox as infoblox
    
    # minimal set of parameters
    rec1 = infoblox.SrvRecord("rec1",
        priority=100,
        weight=75,
        port=8080,
        target="www.example.org")
    # all set of parameters for SRV record
    rec2 = infoblox.SrvRecord("rec2",
        dns_view="nondefault_dnsview1",
        priority=12,
        weight=10,
        port=5060,
        target="sip.example2.org",
        ttl=3600,
        comment="example SRV record",
        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 {
    		// minimal set of parameters
    		_, err := infoblox.NewSrvRecord(ctx, "rec1", &infoblox.SrvRecordArgs{
    			Priority: pulumi.Float64(100),
    			Weight:   pulumi.Float64(75),
    			Port:     pulumi.Float64(8080),
    			Target:   pulumi.String("www.example.org"),
    		})
    		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 set of parameters for SRV record
    		_, err = infoblox.NewSrvRecord(ctx, "rec2", &infoblox.SrvRecordArgs{
    			DnsView:  pulumi.String("nondefault_dnsview1"),
    			Priority: pulumi.Float64(12),
    			Weight:   pulumi.Float64(10),
    			Port:     pulumi.Float64(5060),
    			Target:   pulumi.String("sip.example2.org"),
    			Ttl:      pulumi.Float64(3600),
    			Comment:  pulumi.String("example SRV record"),
    			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(() => 
    {
        // minimal set of parameters
        var rec1 = new Infoblox.SrvRecord("rec1", new()
        {
            Priority = 100,
            Weight = 75,
            Port = 8080,
            Target = "www.example.org",
        });
    
        // all set of parameters for SRV record
        var rec2 = new Infoblox.SrvRecord("rec2", new()
        {
            DnsView = "nondefault_dnsview1",
            Priority = 12,
            Weight = 10,
            Port = 5060,
            Target = "sip.example2.org",
            Ttl = 3600,
            Comment = "example SRV record",
            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.SrvRecord;
    import com.pulumi.infoblox.SrvRecordArgs;
    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) {
            // minimal set of parameters
            var rec1 = new SrvRecord("rec1", SrvRecordArgs.builder()
                .priority(100)
                .weight(75)
                .port(8080)
                .target("www.example.org")
                .build());
    
            // all set of parameters for SRV record
            var rec2 = new SrvRecord("rec2", SrvRecordArgs.builder()
                .dnsView("nondefault_dnsview1")
                .priority(12)
                .weight(10)
                .port(5060)
                .target("sip.example2.org")
                .ttl(3600)
                .comment("example SRV record")
                .extAttrs(serializeJson(
                    jsonObject(
                        jsonProperty("Location", "65.8665701230204, -37.00791763398113")
                    )))
                .build());
    
        }
    }
    
    resources:
      # minimal set of parameters
      rec1:
        type: infoblox:SrvRecord
        properties:
          priority: 100
          weight: 75
          port: 8080
          target: www.example.org
      # all set of parameters for SRV record
      rec2:
        type: infoblox:SrvRecord
        properties:
          dnsView: nondefault_dnsview1
          priority: 12
          weight: 10
          port: 5060
          target: sip.example2.org
          ttl: 3600
          comment: example SRV record
          extAttrs:
            fn::toJSON:
              Location: 65.8665701230204, -37.00791763398113
    

    Create SrvRecord Resource

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

    Constructor syntax

    new SrvRecord(name: string, args: SrvRecordArgs, opts?: CustomResourceOptions);
    @overload
    def SrvRecord(resource_name: str,
                  args: SrvRecordArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def SrvRecord(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  port: Optional[float] = None,
                  priority: Optional[float] = None,
                  target: Optional[str] = None,
                  weight: Optional[float] = None,
                  comment: Optional[str] = None,
                  dns_view: Optional[str] = None,
                  ext_attrs: Optional[str] = None,
                  name: Optional[str] = None,
                  srv_record_id: Optional[str] = None,
                  ttl: Optional[float] = None)
    func NewSrvRecord(ctx *Context, name string, args SrvRecordArgs, opts ...ResourceOption) (*SrvRecord, error)
    public SrvRecord(string name, SrvRecordArgs args, CustomResourceOptions? opts = null)
    public SrvRecord(String name, SrvRecordArgs args)
    public SrvRecord(String name, SrvRecordArgs args, CustomResourceOptions options)
    
    type: infoblox:SrvRecord
    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 SrvRecordArgs
    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 SrvRecordArgs
    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 SrvRecordArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SrvRecordArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SrvRecordArgs
    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 srvRecordResource = new Infoblox.SrvRecord("srvRecordResource", new()
    {
        Port = 0,
        Priority = 0,
        Target = "string",
        Weight = 0,
        Comment = "string",
        DnsView = "string",
        ExtAttrs = "string",
        Name = "string",
        SrvRecordId = "string",
        Ttl = 0,
    });
    
    example, err := infoblox.NewSrvRecord(ctx, "srvRecordResource", &infoblox.SrvRecordArgs{
    	Port:        pulumi.Float64(0),
    	Priority:    pulumi.Float64(0),
    	Target:      pulumi.String("string"),
    	Weight:      pulumi.Float64(0),
    	Comment:     pulumi.String("string"),
    	DnsView:     pulumi.String("string"),
    	ExtAttrs:    pulumi.String("string"),
    	Name:        pulumi.String("string"),
    	SrvRecordId: pulumi.String("string"),
    	Ttl:         pulumi.Float64(0),
    })
    
    var srvRecordResource = new SrvRecord("srvRecordResource", SrvRecordArgs.builder()
        .port(0)
        .priority(0)
        .target("string")
        .weight(0)
        .comment("string")
        .dnsView("string")
        .extAttrs("string")
        .name("string")
        .srvRecordId("string")
        .ttl(0)
        .build());
    
    srv_record_resource = infoblox.SrvRecord("srvRecordResource",
        port=0,
        priority=0,
        target="string",
        weight=0,
        comment="string",
        dns_view="string",
        ext_attrs="string",
        name="string",
        srv_record_id="string",
        ttl=0)
    
    const srvRecordResource = new infoblox.SrvRecord("srvRecordResource", {
        port: 0,
        priority: 0,
        target: "string",
        weight: 0,
        comment: "string",
        dnsView: "string",
        extAttrs: "string",
        name: "string",
        srvRecordId: "string",
        ttl: 0,
    });
    
    type: infoblox:SrvRecord
    properties:
        comment: string
        dnsView: string
        extAttrs: string
        name: string
        port: 0
        priority: 0
        srvRecordId: string
        target: string
        ttl: 0
        weight: 0
    

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

    Port double
    Configures port number (0..65535) for this SRV-record.
    Priority double
    Configures the priority (0..65535) for this SRV-record.
    Target string
    Provides service for domain name in the SRV-record.
    Weight double
    Configures weight of the SRV-record, valid values are 0..65535.
    Comment string
    Description of the SRV-record
    DnsView string
    DNS view which the zone does exist within
    ExtAttrs string
    Extensible attributes of the SRV-record to be added/updated, as a map in JSON format.
    Name string
    Combination of service's name, protocol's name and zone's name
    SrvRecordId string
    Ttl double
    TTL value for the SRV-record.
    Port float64
    Configures port number (0..65535) for this SRV-record.
    Priority float64
    Configures the priority (0..65535) for this SRV-record.
    Target string
    Provides service for domain name in the SRV-record.
    Weight float64
    Configures weight of the SRV-record, valid values are 0..65535.
    Comment string
    Description of the SRV-record
    DnsView string
    DNS view which the zone does exist within
    ExtAttrs string
    Extensible attributes of the SRV-record to be added/updated, as a map in JSON format.
    Name string
    Combination of service's name, protocol's name and zone's name
    SrvRecordId string
    Ttl float64
    TTL value for the SRV-record.
    port Double
    Configures port number (0..65535) for this SRV-record.
    priority Double
    Configures the priority (0..65535) for this SRV-record.
    target String
    Provides service for domain name in the SRV-record.
    weight Double
    Configures weight of the SRV-record, valid values are 0..65535.
    comment String
    Description of the SRV-record
    dnsView String
    DNS view which the zone does exist within
    extAttrs String
    Extensible attributes of the SRV-record to be added/updated, as a map in JSON format.
    name String
    Combination of service's name, protocol's name and zone's name
    srvRecordId String
    ttl Double
    TTL value for the SRV-record.
    port number
    Configures port number (0..65535) for this SRV-record.
    priority number
    Configures the priority (0..65535) for this SRV-record.
    target string
    Provides service for domain name in the SRV-record.
    weight number
    Configures weight of the SRV-record, valid values are 0..65535.
    comment string
    Description of the SRV-record
    dnsView string
    DNS view which the zone does exist within
    extAttrs string
    Extensible attributes of the SRV-record to be added/updated, as a map in JSON format.
    name string
    Combination of service's name, protocol's name and zone's name
    srvRecordId string
    ttl number
    TTL value for the SRV-record.
    port float
    Configures port number (0..65535) for this SRV-record.
    priority float
    Configures the priority (0..65535) for this SRV-record.
    target str
    Provides service for domain name in the SRV-record.
    weight float
    Configures weight of the SRV-record, valid values are 0..65535.
    comment str
    Description of the SRV-record
    dns_view str
    DNS view which the zone does exist within
    ext_attrs str
    Extensible attributes of the SRV-record to be added/updated, as a map in JSON format.
    name str
    Combination of service's name, protocol's name and zone's name
    srv_record_id str
    ttl float
    TTL value for the SRV-record.
    port Number
    Configures port number (0..65535) for this SRV-record.
    priority Number
    Configures the priority (0..65535) for this SRV-record.
    target String
    Provides service for domain name in the SRV-record.
    weight Number
    Configures weight of the SRV-record, valid values are 0..65535.
    comment String
    Description of the SRV-record
    dnsView String
    DNS view which the zone does exist within
    extAttrs String
    Extensible attributes of the SRV-record to be added/updated, as a map in JSON format.
    name String
    Combination of service's name, protocol's name and zone's name
    srvRecordId String
    ttl Number
    TTL value for the SRV-record.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the SrvRecord 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 SrvRecord Resource

    Get an existing SrvRecord 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?: SrvRecordState, opts?: CustomResourceOptions): SrvRecord
    @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,
            internal_id: Optional[str] = None,
            name: Optional[str] = None,
            port: Optional[float] = None,
            priority: Optional[float] = None,
            ref: Optional[str] = None,
            srv_record_id: Optional[str] = None,
            target: Optional[str] = None,
            ttl: Optional[float] = None,
            weight: Optional[float] = None) -> SrvRecord
    func GetSrvRecord(ctx *Context, name string, id IDInput, state *SrvRecordState, opts ...ResourceOption) (*SrvRecord, error)
    public static SrvRecord Get(string name, Input<string> id, SrvRecordState? state, CustomResourceOptions? opts = null)
    public static SrvRecord get(String name, Output<String> id, SrvRecordState state, CustomResourceOptions options)
    resources:  _:    type: infoblox:SrvRecord    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 SRV-record
    DnsView string
    DNS view which the zone does exist within
    ExtAttrs string
    Extensible attributes of the SRV-record to be added/updated, as a map in JSON format.
    InternalId string
    Name string
    Combination of service's name, protocol's name and zone's name
    Port double
    Configures port number (0..65535) for this SRV-record.
    Priority double
    Configures the priority (0..65535) for this SRV-record.
    Ref string
    NIOS object's reference, not to be set by a user.
    SrvRecordId string
    Target string
    Provides service for domain name in the SRV-record.
    Ttl double
    TTL value for the SRV-record.
    Weight double
    Configures weight of the SRV-record, valid values are 0..65535.
    Comment string
    Description of the SRV-record
    DnsView string
    DNS view which the zone does exist within
    ExtAttrs string
    Extensible attributes of the SRV-record to be added/updated, as a map in JSON format.
    InternalId string
    Name string
    Combination of service's name, protocol's name and zone's name
    Port float64
    Configures port number (0..65535) for this SRV-record.
    Priority float64
    Configures the priority (0..65535) for this SRV-record.
    Ref string
    NIOS object's reference, not to be set by a user.
    SrvRecordId string
    Target string
    Provides service for domain name in the SRV-record.
    Ttl float64
    TTL value for the SRV-record.
    Weight float64
    Configures weight of the SRV-record, valid values are 0..65535.
    comment String
    Description of the SRV-record
    dnsView String
    DNS view which the zone does exist within
    extAttrs String
    Extensible attributes of the SRV-record to be added/updated, as a map in JSON format.
    internalId String
    name String
    Combination of service's name, protocol's name and zone's name
    port Double
    Configures port number (0..65535) for this SRV-record.
    priority Double
    Configures the priority (0..65535) for this SRV-record.
    ref String
    NIOS object's reference, not to be set by a user.
    srvRecordId String
    target String
    Provides service for domain name in the SRV-record.
    ttl Double
    TTL value for the SRV-record.
    weight Double
    Configures weight of the SRV-record, valid values are 0..65535.
    comment string
    Description of the SRV-record
    dnsView string
    DNS view which the zone does exist within
    extAttrs string
    Extensible attributes of the SRV-record to be added/updated, as a map in JSON format.
    internalId string
    name string
    Combination of service's name, protocol's name and zone's name
    port number
    Configures port number (0..65535) for this SRV-record.
    priority number
    Configures the priority (0..65535) for this SRV-record.
    ref string
    NIOS object's reference, not to be set by a user.
    srvRecordId string
    target string
    Provides service for domain name in the SRV-record.
    ttl number
    TTL value for the SRV-record.
    weight number
    Configures weight of the SRV-record, valid values are 0..65535.
    comment str
    Description of the SRV-record
    dns_view str
    DNS view which the zone does exist within
    ext_attrs str
    Extensible attributes of the SRV-record to be added/updated, as a map in JSON format.
    internal_id str
    name str
    Combination of service's name, protocol's name and zone's name
    port float
    Configures port number (0..65535) for this SRV-record.
    priority float
    Configures the priority (0..65535) for this SRV-record.
    ref str
    NIOS object's reference, not to be set by a user.
    srv_record_id str
    target str
    Provides service for domain name in the SRV-record.
    ttl float
    TTL value for the SRV-record.
    weight float
    Configures weight of the SRV-record, valid values are 0..65535.
    comment String
    Description of the SRV-record
    dnsView String
    DNS view which the zone does exist within
    extAttrs String
    Extensible attributes of the SRV-record to be added/updated, as a map in JSON format.
    internalId String
    name String
    Combination of service's name, protocol's name and zone's name
    port Number
    Configures port number (0..65535) for this SRV-record.
    priority Number
    Configures the priority (0..65535) for this SRV-record.
    ref String
    NIOS object's reference, not to be set by a user.
    srvRecordId String
    target String
    Provides service for domain name in the SRV-record.
    ttl Number
    TTL value for the SRV-record.
    weight Number
    Configures weight of the SRV-record, valid values are 0..65535.

    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