1. Packages
  2. Scaleway
  3. API Docs
  4. domain
  5. getRecord
Scaleway v1.26.0 published on Friday, Mar 28, 2025 by pulumiverse

scaleway.domain.getRecord

Explore with Pulumi AI

Scaleway v1.26.0 published on Friday, Mar 28, 2025 by pulumiverse

The scaleway.domain.Record data source is used to get information about an existing domain record.

Refer to the Domains and DNS product documentation and API documentation for more information.

Query domain records

The following commands allow you to:

  • query a domain record specified by the DNS zone (domain.tld), the record name (www), the record type (A), and the record content (1.2.3.4).
  • query a domain record specified by the DNS zone (domain.tld) and the unique record ID (11111111-1111-1111-1111-111111111111).
import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@pulumi/scaleway";

// Query record by DNS zone, record name, type and content
const byContent = scaleway.domain.getRecord({
    dnsZone: "domain.tld",
    name: "www",
    type: "A",
    data: "1.2.3.4",
});
// Query record by DNS zone and record ID
const byId = scaleway.domain.getRecord({
    dnsZone: "domain.tld",
    recordId: "11111111-1111-1111-1111-111111111111",
});
Copy
import pulumi
import pulumi_scaleway as scaleway

# Query record by DNS zone, record name, type and content
by_content = scaleway.domain.get_record(dns_zone="domain.tld",
    name="www",
    type="A",
    data="1.2.3.4")
