ionoscloud.dns.getRecord
Explore with Pulumi AI
The DNS Record can be used to search for and return an existing DNS Record. If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned. When this happens, please refine your search and make sure that your resources have unique names.
⚠️ Only tokens are accepted for authorization in the ionoscloud_dns_record data source. Please ensure you are using tokens as other methods will not be valid.
Example Usage
By ID
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const example = ionoscloud.dns.getRecord({
id: "record_id",
zoneId: "zone_id",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.dns.get_record(id="record_id",
zone_id="zone_id")
package main
import (
"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/dns"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dns.LookupRecord(ctx, &dns.LookupRecordArgs{
Id: pulumi.StringRef("record_id"),
ZoneId: "zone_id",
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var example = Ionoscloud.Dns.GetRecord.Invoke(new()
{
Id = "record_id",
ZoneId = "zone_id",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.dns.DnsFunctions;
import com.pulumi.ionoscloud.dns.inputs.GetRecordArgs;
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) {
final var example = DnsFunctions.getRecord(GetRecordArgs.builder()
.id("record_id")
.zoneId("zone_id")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:dns:getRecord
arguments:
id: record_id
zoneId: zone_id
By name
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const example = ionoscloud.dns.getRecord({
name: "recordexample",
zoneId: "zone_id",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.dns.get_record(name="recordexample",
zone_id="zone_id")
package main
import (
"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/dns"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dns.LookupRecord(ctx, &dns.LookupRecordArgs{
Name: pulumi.StringRef("recordexample"),
ZoneId: "zone_id",
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var example = Ionoscloud.Dns.GetRecord.Invoke(new()
{
Name = "recordexample",
ZoneId = "zone_id",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.dns.DnsFunctions;
import com.pulumi.ionoscloud.dns.inputs.GetRecordArgs;
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) {
final var example = DnsFunctions.getRecord(GetRecordArgs.builder()
.name("recordexample")
.zoneId("zone_id")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:dns:getRecord
arguments:
name: recordexample
zoneId: zone_id
By name with partial match
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const example = ionoscloud.dns.getRecord({
name: "record",
partialMatch: true,
zoneId: "zone_id",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.dns.get_record(name="record",
partial_match=True,
zone_id="zone_id")
package main
import (
"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/dns"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dns.LookupRecord(ctx, &dns.LookupRecordArgs{
Name: pulumi.StringRef("record"),
PartialMatch: pulumi.BoolRef(true),
ZoneId: "zone_id",
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var example = Ionoscloud.Dns.GetRecord.Invoke(new()
{
Name = "record",
PartialMatch = true,
ZoneId = "zone_id",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.dns.DnsFunctions;
import com.pulumi.ionoscloud.dns.inputs.GetRecordArgs;
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) {
final var example = DnsFunctions.getRecord(GetRecordArgs.builder()
.name("record")
.partialMatch(true)
.zoneId("zone_id")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:dns:getRecord
arguments:
name: record
partialMatch: true
zoneId: zone_id
Using getRecord
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getRecord(args: GetRecordArgs, opts?: InvokeOptions): Promise<GetRecordResult>
function getRecordOutput(args: GetRecordOutputArgs, opts?: InvokeOptions): Output<GetRecordResult>
def get_record(id: Optional[str] = None,
name: Optional[str] = None,
partial_match: Optional[bool] = None,
zone_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetRecordResult
def get_record_output(id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
partial_match: Optional[pulumi.Input[bool]] = None,
zone_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetRecordResult]
func LookupRecord(ctx *Context, args *LookupRecordArgs, opts ...InvokeOption) (*LookupRecordResult, error)
func LookupRecordOutput(ctx *Context, args *LookupRecordOutputArgs, opts ...InvokeOption) LookupRecordResultOutput
> Note: This function is named LookupRecord
in the Go SDK.
public static class GetRecord
{
public static Task<GetRecordResult> InvokeAsync(GetRecordArgs args, InvokeOptions? opts = null)
public static Output<GetRecordResult> Invoke(GetRecordInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetRecordResult> getRecord(GetRecordArgs args, InvokeOptions options)
public static Output<GetRecordResult> getRecord(GetRecordArgs args, InvokeOptions options)
fn::invoke:
function: ionoscloud:dns/getRecord:getRecord
arguments:
# arguments dictionary
The following arguments are supported:
- Zone
Id string - [string] The ID of the DNS Zone in which the DNS Record can be found.
- Id string
- [string] The ID of the DNS Record you want to search for.
- Name string
- [string] The name of the DNS Record you want to search for.
- Partial
Match bool [bool] Whether partial matching is allowed or not when using name argument. Default value is false.
Either
id
orname
must be provided. If none, or both are provided, the datasource will return an error.
- Zone
Id string - [string] The ID of the DNS Zone in which the DNS Record can be found.
- Id string
- [string] The ID of the DNS Record you want to search for.
- Name string
- [string] The name of the DNS Record you want to search for.
- Partial
Match bool [bool] Whether partial matching is allowed or not when using name argument. Default value is false.
Either
id
orname
must be provided. If none, or both are provided, the datasource will return an error.
- zone
Id String - [string] The ID of the DNS Zone in which the DNS Record can be found.
- id String
- [string] The ID of the DNS Record you want to search for.
- name String
- [string] The name of the DNS Record you want to search for.
- partial
Match Boolean [bool] Whether partial matching is allowed or not when using name argument. Default value is false.
Either
id
orname
must be provided. If none, or both are provided, the datasource will return an error.
- zone
Id string - [string] The ID of the DNS Zone in which the DNS Record can be found.
- id string
- [string] The ID of the DNS Record you want to search for.
- name string
- [string] The name of the DNS Record you want to search for.
- partial
Match boolean [bool] Whether partial matching is allowed or not when using name argument. Default value is false.
Either
id
orname
must be provided. If none, or both are provided, the datasource will return an error.
- zone_
id str - [string] The ID of the DNS Zone in which the DNS Record can be found.
- id str
- [string] The ID of the DNS Record you want to search for.
- name str
- [string] The name of the DNS Record you want to search for.
- partial_
match bool [bool] Whether partial matching is allowed or not when using name argument. Default value is false.
Either
id
orname
must be provided. If none, or both are provided, the datasource will return an error.
- zone
Id String - [string] The ID of the DNS Zone in which the DNS Record can be found.
- id String
- [string] The ID of the DNS Record you want to search for.
- name String
- [string] The name of the DNS Record you want to search for.
- partial
Match Boolean [bool] Whether partial matching is allowed or not when using name argument. Default value is false.
Either
id
orname
must be provided. If none, or both are provided, the datasource will return an error.
getRecord Result
The following output properties are available:
- Content string
- The content of the DNS Record.
- Enabled bool
- Indicates if the DNS Record is active or not.
- Fqdn string
- Id string
- The UUID of the DNS Record.
- Name string
- The name of the DNS Record.
- Priority int
- The priority for the DNS Record.
- Ttl int
- The time to live of the DNS Record.
- Type string
- The type of the DNS Record.
- Zone
Id string - Partial
Match bool
- Content string
- The content of the DNS Record.
- Enabled bool
- Indicates if the DNS Record is active or not.
- Fqdn string
- Id string
- The UUID of the DNS Record.
- Name string
- The name of the DNS Record.
- Priority int
- The priority for the DNS Record.
- Ttl int
- The time to live of the DNS Record.
- Type string
- The type of the DNS Record.
- Zone
Id string - Partial
Match bool
- content String
- The content of the DNS Record.
- enabled Boolean
- Indicates if the DNS Record is active or not.
- fqdn String
- id String
- The UUID of the DNS Record.
- name String
- The name of the DNS Record.
- priority Integer
- The priority for the DNS Record.
- ttl Integer
- The time to live of the DNS Record.
- type String
- The type of the DNS Record.
- zone
Id String - partial
Match Boolean
- content string
- The content of the DNS Record.
- enabled boolean
- Indicates if the DNS Record is active or not.
- fqdn string
- id string
- The UUID of the DNS Record.
- name string
- The name of the DNS Record.
- priority number
- The priority for the DNS Record.
- ttl number
- The time to live of the DNS Record.
- type string
- The type of the DNS Record.
- zone
Id string - partial
Match boolean
- content str
- The content of the DNS Record.
- enabled bool
- Indicates if the DNS Record is active or not.
- fqdn str
- id str
- The UUID of the DNS Record.
- name str
- The name of the DNS Record.
- priority int
- The priority for the DNS Record.
- ttl int
- The time to live of the DNS Record.
- type str
- The type of the DNS Record.
- zone_
id str - partial_
match bool
- content String
- The content of the DNS Record.
- enabled Boolean
- Indicates if the DNS Record is active or not.
- fqdn String
- id String
- The UUID of the DNS Record.
- name String
- The name of the DNS Record.
- priority Number
- The priority for the DNS Record.
- ttl Number
- The time to live of the DNS Record.
- type String
- The type of the DNS Record.
- zone
Id String - partial
Match Boolean
Package Details
- Repository
- ionoscloud ionos-cloud/pulumi-ionoscloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
ionoscloud
Terraform Provider.