Scaleway v1.20.0 published on Monday, Nov 4, 2024 by pulumiverse
scaleway.getDomainRecord
Explore with Pulumi AI
The scaleway.DomainRecord
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.getDomainRecord({
dnsZone: "domain.tld",
name: "www",
type: "A",
data: "1.2.3.4",
});
// Query record by DNS zone and record ID
const byId = scaleway.getDomainRecord({
dnsZone: "domain.tld",
recordId: "11111111-1111-1111-1111-111111111111",
});
import pulumi
import pulumi_scaleway as scaleway
# Query record by DNS zone, record name, type and content
by_content = scaleway.get_domain_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.get_domain_record(dns_zone="domain.tld",
record_id="11111111-1111-1111-1111-111111111111")
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Query record by DNS zone, record name, type and content
_, err := scaleway.LookupDomainRecord(ctx, &scaleway.LookupDomainRecordArgs{
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 = scaleway.LookupDomainRecord(ctx, &scaleway.LookupDomainRecordArgs{
DnsZone: pulumi.StringRef("domain.tld"),
RecordId: pulumi.StringRef("11111111-1111-1111-1111-111111111111"),
}, nil)
if err != nil {
return err
}
return nil
})
}
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.GetDomainRecord.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.GetDomainRecord.Invoke(new()
{
DnsZone = "domain.tld",
RecordId = "11111111-1111-1111-1111-111111111111",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.ScalewayFunctions;
import com.pulumi.scaleway.inputs.GetDomainRecordArgs;
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 = ScalewayFunctions.getDomainRecord(GetDomainRecordArgs.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 = ScalewayFunctions.getDomainRecord(GetDomainRecordArgs.builder()
.dnsZone("domain.tld")
.recordId("11111111-1111-1111-1111-111111111111")
.build());
}
}
variables:
# Query record by DNS zone, record name, type and content
byContent:
fn::invoke:
Function: scaleway:getDomainRecord
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:getDomainRecord
Arguments:
dnsZone: domain.tld
recordId: 11111111-1111-1111-1111-111111111111
Using getDomainRecord
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 getDomainRecord(args: GetDomainRecordArgs, opts?: InvokeOptions): Promise<GetDomainRecordResult>
function getDomainRecordOutput(args: GetDomainRecordOutputArgs, opts?: InvokeOptions): Output<GetDomainRecordResult>
def get_domain_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) -> GetDomainRecordResult
def get_domain_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[GetDomainRecordResult]
func LookupDomainRecord(ctx *Context, args *LookupDomainRecordArgs, opts ...InvokeOption) (*LookupDomainRecordResult, error)
func LookupDomainRecordOutput(ctx *Context, args *LookupDomainRecordOutputArgs, opts ...InvokeOption) LookupDomainRecordResultOutput
> Note: This function is named LookupDomainRecord
in the Go SDK.
public static class GetDomainRecord
{
public static Task<GetDomainRecordResult> InvokeAsync(GetDomainRecordArgs args, InvokeOptions? opts = null)
public static Output<GetDomainRecordResult> Invoke(GetDomainRecordInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDomainRecordResult> getDomainRecord(GetDomainRecordArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: scaleway:index/getDomainRecord:getDomainRecord
arguments:
# arguments dictionary
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 aTXT
record). Cannot be used withrecord_id
. - Dns
Zone 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
. - Project
Id string - ). The ID of the Project associated with the domain.
- Record
Id string - The unique identifier of the record. Cannot be used with
name
,type
, anddata
. - Type string
- The type of the record (
A
,AAAA
,MX
,CNAME
, etc.). Cannot be used withrecord_id
.
- Data string
- The content of the record (e.g., an IPv4 address for an
A
record or a string for aTXT
record). Cannot be used withrecord_id
. - Dns
Zone 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
. - Project
Id string - ). The ID of the Project associated with the domain.
- Record
Id string - The unique identifier of the record. Cannot be used with
name
,type
, anddata
. - Type string
- The type of the record (
A
,AAAA
,MX
,CNAME
, etc.). Cannot be used withrecord_id
.
- data String
- The content of the record (e.g., an IPv4 address for an
A
record or a string for aTXT
record). Cannot be used withrecord_id
. - dns
Zone 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
. - project
Id String - ). The ID of the Project associated with the domain.
- record
Id String - The unique identifier of the record. Cannot be used with
name
,type
, anddata
. - type String
- The type of the record (
A
,AAAA
,MX
,CNAME
, etc.). Cannot be used withrecord_id
.
- data string
- The content of the record (e.g., an IPv4 address for an
A
record or a string for aTXT
record). Cannot be used withrecord_id
. - dns
Zone 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
. - project
Id string - ). The ID of the Project associated with the domain.
- record
Id string - The unique identifier of the record. Cannot be used with
name
,type
, anddata
. - type string
- The type of the record (
A
,AAAA
,MX
,CNAME
, etc.). Cannot be used withrecord_id
.
- data str
- The content of the record (e.g., an IPv4 address for an
A
record or a string for aTXT
record). Cannot be used withrecord_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
, anddata
. - type str
- The type of the record (
A
,AAAA
,MX
,CNAME
, etc.). Cannot be used withrecord_id
.
- data String
- The content of the record (e.g., an IPv4 address for an
A
record or a string for aTXT
record). Cannot be used withrecord_id
. - dns
Zone 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
. - project
Id String - ). The ID of the Project associated with the domain.
- record
Id String - The unique identifier of the record. Cannot be used with
name
,type
, anddata
. - type String
- The type of the record (
A
,AAAA
,MX
,CNAME
, etc.). Cannot be used withrecord_id
.
getDomainRecord Result
The following output properties are available:
- Fqdn string
- Geo
Ips List<Pulumiverse.Scaleway. Outputs. Get Domain Record Geo Ip> - Information about dynamic records based on user geolocation. Find out more about dynamic records.
- Http
Services List<Pulumiverse.Scaleway. Outputs. Get Domain Record Http Service> - 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.
- Keep
Empty boolZone - 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
List<Pulumiverse.
Scaleway. Outputs. Get Domain Record View> - Information about dynamic records based on the client’s (resolver) subnet. Find out more about dynamic records.
- Weighteds
List<Pulumiverse.
Scaleway. Outputs. Get Domain Record Weighted> - Information about dynamic records based on IP weights. Find out more about dynamic records.
- Data string
- Dns
Zone string - Name string
- Project
Id string - Record
Id string - Type string
- Fqdn string
- Geo
Ips []GetDomain Record Geo Ip - Information about dynamic records based on user geolocation. Find out more about dynamic records.
- Http
Services []GetDomain Record Http Service - 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.
- Keep
Empty boolZone - 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
[]Get
Domain Record View - Information about dynamic records based on the client’s (resolver) subnet. Find out more about dynamic records.
- Weighteds
[]Get
Domain Record Weighted - Information about dynamic records based on IP weights. Find out more about dynamic records.
- Data string
- Dns
Zone string - Name string
- Project
Id string - Record
Id string - Type string
- fqdn String
- geo
Ips List<GetDomain Record Geo Ip> - Information about dynamic records based on user geolocation. Find out more about dynamic records.
- http
Services List<GetDomain Record Http Service> - 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.
- keep
Empty BooleanZone - priority Integer
- The priority of the record, mainly used with
MX
records. - root
Zone Boolean - ttl Integer
- The Time To Live (TTL) of the record in seconds.
- views
List<Get
Domain Record View> - Information about dynamic records based on the client’s (resolver) subnet. Find out more about dynamic records.
- weighteds
List<Get
Domain Record Weighted> - Information about dynamic records based on IP weights. Find out more about dynamic records.
- data String
- dns
Zone String - name String
- project
Id String - record
Id String - type String
- fqdn string
- geo
Ips GetDomain Record Geo Ip[] - Information about dynamic records based on user geolocation. Find out more about dynamic records.
- http
Services GetDomain Record Http Service[] - 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.
- keep
Empty booleanZone - priority number
- The priority of the record, mainly used with
MX
records. - root
Zone boolean - ttl number
- The Time To Live (TTL) of the record in seconds.
- views
Get
Domain Record View[] - Information about dynamic records based on the client’s (resolver) subnet. Find out more about dynamic records.
- weighteds
Get
Domain Record Weighted[] - Information about dynamic records based on IP weights. Find out more about dynamic records.
- data string
- dns
Zone string - name string
- project
Id string - record
Id string - type string
- fqdn str
- geo_
ips Sequence[GetDomain Record Geo Ip] - Information about dynamic records based on user geolocation. Find out more about dynamic records.
- http_
services Sequence[GetDomain Record Http Service] - 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_ boolzone - 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[Get
Domain Record View] - Information about dynamic records based on the client’s (resolver) subnet. Find out more about dynamic records.
- weighteds
Sequence[Get
Domain Record Weighted] - 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
- geo
Ips List<Property Map> - Information about dynamic records based on user geolocation. Find out more about dynamic records.
- http
Services 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.
- keep
Empty BooleanZone - priority Number
- The priority of the record, mainly used with
MX
records. - root
Zone 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
- dns
Zone String - name String
- project
Id String - record
Id String - type String
Supporting Types
GetDomainRecordGeoIp
- Matches
List<Pulumiverse.
Scaleway. Inputs. Get Domain Record Geo Ip Match> - The list of matches
- Matches
[]Get
Domain Record Geo Ip Match - The list of matches
- matches
List<Get
Domain Record Geo Ip Match> - The list of matches
- matches
Get
Domain Record Geo Ip Match[] - The list of matches
- matches
Sequence[Get
Domain Record Geo Ip Match] - The list of matches
- matches List<Property Map>
- The list of matches
GetDomainRecordGeoIpMatch
- Continents 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 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 string
- The content of the record (e.g., an IPv4 address for an
A
record or a string for aTXT
record). Cannot be used withrecord_id
.
- Continents []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 []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 string
- The content of the record (e.g., an IPv4 address for an
A
record or a string for aTXT
record). Cannot be used withrecord_id
.
- continents 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 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 String
- The content of the record (e.g., an IPv4 address for an
A
record or a string for aTXT
record). Cannot be used withrecord_id
.
- continents 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 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 string
- The content of the record (e.g., an IPv4 address for an
A
record or a string for aTXT
record). Cannot be used withrecord_id
.
- continents 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 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 str
- The content of the record (e.g., an IPv4 address for an
A
record or a string for aTXT
record). Cannot be used withrecord_id
.
- continents 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 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 String
- The content of the record (e.g., an IPv4 address for an
A
record or a string for aTXT
record). Cannot be used withrecord_id
.
GetDomainRecordHttpService
- Ips List<string>
- IPs to check
- Must
Contain string - Text to search
- Strategy string
- Strategy to return an IP from the IPs list
- Url string
- URL to match the must_contain text to validate an IP
- User
Agent string - User-agent used when checking the URL
- Ips []string
- IPs to check
- Must
Contain string - Text to search
- Strategy string
- Strategy to return an IP from the IPs list
- Url string
- URL to match the must_contain text to validate an IP
- User
Agent string - User-agent used when checking the URL
- ips List<String>
- IPs to check
- must
Contain String - Text to search
- strategy String
- Strategy to return an IP from the IPs list
- url String
- URL to match the must_contain text to validate an IP
- user
Agent String - User-agent used when checking the URL
- ips string[]
- IPs to check
- must
Contain string - Text to search
- strategy string
- Strategy to return an IP from the IPs list
- url string
- URL to match the must_contain text to validate an IP
- user
Agent string - User-agent used when checking the URL
- ips Sequence[str]
- IPs to check
- must_
contain str - Text to search
- strategy str
- Strategy to return an IP from the IPs list
- url str
- URL to match the must_contain text to validate an IP
- user_
agent str - User-agent used when checking the URL
- ips List<String>
- IPs to check
- must
Contain String - Text to search
- strategy String
- Strategy to return an IP from the IPs list
- url String
- URL to match the must_contain text to validate an IP
- user
Agent String - User-agent used when checking the URL
GetDomainRecordView
GetDomainRecordWeighted
Package Details
- Repository
- scaleway pulumiverse/pulumi-scaleway
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
scaleway
Terraform Provider.