# Query record by DNS zone and record ID
by_id = scaleway.domain.get_record(dns_zone="domain.tld",
    record_id="11111111-1111-1111-1111-111111111111")
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/domain"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Query record by DNS zone, record name, type and content
		_, err := domain.LookupRecord(ctx, &domain.LookupRecordArgs{
			DnsZone: pulumi.StringRef("domain.tld"),
			Name:    pulumi.StringRef("www"),
			Type:    pulumi.StringRef("A"),
			Data:    pulumi.StringRef("1.2.3.4"),
		}, nil)
		if err != nil {
			return err
		}
		// Query record by DNS zone and record ID
		_, err = domain.LookupRecord(ctx, &domain.LookupRecordArgs{
			DnsZone:  pulumi.StringRef("domain.tld"),
			RecordId: pulumi.StringRef("11111111-1111-1111-1111-111111111111"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Pulumi.Scaleway;

return await Deployment.RunAsync(() => 
{
    // Query record by DNS zone, record name, type and content
    var byContent = Scaleway.Domain.GetRecord.Invoke(new()
    {
        DnsZone = "domain.tld",
        Name = "www",
        Type = "A",
        Data = "1.2.3.4",
    });

    // Query record by DNS zone and record ID
    var byId = Scaleway.Domain.GetRecord.Invoke(new()
    {
        DnsZone = "domain.tld",
        RecordId = "11111111-1111-1111-1111-111111111111",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.domain.DomainFunctions;
import com.pulumi.scaleway.domain.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) {
        // Query record by DNS zone, record name, type and content
        final var byContent = DomainFunctions.getRecord(GetRecordArgs.builder()
            .dnsZone("domain.tld")
            .name("www")
            .type("A")
            .data("1.2.3.4")
            .build());

        // Query record by DNS zone and record ID
        final var byId = DomainFunctions.getRecord(GetRecordArgs.builder()
            .dnsZone("domain.tld")
            .recordId("11111111-1111-1111-1111-111111111111")
            .build());

    }
}
Copy
variables:
  # Query record by DNS zone, record name, type and content
  byContent:
    fn::invoke:
      function: scaleway:domain:getRecord
      arguments:
        dnsZone: domain.tld
        name: www
        type: A
        data: 1.2.3.4
  # Query record by DNS zone and record ID
  byId:
    fn::invoke:
      function: scaleway:domain:getRecord
      arguments:
        dnsZone: domain.tld
        recordId: 11111111-1111-1111-1111-111111111111
Copy

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>
Copy
def get_record(data: Optional[str] = None,
               dns_zone: Optional[str] = None,
               name: Optional[str] = None,
               project_id: Optional[str] = None,
               record_id: Optional[str] = None,
               type: Optional[str] = None,
               opts: Optional[InvokeOptions] = None) -> GetRecordResult
def get_record_output(data: Optional[pulumi.Input[str]] = None,
               dns_zone: Optional[pulumi.Input[str]] = None,
               name: Optional[pulumi.Input[str]] = None,
               project_id: Optional[pulumi.Input[str]] = None,
               record_id: Optional[pulumi.Input[str]] = None,
               type: Optional[pulumi.Input[str]] = None,
               opts: Optional[InvokeOptions] = None) -> Output[GetRecordResult]
Copy
func LookupRecord(ctx *Context, args *LookupRecordArgs, opts ...InvokeOption) (*LookupRecordResult, error)
func LookupRecordOutput(ctx *Context, args *LookupRecordOutputArgs, opts ...InvokeOption) LookupRecordResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetRecordResult> getRecord(GetRecordArgs args, InvokeOptions options)
public static Output<GetRecordResult> getRecord(GetRecordArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: scaleway:domain/getRecord:getRecord
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Data string
The content of the record (e.g., an IPv4 address for an A record or a string for a TXT record). Cannot be used with record_id.
DnsZone string
The DNS zone (domain) to which the record belongs. This is a required field in both examples above but is optional in the context of defining the data source.
Name string
The name of the record, which can be an empty string for a root record. Cannot be used with record_id.
ProjectId string
). The ID of the Project associated with the domain.
RecordId string
The unique identifier of the record. Cannot be used with name, type, and data.
Type string
The type of the record (A, AAAA, MX, CNAME, etc.). Cannot be used with record_id.
Data string
The content of the record (e.g., an IPv4 address for an A record or a string for a TXT record). Cannot be used with record_id.
DnsZone string
The DNS zone (domain) to which the record belongs. This is a required field in both examples above but is optional in the context of defining the data source.
Name string
The name of the record, which can be an empty string for a root record. Cannot be used with record_id.
ProjectId string
). The ID of the Project associated with the domain.
RecordId string
The unique identifier of the record. Cannot be used with name, type, and data.
Type string
The type of the record (A, AAAA, MX, CNAME, etc.). Cannot be used with record_id.
data String
The content of the record (e.g., an IPv4 address for an A record or a string for a TXT record). Cannot be used with record_id.
dnsZone String
The DNS zone (domain) to which the record belongs. This is a required field in both examples above but is optional in the context of defining the data source.
name String
The name of the record, which can be an empty string for a root record. Cannot be used with record_id.
projectId String
). The ID of the Project associated with the domain.
recordId String
The unique identifier of the record. Cannot be used with name, type, and data.
type String
The type of the record (A, AAAA, MX, CNAME, etc.). Cannot be used with record_id.
data string
The content of the record (e.g., an IPv4 address for an A record or a string for a TXT record). Cannot be used with record_id.
dnsZone string
The DNS zone (domain) to which the record belongs. This is a required field in both examples above but is optional in the context of defining the data source.
name string
The name of the record, which can be an empty string for a root record. Cannot be used with record_id.
projectId string
). The ID of the Project associated with the domain.
recordId string
The unique identifier of the record. Cannot be used with name, type, and data.
type string
The type of the record (A, AAAA, MX, CNAME, etc.). Cannot be used with record_id.
data str
The content of the record (e.g., an IPv4 address for an A record or a string for a TXT record). Cannot be used with record_id.
dns_zone str
The DNS zone (domain) to which the record belongs. This is a required field in both examples above but is optional in the context of defining the data source.
name str
The name of the record, which can be an empty string for a root record. Cannot be used with record_id.
project_id str
). The ID of the Project associated with the domain.
record_id str
The unique identifier of the record. Cannot be used with name, type, and data.
type str
The type of the record (A, AAAA, MX, CNAME, etc.). Cannot be used with record_id.
data String
The content of the record (e.g., an IPv4 address for an A record or a string for a TXT record). Cannot be used with record_id.
dnsZone String
The DNS zone (domain) to which the record belongs. This is a required field in both examples above but is optional in the context of defining the data source.
name String
The name of the record, which can be an empty string for a root record. Cannot be used with record_id.
projectId String
). The ID of the Project associated with the domain.
recordId String
The unique identifier of the record. Cannot be used with name, type, and data.
type String
The type of the record (A, AAAA, MX, CNAME, etc.). Cannot be used with record_id.

