1. Packages
  2. Scaleway
  3. API Docs
  4. DomainRecord
Scaleway v1.20.0 published on Monday, Nov 4, 2024 by pulumiverse

scaleway.DomainRecord

Explore with Pulumi AI

scaleway logo
Scaleway v1.20.0 published on Monday, Nov 4, 2024 by pulumiverse

    The scaleway.DomainRecord resource allows you to create and manage DNS records for Scaleway domains.

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

    Example Usage

    Create basic DNS records

    The folllowing commands allow you to:

    • create an A record for the www.domain.tld domain, pointing to 1.2.3.4 and another one pointing to 1.2.3.5

    • create an MX record with the mx.online.net. mail server and a priority of 10, and another one with the mx-cache.online.net. mail server and a priority of 20

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    const www = new scaleway.DomainRecord("www", {
        dnsZone: "domain.tld",
        name: "www",
        type: "A",
        data: "1.2.3.4",
        ttl: 3600,
    });
    const www2 = new scaleway.DomainRecord("www2", {
        dnsZone: "domain.tld",
        name: "www",
        type: "A",
        data: "1.2.3.5",
        ttl: 3600,
    });
    const mx = new scaleway.DomainRecord("mx", {
        dnsZone: "domain.tld",
        name: "",
        type: "MX",
        data: "mx.online.net.",
        ttl: 3600,
        priority: 10,
    });
    const mx2 = new scaleway.DomainRecord("mx2", {
        dnsZone: "domain.tld",
        name: "",
        type: "MX",
        data: "mx-cache.online.net.",
        ttl: 3600,
        priority: 20,
    });
    
    import pulumi
    import pulumiverse_scaleway as scaleway
    
    www = scaleway.DomainRecord("www",
        dns_zone="domain.tld",
        name="www",
        type="A",
        data="1.2.3.4",
        ttl=3600)
    www2 = scaleway.DomainRecord("www2",
        dns_zone="domain.tld",
        name="www",
        type="A",
        data="1.2.3.5",
        ttl=3600)
    mx = scaleway.DomainRecord("mx",
        dns_zone="domain.tld",
        name="",
        type="MX",
        data="mx.online.net.",
        ttl=3600,
        priority=10)
    mx2 = scaleway.DomainRecord("mx2",
        dns_zone="domain.tld",
        name="",
        type="MX",
        data="mx-cache.online.net.",
        ttl=3600,
        priority=20)
    
    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 {
    		_, err := scaleway.NewDomainRecord(ctx, "www", &scaleway.DomainRecordArgs{
    			DnsZone: pulumi.String("domain.tld"),
    			Name:    pulumi.String("www"),
    			Type:    pulumi.String("A"),
    			Data:    pulumi.String("1.2.3.4"),
    			Ttl:     pulumi.Int(3600),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = scaleway.NewDomainRecord(ctx, "www2", &scaleway.DomainRecordArgs{
    			DnsZone: pulumi.String("domain.tld"),
    			Name:    pulumi.String("www"),
    			Type:    pulumi.String("A"),
    			Data:    pulumi.String("1.2.3.5"),
    			Ttl:     pulumi.Int(3600),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = scaleway.NewDomainRecord(ctx, "mx", &scaleway.DomainRecordArgs{
    			DnsZone:  pulumi.String("domain.tld"),
    			Name:     pulumi.String(""),
    			Type:     pulumi.String("MX"),
    			Data:     pulumi.String("mx.online.net."),
    			Ttl:      pulumi.Int(3600),
    			Priority: pulumi.Int(10),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = scaleway.NewDomainRecord(ctx, "mx2", &scaleway.DomainRecordArgs{
    			DnsZone:  pulumi.String("domain.tld"),
    			Name:     pulumi.String(""),
    			Type:     pulumi.String("MX"),
    			Data:     pulumi.String("mx-cache.online.net."),
    			Ttl:      pulumi.Int(3600),
    			Priority: pulumi.Int(20),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Pulumiverse.Scaleway;
    
    return await Deployment.RunAsync(() => 
    {
        var www = new Scaleway.DomainRecord("www", new()
        {
            DnsZone = "domain.tld",
            Name = "www",
            Type = "A",
            Data = "1.2.3.4",
            Ttl = 3600,
        });
    
        var www2 = new Scaleway.DomainRecord("www2", new()
        {
            DnsZone = "domain.tld",
            Name = "www",
            Type = "A",
            Data = "1.2.3.5",
            Ttl = 3600,
        });
    
        var mx = new Scaleway.DomainRecord("mx", new()
        {
            DnsZone = "domain.tld",
            Name = "",
            Type = "MX",
            Data = "mx.online.net.",
            Ttl = 3600,
            Priority = 10,
        });
    
        var mx2 = new Scaleway.DomainRecord("mx2", new()
        {
            DnsZone = "domain.tld",
            Name = "",
            Type = "MX",
            Data = "mx-cache.online.net.",
            Ttl = 3600,
            Priority = 20,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.DomainRecord;
    import com.pulumi.scaleway.DomainRecordArgs;
    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) {
            var www = new DomainRecord("www", DomainRecordArgs.builder()
                .dnsZone("domain.tld")
                .name("www")
                .type("A")
                .data("1.2.3.4")
                .ttl(3600)
                .build());
    
            var www2 = new DomainRecord("www2", DomainRecordArgs.builder()
                .dnsZone("domain.tld")
                .name("www")
                .type("A")
                .data("1.2.3.5")
                .ttl(3600)
                .build());
    
            var mx = new DomainRecord("mx", DomainRecordArgs.builder()
                .dnsZone("domain.tld")
                .name("")
                .type("MX")
                .data("mx.online.net.")
                .ttl(3600)
                .priority(10)
                .build());
    
            var mx2 = new DomainRecord("mx2", DomainRecordArgs.builder()
                .dnsZone("domain.tld")
                .name("")
                .type("MX")
                .data("mx-cache.online.net.")
                .ttl(3600)
                .priority(20)
                .build());
    
        }
    }
    
    resources:
      www:
        type: scaleway:DomainRecord
        properties:
          dnsZone: domain.tld
          name: www
          type: A
          data: 1.2.3.4
          ttl: 3600
      www2:
        type: scaleway:DomainRecord
        properties:
          dnsZone: domain.tld
          name: www
          type: A
          data: 1.2.3.5
          ttl: 3600
      mx:
        type: scaleway:DomainRecord
        properties:
          dnsZone: domain.tld
          name:
          type: MX
          data: mx.online.net.
          ttl: 3600
          priority: 10
      mx2:
        type: scaleway:DomainRecord
        properties:
          dnsZone: domain.tld
          name:
          type: MX
          data: mx-cache.online.net.
          ttl: 3600
          priority: 20
    

    Create dynamic records

    The folllowing commands allow you to:

    • create a Geo IP record for images.domain.tld that points to different IPs based on the user’s location: 1.2.3.5 for users in France (EU), and 4.3.2.1 for users in North America (NA)

    • create an HTTP service record for app.domain.tld that checks the health of specified IPs and responds based on their status.

    • create view-based records for db.domain.tld that resolve differently based on the client’s subnet.

    • create a weighted record for web.domain.tld that directs traffic to different IPs based on their weights.

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    const geoIp = new scaleway.DomainRecord("geo_ip", {
        dnsZone: "domain.tld",
        name: "images",
        type: "A",
        data: "1.2.3.4",
        ttl: 3600,
        geoIp: {
            matches: [
                {
                    continents: ["EU"],
                    countries: ["FR"],
                    data: "1.2.3.5",
                },
                {
                    continents: ["NA"],
                    data: "4.3.2.1",
                },
            ],
        },
    });
    const httpService = new scaleway.DomainRecord("http_service", {
        dnsZone: "domain.tld",
        name: "app",
        type: "A",
        data: "1.2.3.4",
        ttl: 3600,
        httpService: {
            ips: [
                "1.2.3.5",
                "1.2.3.6",
            ],
            mustContain: "up",
            url: "http://mywebsite.com/health",
            userAgent: "scw_service_up",
            strategy: "hashed",
        },
    });
    const view = new scaleway.DomainRecord("view", {
        dnsZone: "domain.tld",
        name: "db",
        type: "A",
        data: "1.2.3.4",
        ttl: 3600,
        views: [
            {
                subnet: "100.0.0.0/16",
                data: "1.2.3.5",
            },
            {
                subnet: "100.1.0.0/16",
                data: "1.2.3.6",
            },
        ],
    });
    const weighted = new scaleway.DomainRecord("weighted", {
        dnsZone: "domain.tld",
        name: "web",
        type: "A",
        data: "1.2.3.4",
        ttl: 3600,
        weighteds: [
            {
                ip: "1.2.3.5",
                weight: 1,
            },
            {
                ip: "1.2.3.6",
                weight: 2,
            },
        ],
    });
    
    import pulumi
    import pulumiverse_scaleway as scaleway
    
    geo_ip = scaleway.DomainRecord("geo_ip",
        dns_zone="domain.tld",
        name="images",
        type="A",
        data="1.2.3.4",
        ttl=3600,
        geo_ip={
            "matches": [
                {
                    "continents": ["EU"],
                    "countries": ["FR"],
                    "data": "1.2.3.5",
                },
                {
                    "continents": ["NA"],
                    "data": "4.3.2.1",
                },
            ],
        })
    http_service = scaleway.DomainRecord("http_service",
        dns_zone="domain.tld",
        name="app",
        type="A",
        data="1.2.3.4",
        ttl=3600,
        http_service={
            "ips": [
                "1.2.3.5",
                "1.2.3.6",
            ],
            "must_contain": "up",
            "url": "http://mywebsite.com/health",
            "user_agent": "scw_service_up",
            "strategy": "hashed",
        })
    view = scaleway.DomainRecord("view",
        dns_zone="domain.tld",
        name="db",
        type="A",
        data="1.2.3.4",
        ttl=3600,
        views=[
            {
                "subnet": "100.0.0.0/16",
                "data": "1.2.3.5",
            },
            {
                "subnet": "100.1.0.0/16",
                "data": "1.2.3.6",
            },
        ])
    weighted = scaleway.DomainRecord("weighted",
        dns_zone="domain.tld",
        name="web",
        type="A",
        data="1.2.3.4",
        ttl=3600,
        weighteds=[
            {
                "ip": "1.2.3.5",
                "weight": 1,
            },
            {
                "ip": "1.2.3.6",
                "weight": 2,
            },
        ])
    
    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 {
    		_, err := scaleway.NewDomainRecord(ctx, "geo_ip", &scaleway.DomainRecordArgs{
    			DnsZone: pulumi.String("domain.tld"),
    			Name:    pulumi.String("images"),
    			Type:    pulumi.String("A"),
    			Data:    pulumi.String("1.2.3.4"),
    			Ttl:     pulumi.Int(3600),
    			GeoIp: &scaleway.DomainRecordGeoIpArgs{
    				Matches: scaleway.DomainRecordGeoIpMatchArray{
    					&scaleway.DomainRecordGeoIpMatchArgs{
    						Continents: pulumi.StringArray{
    							pulumi.String("EU"),
    						},
    						Countries: pulumi.StringArray{
    							pulumi.String("FR"),
    						},
    						Data: pulumi.String("1.2.3.5"),
    					},
    					&scaleway.DomainRecordGeoIpMatchArgs{
    						Continents: pulumi.StringArray{
    							pulumi.String("NA"),
    						},
    						Data: pulumi.String("4.3.2.1"),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = scaleway.NewDomainRecord(ctx, "http_service", &scaleway.DomainRecordArgs{
    			DnsZone: pulumi.String("domain.tld"),
    			Name:    pulumi.String("app"),
    			Type:    pulumi.String("A"),
    			Data:    pulumi.String("1.2.3.4"),
    			Ttl:     pulumi.Int(3600),
    			HttpService: &scaleway.DomainRecordHttpServiceArgs{
    				Ips: pulumi.StringArray{
    					pulumi.String("1.2.3.5"),
    					pulumi.String("1.2.3.6"),
    				},
    				MustContain: pulumi.String("up"),
    				Url:         pulumi.String("http://mywebsite.com/health"),
    				UserAgent:   pulumi.String("scw_service_up"),
    				Strategy:    pulumi.String("hashed"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = scaleway.NewDomainRecord(ctx, "view", &scaleway.DomainRecordArgs{
    			DnsZone: pulumi.String("domain.tld"),
    			Name:    pulumi.String("db"),
    			Type:    pulumi.String("A"),
    			Data:    pulumi.String("1.2.3.4"),
    			Ttl:     pulumi.Int(3600),
    			Views: scaleway.DomainRecordViewArray{
    				&scaleway.DomainRecordViewArgs{
    					Subnet: pulumi.String("100.0.0.0/16"),
    					Data:   pulumi.String("1.2.3.5"),
    				},
    				&scaleway.DomainRecordViewArgs{
    					Subnet: pulumi.String("100.1.0.0/16"),
    					Data:   pulumi.String("1.2.3.6"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = scaleway.NewDomainRecord(ctx, "weighted", &scaleway.DomainRecordArgs{
    			DnsZone: pulumi.String("domain.tld"),
    			Name:    pulumi.String("web"),
    			Type:    pulumi.String("A"),
    			Data:    pulumi.String("1.2.3.4"),
    			Ttl:     pulumi.Int(3600),
    			Weighteds: scaleway.DomainRecordWeightedArray{
    				&scaleway.DomainRecordWeightedArgs{
    					Ip:     pulumi.String("1.2.3.5"),
    					Weight: pulumi.Int(1),
    				},
    				&scaleway.DomainRecordWeightedArgs{
    					Ip:     pulumi.String("1.2.3.6"),
    					Weight: pulumi.Int(2),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Pulumiverse.Scaleway;
    
    return await Deployment.RunAsync(() => 
    {
        var geoIp = new Scaleway.DomainRecord("geo_ip", new()
        {
            DnsZone = "domain.tld",
            Name = "images",
            Type = "A",
            Data = "1.2.3.4",
            Ttl = 3600,
            GeoIp = new Scaleway.Inputs.DomainRecordGeoIpArgs
            {
                Matches = new[]
                {
                    new Scaleway.Inputs.DomainRecordGeoIpMatchArgs
                    {
                        Continents = new[]
                        {
                            "EU",
                        },
                        Countries = new[]
                        {
                            "FR",
                        },
                        Data = "1.2.3.5",
                    },
                    new Scaleway.Inputs.DomainRecordGeoIpMatchArgs
                    {
                        Continents = new[]
                        {
                            "NA",
                        },
                        Data = "4.3.2.1",
                    },
                },
            },
        });
    
        var httpService = new Scaleway.DomainRecord("http_service", new()
        {
            DnsZone = "domain.tld",
            Name = "app",
            Type = "A",
            Data = "1.2.3.4",
            Ttl = 3600,
            HttpService = new Scaleway.Inputs.DomainRecordHttpServiceArgs
            {
                Ips = new[]
                {
                    "1.2.3.5",
                    "1.2.3.6",
                },
                MustContain = "up",
                Url = "http://mywebsite.com/health",
                UserAgent = "scw_service_up",
                Strategy = "hashed",
            },
        });
    
        var view = new Scaleway.DomainRecord("view", new()
        {
            DnsZone = "domain.tld",
            Name = "db",
            Type = "A",
            Data = "1.2.3.4",
            Ttl = 3600,
            Views = new[]
            {
                new Scaleway.Inputs.DomainRecordViewArgs
                {
                    Subnet = "100.0.0.0/16",
                    Data = "1.2.3.5",
                },
                new Scaleway.Inputs.DomainRecordViewArgs
                {
                    Subnet = "100.1.0.0/16",
                    Data = "1.2.3.6",
                },
            },
        });
    
        var weighted = new Scaleway.DomainRecord("weighted", new()
        {
            DnsZone = "domain.tld",
            Name = "web",
            Type = "A",
            Data = "1.2.3.4",
            Ttl = 3600,
            Weighteds = new[]
            {
                new Scaleway.Inputs.DomainRecordWeightedArgs
                {
                    Ip = "1.2.3.5",
                    Weight = 1,
                },
                new Scaleway.Inputs.DomainRecordWeightedArgs
                {
                    Ip = "1.2.3.6",
                    Weight = 2,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.DomainRecord;
    import com.pulumi.scaleway.DomainRecordArgs;
    import com.pulumi.scaleway.inputs.DomainRecordGeoIpArgs;
    import com.pulumi.scaleway.inputs.DomainRecordHttpServiceArgs;
    import com.pulumi.scaleway.inputs.DomainRecordViewArgs;
    import com.pulumi.scaleway.inputs.DomainRecordWeightedArgs;
    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) {
            var geoIp = new DomainRecord("geoIp", DomainRecordArgs.builder()
                .dnsZone("domain.tld")
                .name("images")
                .type("A")
                .data("1.2.3.4")
                .ttl(3600)
                .geoIp(DomainRecordGeoIpArgs.builder()
                    .matches(                
                        DomainRecordGeoIpMatchArgs.builder()
                            .continents("EU")
                            .countries("FR")
                            .data("1.2.3.5")
                            .build(),
                        DomainRecordGeoIpMatchArgs.builder()
                            .continents("NA")
                            .data("4.3.2.1")
                            .build())
                    .build())
                .build());
    
            var httpService = new DomainRecord("httpService", DomainRecordArgs.builder()
                .dnsZone("domain.tld")
                .name("app")
                .type("A")
                .data("1.2.3.4")
                .ttl(3600)
                .httpService(DomainRecordHttpServiceArgs.builder()
                    .ips(                
                        "1.2.3.5",
                        "1.2.3.6")
                    .mustContain("up")
                    .url("http://mywebsite.com/health")
                    .userAgent("scw_service_up")
                    .strategy("hashed")
                    .build())
                .build());
    
            var view = new DomainRecord("view", DomainRecordArgs.builder()
                .dnsZone("domain.tld")
                .name("db")
                .type("A")
                .data("1.2.3.4")
                .ttl(3600)
                .views(            
                    DomainRecordViewArgs.builder()
                        .subnet("100.0.0.0/16")
                        .data("1.2.3.5")
                        .build(),
                    DomainRecordViewArgs.builder()
                        .subnet("100.1.0.0/16")
                        .data("1.2.3.6")
                        .build())
                .build());
    
            var weighted = new DomainRecord("weighted", DomainRecordArgs.builder()
                .dnsZone("domain.tld")
                .name("web")
                .type("A")
                .data("1.2.3.4")
                .ttl(3600)
                .weighteds(            
                    DomainRecordWeightedArgs.builder()
                        .ip("1.2.3.5")
                        .weight(1)
                        .build(),
                    DomainRecordWeightedArgs.builder()
                        .ip("1.2.3.6")
                        .weight(2)
                        .build())
                .build());
    
        }
    }
    
    resources:
      geoIp:
        type: scaleway:DomainRecord
        name: geo_ip
        properties:
          dnsZone: domain.tld
          name: images
          type: A
          data: 1.2.3.4
          ttl: 3600
          geoIp:
            matches:
              - continents:
                  - EU
                countries:
                  - FR
                data: 1.2.3.5
              - continents:
                  - NA
                data: 4.3.2.1
      httpService:
        type: scaleway:DomainRecord
        name: http_service
        properties:
          dnsZone: domain.tld
          name: app
          type: A
          data: 1.2.3.4
          ttl: 3600
          httpService:
            ips:
              - 1.2.3.5
              - 1.2.3.6
            mustContain: up
            url: http://mywebsite.com/health
            userAgent: scw_service_up
            strategy: hashed
      view:
        type: scaleway:DomainRecord
        properties:
          dnsZone: domain.tld
          name: db
          type: A
          data: 1.2.3.4
          ttl: 3600
          views:
            - subnet: 100.0.0.0/16
              data: 1.2.3.5
            - subnet: 100.1.0.0/16
              data: 1.2.3.6
      weighted:
        type: scaleway:DomainRecord
        properties:
          dnsZone: domain.tld
          name: web
          type: A
          data: 1.2.3.4
          ttl: 3600
          weighteds:
            - ip: 1.2.3.5
              weight: 1
            - ip: 1.2.3.6
              weight: 2
    

    Create an Instance and add records with the new Instance IP

    The following commands allow you to:

    • create a Scaleway Instance
    • assign The Instance’s IP address to various DNS records for a specified DNS zone
    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    const config = new pulumi.Config();
    // Your project ID.
    const projectId = config.require("projectId");
    // The DNS Zone used for testing records.
    const dnsZone = config.require("dnsZone");
    const publicIp = new scaleway.InstanceIp("public_ip", {projectId: projectId});
    const web = new scaleway.InstanceServer("web", {
        projectId: projectId,
        type: "DEV1-S",
        image: "ubuntu_jammy",
        tags: [
            "front",
            "web",
        ],
        ipId: publicIp.id,
        rootVolume: {
            sizeInGb: 20,
        },
    });
    const webA = new scaleway.DomainRecord("web_A", {
        dnsZone: dnsZone,
        name: "web",
        type: "A",
        data: web.publicIp,
        ttl: 3600,
    });
    const webCname = new scaleway.DomainRecord("web_cname", {
        dnsZone: dnsZone,
        name: "www",
        type: "CNAME",
        data: `web.${dnsZone}.`,
        ttl: 3600,
    });
    const webAlias = new scaleway.DomainRecord("web_alias", {
        dnsZone: dnsZone,
        name: "",
        type: "ALIAS",
        data: `web.${dnsZone}.`,
        ttl: 3600,
    });
    
    import pulumi
    import pulumiverse_scaleway as scaleway
    
    config = pulumi.Config()
    # Your project ID.
    project_id = config.require("projectId")
    # The DNS Zone used for testing records.
    dns_zone = config.require("dnsZone")
    public_ip = scaleway.InstanceIp("public_ip", project_id=project_id)
    web = scaleway.InstanceServer("web",
        project_id=project_id,
        type="DEV1-S",
        image="ubuntu_jammy",
        tags=[
            "front",
            "web",
        ],
        ip_id=public_ip.id,
        root_volume={
            "size_in_gb": 20,
        })
    web_a = scaleway.DomainRecord("web_A",
        dns_zone=dns_zone,
        name="web",
        type="A",
        data=web.public_ip,
        ttl=3600)
    web_cname = scaleway.DomainRecord("web_cname",
        dns_zone=dns_zone,
        name="www",
        type="CNAME",
        data=f"web.{dns_zone}.",
        ttl=3600)
    web_alias = scaleway.DomainRecord("web_alias",
        dns_zone=dns_zone,
        name="",
        type="ALIAS",
        data=f"web.{dns_zone}.",
        ttl=3600)
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		// Your project ID.
    		projectId := cfg.Require("projectId")
    		// The DNS Zone used for testing records.
    		dnsZone := cfg.Require("dnsZone")
    		publicIp, err := scaleway.NewInstanceIp(ctx, "public_ip", &scaleway.InstanceIpArgs{
    			ProjectId: pulumi.String(projectId),
    		})
    		if err != nil {
    			return err
    		}
    		web, err := scaleway.NewInstanceServer(ctx, "web", &scaleway.InstanceServerArgs{
    			ProjectId: pulumi.String(projectId),
    			Type:      pulumi.String("DEV1-S"),
    			Image:     pulumi.String("ubuntu_jammy"),
    			Tags: pulumi.StringArray{
    				pulumi.String("front"),
    				pulumi.String("web"),
    			},
    			IpId: publicIp.ID(),
    			RootVolume: &scaleway.InstanceServerRootVolumeArgs{
    				SizeInGb: pulumi.Int(20),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = scaleway.NewDomainRecord(ctx, "web_A", &scaleway.DomainRecordArgs{
    			DnsZone: pulumi.String(dnsZone),
    			Name:    pulumi.String("web"),
    			Type:    pulumi.String("A"),
    			Data:    web.PublicIp,
    			Ttl:     pulumi.Int(3600),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = scaleway.NewDomainRecord(ctx, "web_cname", &scaleway.DomainRecordArgs{
    			DnsZone: pulumi.String(dnsZone),
    			Name:    pulumi.String("www"),
    			Type:    pulumi.String("CNAME"),
    			Data:    pulumi.Sprintf("web.%v.", dnsZone),
    			Ttl:     pulumi.Int(3600),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = scaleway.NewDomainRecord(ctx, "web_alias", &scaleway.DomainRecordArgs{
    			DnsZone: pulumi.String(dnsZone),
    			Name:    pulumi.String(""),
    			Type:    pulumi.String("ALIAS"),
    			Data:    pulumi.Sprintf("web.%v.", dnsZone),
    			Ttl:     pulumi.Int(3600),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Pulumiverse.Scaleway;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        // Your project ID.
        var projectId = config.Require("projectId");
        // The DNS Zone used for testing records.
        var dnsZone = config.Require("dnsZone");
        var publicIp = new Scaleway.InstanceIp("public_ip", new()
        {
            ProjectId = projectId,
        });
    
        var web = new Scaleway.InstanceServer("web", new()
        {
            ProjectId = projectId,
            Type = "DEV1-S",
            Image = "ubuntu_jammy",
            Tags = new[]
            {
                "front",
                "web",
            },
            IpId = publicIp.Id,
            RootVolume = new Scaleway.Inputs.InstanceServerRootVolumeArgs
            {
                SizeInGb = 20,
            },
        });
    
        var webA = new Scaleway.DomainRecord("web_A", new()
        {
            DnsZone = dnsZone,
            Name = "web",
            Type = "A",
            Data = web.PublicIp,
            Ttl = 3600,
        });
    
        var webCname = new Scaleway.DomainRecord("web_cname", new()
        {
            DnsZone = dnsZone,
            Name = "www",
            Type = "CNAME",
            Data = $"web.{dnsZone}.",
            Ttl = 3600,
        });
    
        var webAlias = new Scaleway.DomainRecord("web_alias", new()
        {
            DnsZone = dnsZone,
            Name = "",
            Type = "ALIAS",
            Data = $"web.{dnsZone}.",
            Ttl = 3600,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.InstanceIp;
    import com.pulumi.scaleway.InstanceIpArgs;
    import com.pulumi.scaleway.InstanceServer;
    import com.pulumi.scaleway.InstanceServerArgs;
    import com.pulumi.scaleway.inputs.InstanceServerRootVolumeArgs;
    import com.pulumi.scaleway.DomainRecord;
    import com.pulumi.scaleway.DomainRecordArgs;
    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 config = ctx.config();
            final var projectId = config.get("projectId");
            final var dnsZone = config.get("dnsZone");
            var publicIp = new InstanceIp("publicIp", InstanceIpArgs.builder()
                .projectId(projectId)
                .build());
    
            var web = new InstanceServer("web", InstanceServerArgs.builder()
                .projectId(projectId)
                .type("DEV1-S")
                .image("ubuntu_jammy")
                .tags(            
                    "front",
                    "web")
                .ipId(publicIp.id())
                .rootVolume(InstanceServerRootVolumeArgs.builder()
                    .sizeInGb(20)
                    .build())
                .build());
    
            var webA = new DomainRecord("webA", DomainRecordArgs.builder()
                .dnsZone(dnsZone)
                .name("web")
                .type("A")
                .data(web.publicIp())
                .ttl(3600)
                .build());
    
            var webCname = new DomainRecord("webCname", DomainRecordArgs.builder()
                .dnsZone(dnsZone)
                .name("www")
                .type("CNAME")
                .data(String.format("web.%s.", dnsZone))
                .ttl(3600)
                .build());
    
            var webAlias = new DomainRecord("webAlias", DomainRecordArgs.builder()
                .dnsZone(dnsZone)
                .name("")
                .type("ALIAS")
                .data(String.format("web.%s.", dnsZone))
                .ttl(3600)
                .build());
    
        }
    }
    
    configuration:
      projectId:
        type: string
      dnsZone:
        type: string
    resources:
      publicIp:
        type: scaleway:InstanceIp
        name: public_ip
        properties:
          projectId: ${projectId}
      web:
        type: scaleway:InstanceServer
        properties:
          projectId: ${projectId}
          type: DEV1-S
          image: ubuntu_jammy
          tags:
            - front
            - web
          ipId: ${publicIp.id}
          rootVolume:
            sizeInGb: 20
      webA:
        type: scaleway:DomainRecord
        name: web_A
        properties:
          dnsZone: ${dnsZone}
          name: web
          type: A
          data: ${web.publicIp}
          ttl: 3600
      webCname:
        type: scaleway:DomainRecord
        name: web_cname
        properties:
          dnsZone: ${dnsZone}
          name: www
          type: CNAME
          data: web.${dnsZone}.
          ttl: 3600
      webAlias:
        type: scaleway:DomainRecord
        name: web_alias
        properties:
          dnsZone: ${dnsZone}
          name:
          type: ALIAS
          data: web.${dnsZone}.
          ttl: 3600
    

    Multiple records

    Some record types can have multiple data with the same name (e.g., A, AAAA, MX, NS, etc.). You can duplicate a scaleway.DomainRecord resource with the same name, and the records will be added.

    Note however, that some records (e.g., CNAME, multiple dynamic records of different types) must be unique.

    Create DomainRecord Resource

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

    Constructor syntax

    new DomainRecord(name: string, args: DomainRecordArgs, opts?: CustomResourceOptions);
    @overload
    def DomainRecord(resource_name: str,
                     args: DomainRecordArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def DomainRecord(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     data: Optional[str] = None,
                     dns_zone: Optional[str] = None,
                     type: Optional[str] = None,
                     geo_ip: Optional[DomainRecordGeoIpArgs] = None,
                     http_service: Optional[DomainRecordHttpServiceArgs] = None,
                     keep_empty_zone: Optional[bool] = None,
                     name: Optional[str] = None,
                     priority: Optional[int] = None,
                     project_id: Optional[str] = None,
                     ttl: Optional[int] = None,
                     views: Optional[Sequence[DomainRecordViewArgs]] = None,
                     weighteds: Optional[Sequence[DomainRecordWeightedArgs]] = None)
    func NewDomainRecord(ctx *Context, name string, args DomainRecordArgs, opts ...ResourceOption) (*DomainRecord, error)
    public DomainRecord(string name, DomainRecordArgs args, CustomResourceOptions? opts = null)
    public DomainRecord(String name, DomainRecordArgs args)
    public DomainRecord(String name, DomainRecordArgs args, CustomResourceOptions options)
    
    type: scaleway:DomainRecord
    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 DomainRecordArgs
    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 DomainRecordArgs
    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 DomainRecordArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DomainRecordArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DomainRecordArgs
    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 domainRecordResource = new Scaleway.DomainRecord("domainRecordResource", new()
    {
        Data = "string",
        DnsZone = "string",
        Type = "string",
        GeoIp = new Scaleway.Inputs.DomainRecordGeoIpArgs
        {
            Matches = new[]
            {
                new Scaleway.Inputs.DomainRecordGeoIpMatchArgs
                {
                    Data = "string",
                    Continents = new[]
                    {
                        "string",
                    },
                    Countries = new[]
                    {
                        "string",
                    },
                },
            },
        },
        HttpService = new Scaleway.Inputs.DomainRecordHttpServiceArgs
        {
            Ips = new[]
            {
                "string",
            },
            MustContain = "string",
            Strategy = "string",
            Url = "string",
            UserAgent = "string",
        },
        KeepEmptyZone = false,
        Name = "string",
        Priority = 0,
        ProjectId = "string",
        Ttl = 0,
        Views = new[]
        {
            new Scaleway.Inputs.DomainRecordViewArgs
            {
                Data = "string",
                Subnet = "string",
            },
        },
        Weighteds = new[]
        {
            new Scaleway.Inputs.DomainRecordWeightedArgs
            {
                Ip = "string",
                Weight = 0,
            },
        },
    });
    
    example, err := scaleway.NewDomainRecord(ctx, "domainRecordResource", &scaleway.DomainRecordArgs{
    	Data:    pulumi.String("string"),
    	DnsZone: pulumi.String("string"),
    	Type:    pulumi.String("string"),
    	GeoIp: &scaleway.DomainRecordGeoIpArgs{
    		Matches: scaleway.DomainRecordGeoIpMatchArray{
    			&scaleway.DomainRecordGeoIpMatchArgs{
    				Data: pulumi.String("string"),
    				Continents: pulumi.StringArray{
    					pulumi.String("string"),
    				},
    				Countries: pulumi.StringArray{
    					pulumi.String("string"),
    				},
    			},
    		},
    	},
    	HttpService: &scaleway.DomainRecordHttpServiceArgs{
    		Ips: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    		MustContain: pulumi.String("string"),
    		Strategy:    pulumi.String("string"),
    		Url:         pulumi.String("string"),
    		UserAgent:   pulumi.String("string"),
    	},
    	KeepEmptyZone: pulumi.Bool(false),
    	Name:          pulumi.String("string"),
    	Priority:      pulumi.Int(0),
    	ProjectId:     pulumi.String("string"),
    	Ttl:           pulumi.Int(0),
    	Views: scaleway.DomainRecordViewArray{
    		&scaleway.DomainRecordViewArgs{
    			Data:   pulumi.String("string"),
    			Subnet: pulumi.String("string"),
    		},
    	},
    	Weighteds: scaleway.DomainRecordWeightedArray{
    		&scaleway.DomainRecordWeightedArgs{
    			Ip:     pulumi.String("string"),
    			Weight: pulumi.Int(0),
    		},
    	},
    })
    
    var domainRecordResource = new DomainRecord("domainRecordResource", DomainRecordArgs.builder()
        .data("string")
        .dnsZone("string")
        .type("string")
        .geoIp(DomainRecordGeoIpArgs.builder()
            .matches(DomainRecordGeoIpMatchArgs.builder()
                .data("string")
                .continents("string")
                .countries("string")
                .build())
            .build())
        .httpService(DomainRecordHttpServiceArgs.builder()
            .ips("string")
            .mustContain("string")
            .strategy("string")
            .url("string")
            .userAgent("string")
            .build())
        .keepEmptyZone(false)
        .name("string")
        .priority(0)
        .projectId("string")
        .ttl(0)
        .views(DomainRecordViewArgs.builder()
            .data("string")
            .subnet("string")
            .build())
        .weighteds(DomainRecordWeightedArgs.builder()
            .ip("string")
            .weight(0)
            .build())
        .build());
    
    domain_record_resource = scaleway.DomainRecord("domainRecordResource",
        data="string",
        dns_zone="string",
        type="string",
        geo_ip={
            "matches": [{
                "data": "string",
                "continents": ["string"],
                "countries": ["string"],
            }],
        },
        http_service={
            "ips": ["string"],
            "must_contain": "string",
            "strategy": "string",
            "url": "string",
            "user_agent": "string",
        },
        keep_empty_zone=False,
        name="string",
        priority=0,
        project_id="string",
        ttl=0,
        views=[{
            "data": "string",
            "subnet": "string",
        }],
        weighteds=[{
            "ip": "string",
            "weight": 0,
        }])
    
    const domainRecordResource = new scaleway.DomainRecord("domainRecordResource", {
        data: "string",
        dnsZone: "string",
        type: "string",
        geoIp: {
            matches: [{
                data: "string",
                continents: ["string"],
                countries: ["string"],
            }],
        },
        httpService: {
            ips: ["string"],
            mustContain: "string",
            strategy: "string",
            url: "string",
            userAgent: "string",
        },
        keepEmptyZone: false,
        name: "string",
        priority: 0,
        projectId: "string",
        ttl: 0,
        views: [{
            data: "string",
            subnet: "string",
        }],
        weighteds: [{
            ip: "string",
            weight: 0,
        }],
    });
    
    type: scaleway:DomainRecord
    properties:
        data: string
        dnsZone: string
        geoIp:
            matches:
                - continents:
                    - string
                  countries:
                    - string
                  data: string
        httpService:
            ips:
                - string
            mustContain: string
            strategy: string
            url: string
            userAgent: string
        keepEmptyZone: false
        name: string
        priority: 0
        projectId: string
        ttl: 0
        type: string
        views:
            - data: string
              subnet: string
        weighteds:
            - ip: string
              weight: 0
    

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

    Data string
    The content of the record (an IPv4 for an A record, a string for a TXT record, etc.).
    DnsZone string
    The DNS zone of the domain. If the domain has no DNS zone, one will be automatically created.
    Type string
    The type of the record (A, AAAA, MX, CNAME, DNAME, ALIAS, NS, PTR, SRV, TXT, TLSA, or CAA).
    GeoIp Pulumiverse.Scaleway.Inputs.DomainRecordGeoIp
    Return record based on client localisation
    HttpService Pulumiverse.Scaleway.Inputs.DomainRecordHttpService
    Return record based on client localisation
    KeepEmptyZone bool
    When destroying a resource, if only NS records remain and this is set to false, the zone will be deleted. Note that each zone not deleted will be billed.
    Name string
    The name of the record (can be an empty string for a root record).
    Priority int
    The priority of the record (mostly used with an MX record).
    ProjectId string
    The project_id you want to attach the resource to
    Ttl int
    Time To Live of the record in seconds.
    Views List<Pulumiverse.Scaleway.Inputs.DomainRecordView>
    Return record based on client subnet
    Weighteds List<Pulumiverse.Scaleway.Inputs.DomainRecordWeighted>
    Return record based on weight
    Data string
    The content of the record (an IPv4 for an A record, a string for a TXT record, etc.).
    DnsZone string
    The DNS zone of the domain. If the domain has no DNS zone, one will be automatically created.
    Type string
    The type of the record (A, AAAA, MX, CNAME, DNAME, ALIAS, NS, PTR, SRV, TXT, TLSA, or CAA).
    GeoIp DomainRecordGeoIpArgs
    Return record based on client localisation
    HttpService DomainRecordHttpServiceArgs
    Return record based on client localisation
    KeepEmptyZone bool
    When destroying a resource, if only NS records remain and this is set to false, the zone will be deleted. Note that each zone not deleted will be billed.
    Name string
    The name of the record (can be an empty string for a root record).
    Priority int
    The priority of the record (mostly used with an MX record).
    ProjectId string
    The project_id you want to attach the resource to
    Ttl int
    Time To Live of the record in seconds.
    Views []DomainRecordViewArgs
    Return record based on client subnet
    Weighteds []DomainRecordWeightedArgs
    Return record based on weight
    data String
    The content of the record (an IPv4 for an A record, a string for a TXT record, etc.).
    dnsZone String
    The DNS zone of the domain. If the domain has no DNS zone, one will be automatically created.
    type String
    The type of the record (A, AAAA, MX, CNAME, DNAME, ALIAS, NS, PTR, SRV, TXT, TLSA, or CAA).
    geoIp DomainRecordGeoIp
    Return record based on client localisation
    httpService DomainRecordHttpService
    Return record based on client localisation
    keepEmptyZone Boolean
    When destroying a resource, if only NS records remain and this is set to false, the zone will be deleted. Note that each zone not deleted will be billed.
    name String
    The name of the record (can be an empty string for a root record).
    priority Integer
    The priority of the record (mostly used with an MX record).
    projectId String
    The project_id you want to attach the resource to
    ttl Integer
    Time To Live of the record in seconds.
    views List<DomainRecordView>
    Return record based on client subnet
    weighteds List<DomainRecordWeighted>
    Return record based on weight
    data string
    The content of the record (an IPv4 for an A record, a string for a TXT record, etc.).
    dnsZone string
    The DNS zone of the domain. If the domain has no DNS zone, one will be automatically created.
    type string
    The type of the record (A, AAAA, MX, CNAME, DNAME, ALIAS, NS, PTR, SRV, TXT, TLSA, or CAA).
    geoIp DomainRecordGeoIp
    Return record based on client localisation
    httpService DomainRecordHttpService
    Return record based on client localisation
    keepEmptyZone boolean
    When destroying a resource, if only NS records remain and this is set to false, the zone will be deleted. Note that each zone not deleted will be billed.
    name string
    The name of the record (can be an empty string for a root record).
    priority number
    The priority of the record (mostly used with an MX record).
    projectId string
    The project_id you want to attach the resource to
    ttl number
    Time To Live of the record in seconds.
    views DomainRecordView[]
    Return record based on client subnet
    weighteds DomainRecordWeighted[]
    Return record based on weight
    data str
    The content of the record (an IPv4 for an A record, a string for a TXT record, etc.).
    dns_zone str
    The DNS zone of the domain. If the domain has no DNS zone, one will be automatically created.
    type str
    The type of the record (A, AAAA, MX, CNAME, DNAME, ALIAS, NS, PTR, SRV, TXT, TLSA, or CAA).
    geo_ip DomainRecordGeoIpArgs
    Return record based on client localisation
    http_service DomainRecordHttpServiceArgs
    Return record based on client localisation
    keep_empty_zone bool
    When destroying a resource, if only NS records remain and this is set to false, the zone will be deleted. Note that each zone not deleted will be billed.
    name str
    The name of the record (can be an empty string for a root record).
    priority int
    The priority of the record (mostly used with an MX record).
    project_id str
    The project_id you want to attach the resource to
    ttl int
    Time To Live of the record in seconds.
    views Sequence[DomainRecordViewArgs]
    Return record based on client subnet
    weighteds Sequence[DomainRecordWeightedArgs]
    Return record based on weight
    data String
    The content of the record (an IPv4 for an A record, a string for a TXT record, etc.).
    dnsZone String
    The DNS zone of the domain. If the domain has no DNS zone, one will be automatically created.
    type String
    The type of the record (A, AAAA, MX, CNAME, DNAME, ALIAS, NS, PTR, SRV, TXT, TLSA, or CAA).
    geoIp Property Map
    Return record based on client localisation
    httpService Property Map
    Return record based on client localisation
    keepEmptyZone Boolean
    When destroying a resource, if only NS records remain and this is set to false, the zone will be deleted. Note that each zone not deleted will be billed.
    name String
    The name of the record (can be an empty string for a root record).
    priority Number
    The priority of the record (mostly used with an MX record).
    projectId String
    The project_id you want to attach the resource to
    ttl Number
    Time To Live of the record in seconds.
    views List<Property Map>
    Return record based on client subnet
    weighteds List<Property Map>
    Return record based on weight

    Outputs

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

    Fqdn string
    The FQDN of the record.
    Id string
    The provider-assigned unique ID for this managed resource.
    RootZone bool
    Does the DNS zone is the root zone or not
    Fqdn string
    The FQDN of the record.
    Id string
    The provider-assigned unique ID for this managed resource.
    RootZone bool
    Does the DNS zone is the root zone or not
    fqdn String
    The FQDN of the record.
    id String
    The provider-assigned unique ID for this managed resource.
    rootZone Boolean
    Does the DNS zone is the root zone or not
    fqdn string
    The FQDN of the record.
    id string
    The provider-assigned unique ID for this managed resource.
    rootZone boolean
    Does the DNS zone is the root zone or not
    fqdn str
    The FQDN of the record.
    id str
    The provider-assigned unique ID for this managed resource.
    root_zone bool
    Does the DNS zone is the root zone or not
    fqdn String
    The FQDN of the record.
    id String
    The provider-assigned unique ID for this managed resource.
    rootZone Boolean
    Does the DNS zone is the root zone or not

    Look up Existing DomainRecord Resource

    Get an existing DomainRecord 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?: DomainRecordState, opts?: CustomResourceOptions): DomainRecord
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            data: Optional[str] = None,
            dns_zone: Optional[str] = None,
            fqdn: Optional[str] = None,
            geo_ip: Optional[DomainRecordGeoIpArgs] = None,
            http_service: Optional[DomainRecordHttpServiceArgs] = None,
            keep_empty_zone: Optional[bool] = None,
            name: Optional[str] = None,
            priority: Optional[int] = None,
            project_id: Optional[str] = None,
            root_zone: Optional[bool] = None,
            ttl: Optional[int] = None,
            type: Optional[str] = None,
            views: Optional[Sequence[DomainRecordViewArgs]] = None,
            weighteds: Optional[Sequence[DomainRecordWeightedArgs]] = None) -> DomainRecord
    func GetDomainRecord(ctx *Context, name string, id IDInput, state *DomainRecordState, opts ...ResourceOption) (*DomainRecord, error)
    public static DomainRecord Get(string name, Input<string> id, DomainRecordState? state, CustomResourceOptions? opts = null)
    public static DomainRecord get(String name, Output<String> id, DomainRecordState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    Data string
    The content of the record (an IPv4 for an A record, a string for a TXT record, etc.).
    DnsZone string
    The DNS zone of the domain. If the domain has no DNS zone, one will be automatically created.
    Fqdn string
    The FQDN of the record.
    GeoIp Pulumiverse.Scaleway.Inputs.DomainRecordGeoIp
    Return record based on client localisation
    HttpService Pulumiverse.Scaleway.Inputs.DomainRecordHttpService
    Return record based on client localisation
    KeepEmptyZone bool
    When destroying a resource, if only NS records remain and this is set to false, the zone will be deleted. Note that each zone not deleted will be billed.
    Name string
    The name of the record (can be an empty string for a root record).
    Priority int
    The priority of the record (mostly used with an MX record).
    ProjectId string
    The project_id you want to attach the resource to
    RootZone bool
    Does the DNS zone is the root zone or not
    Ttl int
    Time To Live of the record in seconds.
    Type string
    The type of the record (A, AAAA, MX, CNAME, DNAME, ALIAS, NS, PTR, SRV, TXT, TLSA, or CAA).
    Views List<Pulumiverse.Scaleway.Inputs.DomainRecordView>
    Return record based on client subnet
    Weighteds List<Pulumiverse.Scaleway.Inputs.DomainRecordWeighted>
    Return record based on weight
    Data string
    The content of the record (an IPv4 for an A record, a string for a TXT record, etc.).
    DnsZone string
    The DNS zone of the domain. If the domain has no DNS zone, one will be automatically created.
    Fqdn string
    The FQDN of the record.
    GeoIp DomainRecordGeoIpArgs
    Return record based on client localisation
    HttpService DomainRecordHttpServiceArgs
    Return record based on client localisation
    KeepEmptyZone bool
    When destroying a resource, if only NS records remain and this is set to false, the zone will be deleted. Note that each zone not deleted will be billed.
    Name string
    The name of the record (can be an empty string for a root record).
    Priority int
    The priority of the record (mostly used with an MX record).
    ProjectId string
    The project_id you want to attach the resource to
    RootZone bool
    Does the DNS zone is the root zone or not
    Ttl int
    Time To Live of the record in seconds.
    Type string
    The type of the record (A, AAAA, MX, CNAME, DNAME, ALIAS, NS, PTR, SRV, TXT, TLSA, or CAA).
    Views []DomainRecordViewArgs
    Return record based on client subnet
    Weighteds []DomainRecordWeightedArgs
    Return record based on weight
    data String
    The content of the record (an IPv4 for an A record, a string for a TXT record, etc.).
    dnsZone String
    The DNS zone of the domain. If the domain has no DNS zone, one will be automatically created.
    fqdn String
    The FQDN of the record.
    geoIp DomainRecordGeoIp
    Return record based on client localisation
    httpService DomainRecordHttpService
    Return record based on client localisation
    keepEmptyZone Boolean
    When destroying a resource, if only NS records remain and this is set to false, the zone will be deleted. Note that each zone not deleted will be billed.
    name String
    The name of the record (can be an empty string for a root record).
    priority Integer
    The priority of the record (mostly used with an MX record).
    projectId String
    The project_id you want to attach the resource to
    rootZone Boolean
    Does the DNS zone is the root zone or not
    ttl Integer
    Time To Live of the record in seconds.
    type String
    The type of the record (A, AAAA, MX, CNAME, DNAME, ALIAS, NS, PTR, SRV, TXT, TLSA, or CAA).
    views List<DomainRecordView>
    Return record based on client subnet
    weighteds List<DomainRecordWeighted>
    Return record based on weight
    data string
    The content of the record (an IPv4 for an A record, a string for a TXT record, etc.).
    dnsZone string
    The DNS zone of the domain. If the domain has no DNS zone, one will be automatically created.
    fqdn string
    The FQDN of the record.
    geoIp DomainRecordGeoIp
    Return record based on client localisation
    httpService DomainRecordHttpService
    Return record based on client localisation
    keepEmptyZone boolean
    When destroying a resource, if only NS records remain and this is set to false, the zone will be deleted. Note that each zone not deleted will be billed.
    name string
    The name of the record (can be an empty string for a root record).
    priority number
    The priority of the record (mostly used with an MX record).
    projectId string
    The project_id you want to attach the resource to
    rootZone boolean
    Does the DNS zone is the root zone or not
    ttl number
    Time To Live of the record in seconds.
    type string
    The type of the record (A, AAAA, MX, CNAME, DNAME, ALIAS, NS, PTR, SRV, TXT, TLSA, or CAA).
    views DomainRecordView[]
    Return record based on client subnet
    weighteds DomainRecordWeighted[]
    Return record based on weight
    data str
    The content of the record (an IPv4 for an A record, a string for a TXT record, etc.).
    dns_zone str
    The DNS zone of the domain. If the domain has no DNS zone, one will be automatically created.
    fqdn str
    The FQDN of the record.
    geo_ip DomainRecordGeoIpArgs
    Return record based on client localisation
    http_service DomainRecordHttpServiceArgs
    Return record based on client localisation
    keep_empty_zone bool
    When destroying a resource, if only NS records remain and this is set to false, the zone will be deleted. Note that each zone not deleted will be billed.
    name str
    The name of the record (can be an empty string for a root record).
    priority int
    The priority of the record (mostly used with an MX record).
    project_id str
    The project_id you want to attach the resource to
    root_zone bool
    Does the DNS zone is the root zone or not
    ttl int
    Time To Live of the record in seconds.
    type str
    The type of the record (A, AAAA, MX, CNAME, DNAME, ALIAS, NS, PTR, SRV, TXT, TLSA, or CAA).
    views Sequence[DomainRecordViewArgs]
    Return record based on client subnet
    weighteds Sequence[DomainRecordWeightedArgs]
    Return record based on weight
    data String
    The content of the record (an IPv4 for an A record, a string for a TXT record, etc.).
    dnsZone String
    The DNS zone of the domain. If the domain has no DNS zone, one will be automatically created.
    fqdn String
    The FQDN of the record.
    geoIp Property Map
    Return record based on client localisation
    httpService Property Map
    Return record based on client localisation
    keepEmptyZone Boolean
    When destroying a resource, if only NS records remain and this is set to false, the zone will be deleted. Note that each zone not deleted will be billed.
    name String
    The name of the record (can be an empty string for a root record).
    priority Number
    The priority of the record (mostly used with an MX record).
    projectId String
    The project_id you want to attach the resource to
    rootZone Boolean
    Does the DNS zone is the root zone or not
    ttl Number
    Time To Live of the record in seconds.
    type String
    The type of the record (A, AAAA, MX, CNAME, DNAME, ALIAS, NS, PTR, SRV, TXT, TLSA, or CAA).
    views List<Property Map>
    Return record based on client subnet
    weighteds List<Property Map>
    Return record based on weight

    Supporting Types

    DomainRecordGeoIp, DomainRecordGeoIpArgs

    matches List<Property Map>
    The list of matches

    DomainRecordGeoIpMatch, DomainRecordGeoIpMatchArgs

    Data string
    The content of the record (an IPv4 for an A record, a string for a TXT record, etc.).
    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 (an IPv4 for an A record, a string for a TXT record, etc.).
    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 (an IPv4 for an A record, a string for a TXT record, etc.).
    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 (an IPv4 for an A record, a string for a TXT record, etc.).
    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 str
    The content of the record (an IPv4 for an A record, a string for a TXT record, etc.).
    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 String
    The content of the record (an IPv4 for an A record, a string for a TXT record, etc.).
    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

    DomainRecordHttpService, DomainRecordHttpServiceArgs

    Ips List<string>
    IPs to check
    MustContain 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
    UserAgent string
    User-agent used when checking the URL
    Ips []string
    IPs to check
    MustContain 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
    UserAgent string
    User-agent used when checking the URL
    ips List<String>
    IPs to check
    mustContain 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
    userAgent String
    User-agent used when checking the URL
    ips string[]
    IPs to check
    mustContain 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
    userAgent 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
    mustContain 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
    userAgent String
    User-agent used when checking the URL

    DomainRecordView, DomainRecordViewArgs

    Data string
    The content of the record (an IPv4 for an A record, a string for a TXT record, etc.).
    Subnet string
    The subnet of the view
    Data string
    The content of the record (an IPv4 for an A record, a string for a TXT record, etc.).
    Subnet string
    The subnet of the view
    data String
    The content of the record (an IPv4 for an A record, a string for a TXT record, etc.).
    subnet String
    The subnet of the view
    data string
    The content of the record (an IPv4 for an A record, a string for a TXT record, etc.).
    subnet string
    The subnet of the view
    data str
    The content of the record (an IPv4 for an A record, a string for a TXT record, etc.).
    subnet str
    The subnet of the view
    data String
    The content of the record (an IPv4 for an A record, a string for a TXT record, etc.).
    subnet String
    The subnet of the view

    DomainRecordWeighted, DomainRecordWeightedArgs

    Ip string
    The weighted IP
    Weight int
    The weight of the IP
    Ip string
    The weighted IP
    Weight int
    The weight of the IP
    ip String
    The weighted IP
    weight Integer
    The weight of the IP
    ip string
    The weighted IP
    weight number
    The weight of the IP
    ip str
    The weighted IP
    weight int
    The weight of the IP
    ip String
    The weighted IP
    weight Number
    The weight of the IP

    Import

    This section explains how to import a record using the {dns_zone}/{id} format.

    bash

    $ pulumi import scaleway:index/domainRecord:DomainRecord www subdomain.domain.tld/11111111-1111-1111-1111-111111111111
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    scaleway pulumiverse/pulumi-scaleway
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the scaleway Terraform Provider.
    scaleway logo
    Scaleway v1.20.0 published on Monday, Nov 4, 2024 by pulumiverse