getRecord Result

The following output properties are available:

Fqdn string
GeoIps List<Pulumiverse.Scaleway.Domain.Outputs.GetRecordGeoIp>
Information about dynamic records based on user geolocation. Find out more about dynamic records.
HttpServices List<Pulumiverse.Scaleway.Domain.Outputs.GetRecordHttpService>
Information about dynamic records based on URL resolution. Find out more about dynamic records.
Id string
The provider-assigned unique ID for this managed resource.
KeepEmptyZone bool
Priority int
The priority of the record, mainly used with MX records.
RootZone bool
Ttl int
The Time To Live (TTL) of the record in seconds.
Views List<Pulumiverse.Scaleway.Domain.Outputs.GetRecordView>
Information about dynamic records based on the client’s (resolver) subnet. Find out more about dynamic records.
Weighteds List<Pulumiverse.Scaleway.Domain.Outputs.GetRecordWeighted>
Information about dynamic records based on IP weights. Find out more about dynamic records.
Data string
DnsZone string
Name string
ProjectId string
RecordId string
Type string
Fqdn string
GeoIps []GetRecordGeoIp
Information about dynamic records based on user geolocation. Find out more about dynamic records.
HttpServices []GetRecordHttpService
Information about dynamic records based on URL resolution. Find out more about dynamic records.
Id string
The provider-assigned unique ID for this managed resource.
KeepEmptyZone bool
Priority int
The priority of the record, mainly used with MX records.
RootZone bool
Ttl int
The Time To Live (TTL) of the record in seconds.
Views []GetRecordView
Information about dynamic records based on the client’s (resolver) subnet. Find out more about dynamic records.
Weighteds []GetRecordWeighted
Information about dynamic records based on IP weights. Find out more about dynamic records.
Data string
DnsZone string
Name string
ProjectId string
RecordId string
Type string
fqdn String
geoIps List<GetRecordGeoIp>
Information about dynamic records based on user geolocation. Find out more about dynamic records.
httpServices List<GetRecordHttpService>
Information about dynamic records based on URL resolution. Find out more about dynamic records.
id String
The provider-assigned unique ID for this managed resource.
keepEmptyZone Boolean
priority Integer
The priority of the record, mainly used with MX records.
rootZone Boolean
ttl Integer
The Time To Live (TTL) of the record in seconds.
views List<GetRecordView>
Information about dynamic records based on the client’s (resolver) subnet. Find out more about dynamic records.
weighteds List<GetRecordWeighted>
Information about dynamic records based on IP weights. Find out more about dynamic records.
data String
dnsZone String
name String
projectId String
recordId String
type String
fqdn string
geoIps GetRecordGeoIp[]
Information about dynamic records based on user geolocation. Find out more about dynamic records.
httpServices GetRecordHttpService[]
Information about dynamic records based on URL resolution. Find out more about dynamic records.
id string
The provider-assigned unique ID for this managed resource.
keepEmptyZone boolean
priority number
The priority of the record, mainly used with MX records.
rootZone boolean
ttl number
The Time To Live (TTL) of the record in seconds.
views GetRecordView[]
Information about dynamic records based on the client’s (resolver) subnet. Find out more about dynamic records.
weighteds GetRecordWeighted[]
Information about dynamic records based on IP weights. Find out more about dynamic records.
data string
dnsZone string
name string
projectId string
recordId string
type string
fqdn str
geo_ips Sequence[GetRecordGeoIp]
Information about dynamic records based on user geolocation. Find out more about dynamic records.
http_services Sequence[GetRecordHttpService]
Information about dynamic records based on URL resolution. Find out more about dynamic records.
id str
The provider-assigned unique ID for this managed resource.
keep_empty_zone bool
priority int
The priority of the record, mainly used with MX records.
root_zone bool
ttl int
The Time To Live (TTL) of the record in seconds.
views Sequence[GetRecordView]
Information about dynamic records based on the client’s (resolver) subnet. Find out more about dynamic records.
weighteds Sequence[GetRecordWeighted]
Information about dynamic records based on IP weights. Find out more about dynamic records.
data str
dns_zone str
name str
project_id str
record_id str
type str
fqdn String
geoIps List<Property Map>
Information about dynamic records based on user geolocation. Find out more about dynamic records.
httpServices List<Property Map>
Information about dynamic records based on URL resolution. Find out more about dynamic records.
id String
The provider-assigned unique ID for this managed resource.
keepEmptyZone Boolean
priority Number
The priority of the record, mainly used with MX records.
rootZone Boolean
ttl Number
The Time To Live (TTL) of the record in seconds.
views List<Property Map>
Information about dynamic records based on the client’s (resolver) subnet. Find out more about dynamic records.
weighteds List<Property Map>
Information about dynamic records based on IP weights. Find out more about dynamic records.
data String
dnsZone String
name String
projectId String
recordId String
type String

Supporting Types

GetRecordGeoIp

Matches This property is required. List<Pulumiverse.Scaleway.Domain.Inputs.GetRecordGeoIpMatch>
The list of matches
Matches This property is required. []GetRecordGeoIpMatch
The list of matches
matches This property is required. List<GetRecordGeoIpMatch>
The list of matches
matches This property is required. GetRecordGeoIpMatch[]
The list of matches
matches This property is required. Sequence[GetRecordGeoIpMatch]
The list of matches
matches This property is required. List<Property Map>
The list of matches

GetRecordGeoIpMatch

Continents This property is required. List<string>
List of continents (eg: EU for Europe, NA for North America, AS for Asia...). List of all continents code: https://api.scaleway.com/domain-private/v2beta1/continents
Countries This property is required. List<string>
List of countries (eg: FR for France, US for the United States, GB for Great Britain...). List of all countries code: https://api.scaleway.com/domain-private/v2beta1/countries
Data This property is required. string
The content of the record (e.g., an IPv4 address for an A record or a string for a TXT record). Cannot be used with record_id.
Continents This property is required. []string
List of continents (eg: EU for Europe, NA for North America, AS for Asia...). List of all continents code: https://api.scaleway.com/domain-private/v2beta1/continents
Countries This property is required. []string
List of countries (eg: FR for France, US for the United States, GB for Great Britain...). List of all countries code: https://api.scaleway.com/domain-private/v2beta1/countries
Data This property is required. string
The content of the record (e.g., an IPv4 address for an A record or a string for a TXT record). Cannot be used with record_id.
continents This property is required. List<String>
List of continents (eg: EU for Europe, NA for North America, AS for Asia...). List of all continents code: https://api.scaleway.com/domain-private/v2beta1/continents
countries This property is required. List<String>
List of countries (eg: FR for France, US for the United States, GB for Great Britain...). List of all countries code: https://api.scaleway.com/domain-private/v2beta1/countries
data This property is required. String
The content of the record (e.g., an IPv4 address for an A record or a string for a TXT record). Cannot be used with record_id.
continents This property is required. string[]
List of continents (eg: EU for Europe, NA for North America, AS for Asia...). List of all continents code: https://api.scaleway.com/domain-private/v2beta1/continents
countries This property is required. string[]
List of countries (eg: FR for France, US for the United States, GB for Great Britain...). List of all countries code: https://api.scaleway.com/domain-private/v2beta1/countries
data This property is required. string
The content of the record (e.g., an IPv4 address for an A record or a string for a TXT record). Cannot be used with record_id.
continents This property is required. Sequence[str]
List of continents (eg: EU for Europe, NA for North America, AS for Asia...). List of all continents code: https://api.scaleway.com/domain-private/v2beta1/continents
countries This property is required. Sequence[str]
List of countries (eg: FR for France, US for the United States, GB for Great Britain...). List of all countries code: https://api.scaleway.com/domain-private/v2beta1/countries
data This property is required. str
The content of the record (e.g., an IPv4 address for an A record or a string for a TXT record). Cannot be used with record_id.
continents This property is required. List<String>
List of continents (eg: EU for Europe, NA for North America, AS for Asia...). List of all continents code: https://api.scaleway.com/domain-private/v2beta1/continents
countries This property is required. List<String>
List of countries (eg: FR for France, US for the United States, GB for Great Britain...). List of all countries code: https://api.scaleway.com/domain-private/v2beta1/countries
data This property is required. String
The content of the record (e.g., an IPv4 address for an A record or a string for a TXT record). Cannot be used with record_id.

GetRecordHttpService

Ips This property is required. List<string>
IPs to check
MustContain This property is required. string
Text to search
Strategy This property is required. string
Strategy to return an IP from the IPs list
Url This property is required. string
URL to match the must_contain text to validate an IP
UserAgent This property is required. string
User-agent used when checking the URL
Ips This property is required. []string
IPs to check
MustContain This property is required. string
Text to search
Strategy This property is required. string
Strategy to return an IP from the IPs list
Url This property is required. string
URL to match the must_contain text to validate an IP
UserAgent This property is required. string
User-agent used when checking the URL
ips This property is required. List<String>
IPs to check
mustContain This property is required. String
Text to search
strategy This property is required. String
Strategy to return an IP from the IPs list
url This property is required. String
URL to match the must_contain text to validate an IP
userAgent This property is required. String
User-agent used when checking the URL
ips This property is required. string[]
IPs to check
mustContain This property is required. string
Text to search
strategy This property is required. string
Strategy to return an IP from the IPs list
url This property is required. string
URL to match the must_contain text to validate an IP
userAgent This property is required. string
User-agent used when checking the URL
ips This property is required. Sequence[str]
IPs to check
must_contain This property is required. str
Text to search
strategy This property is required. str
Strategy to return an IP from the IPs list
url This property is required. str
URL to match the must_contain text to validate an IP
user_agent This property is required. str
User-agent used when checking the URL
ips This property is required. List<String>
IPs to check
mustContain This property is required. String
Text to search
strategy This property is required. String
Strategy to return an IP from the IPs list
url This property is required. String
URL to match the must_contain text to validate an IP
userAgent This property is required. String
User-agent used when checking the URL

GetRecordView

Data This property is required. string
The content of the record (e.g., an IPv4 address for an A record or a string for a TXT record). Cannot be used with record_id.
Subnet This property is required. string
The subnet of the view
Data This property is required. string
The content of the record (e.g., an IPv4 address for an A record or a string for a TXT record). Cannot be used with record_id.
Subnet This property is required. string
The subnet of the view
data This property is required. String
The content of the record (e.g., an IPv4 address for an A record or a string for a TXT record). Cannot be used with record_id.
subnet This property is required. String
The subnet of the view
data This property is required. string
The content of the record (e.g., an IPv4 address for an A record or a string for a TXT record). Cannot be used with record_id.
subnet This property is required. string
The subnet of the view
data This property is required. str
The content of the record (e.g., an IPv4 address for an A record or a string for a TXT record). Cannot be used with record_id.
subnet This property is required. str
The subnet of the view
data This property is required. String
The content of the record (e.g., an IPv4 address for an A record or a string for a TXT record). Cannot be used with record_id.
subnet This property is required. String
The subnet of the view

GetRecordWeighted

Ip This property is required. string
The weighted IP
Weight This property is required. int
The weight of the IP
Ip This property is required. string
The weighted IP
Weight This property is required. int
The weight of the IP
ip This property is required. String
The weighted IP
weight This property is required. Integer
The weight of the IP
ip This property is required. string
The weighted IP
weight This property is required. number
The weight of the IP
ip This property is required. str
The weighted IP
weight This property is required. int
The weight of the IP
ip This property is required. String
The weighted IP
weight This property is required. Number
The weight of the IP

Package Details

Repository
scaleway pulumiverse/pulumi-scaleway
License
Apache-2.0
Notes
This Pulumi package is based on the scaleway Terraform Provider.
Scaleway v1.26.0 published on Friday, Mar 28, 2025 by pulumiverse