1. Packages
  2. Packages
  3. Scaleway
  4. API Docs
  5. containers
  6. Domain
Viewing docs for Scaleway v1.49.0
published on Thursday, May 14, 2026 by pulumiverse
scaleway logo
Viewing docs for Scaleway v1.49.0
published on Thursday, May 14, 2026 by pulumiverse

    The scaleway.containers.Domain resource allows you to create and manage domain name bindings for Scaleway Serverless Containers.

    Refer to the Containers domain documentation and the API documentation for more information.

    Example Usage

    The commands below shows how to bind a custom domain name to a container.

    Simple

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    const app = new scaleway.containers.Container("app", {});
    const appDomain = new scaleway.containers.Domain("app", {
        containerId: app.id,
        hostname: "container.domain.tld",
    });
    
    import pulumi
    import pulumiverse_scaleway as scaleway
    
    app = scaleway.containers.Container("app")
    app_domain = scaleway.containers.Domain("app",
        container_id=app.id,
        hostname="container.domain.tld")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/containers"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		app, err := containers.NewContainer(ctx, "app", nil)
    		if err != nil {
    			return err
    		}
    		_, err = containers.NewDomain(ctx, "app", &containers.DomainArgs{
    			ContainerId: app.ID(),
    			Hostname:    pulumi.String("container.domain.tld"),
    		})
    		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 app = new Scaleway.Containers.Container("app");
    
        var appDomain = new Scaleway.Containers.Domain("app", new()
        {
            ContainerId = app.Id,
            Hostname = "container.domain.tld",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.containers.Container;
    import com.pulumi.scaleway.containers.Domain;
    import com.pulumi.scaleway.containers.DomainArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 app = new Container("app");
    
            var appDomain = new Domain("appDomain", DomainArgs.builder()
                .containerId(app.id())
                .hostname("container.domain.tld")
                .build());
    
        }
    }
    
    resources:
      app:
        type: scaleway:containers:Container
      appDomain:
        type: scaleway:containers:Domain
        name: app
        properties:
          containerId: ${app.id}
          hostname: container.domain.tld
    
    Example coming soon!
    

    Complete example with domain

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    import * as std from "@pulumi/std";
    
    const main = new scaleway.containers.Namespace("main", {});
    const app = new scaleway.containers.Container("app", {
        name: "app",
        namespaceId: main.id,
        image: "nginx:latest",
        port: 80,
        privacy: "public",
        protocol: "http1",
    });
    const appRecord = new scaleway.domain.Record("app", {
        dnsZone: "scaleway-terraform.com",
        name: "subdomain",
        type: "CNAME",
        data: std.format({
            input: "%s.",
            args: [std.trimprefix({
                input: app.publicEndpoint,
                prefix: "https://",
            }).result],
        }).result,
        ttl: 3600,
    });
    const appDomain = new scaleway.containers.Domain("app", {
        containerId: app.id,
        hostname: pulumi.interpolate`${appRecord.name}.${appRecord.dnsZone}`,
    });
    
    import pulumi
    import pulumi_std as std
    import pulumiverse_scaleway as scaleway
    
    main = scaleway.containers.Namespace("main")
    app = scaleway.containers.Container("app",
        name="app",
        namespace_id=main.id,
        image="nginx:latest",
        port=80,
        privacy="public",
        protocol="http1")
    app_record = scaleway.domain.Record("app",
        dns_zone="scaleway-terraform.com",
        name="subdomain",
        type="CNAME",
        data=std.format(input="%s.",
            args=[std.trimprefix(input=app.public_endpoint,
                prefix="https://")["result"]])["result"],
        ttl=3600)
    app_domain = scaleway.containers.Domain("app",
        container_id=app.id,
        hostname=pulumi.Output.all(
            name=app_record.name,
            dns_zone=app_record.dns_zone
    ).apply(lambda resolved_outputs: f"{resolved_outputs['name']}.{resolved_outputs['dns_zone']}")
    )
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-std/sdk/go/std"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/containers"
    	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/domain"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		main, err := containers.NewNamespace(ctx, "main", nil)
    		if err != nil {
    			return err
    		}
    		app, err := containers.NewContainer(ctx, "app", &containers.ContainerArgs{
    			Name:        pulumi.String("app"),
    			NamespaceId: main.ID(),
    			Image:       pulumi.String("nginx:latest"),
    			Port:        pulumi.Int(80),
    			Privacy:     pulumi.String("public"),
    			Protocol:    pulumi.String("http1"),
    		})
    		if err != nil {
    			return err
    		}
    		invokeFormat, err := std.Format(ctx, map[string]interface{}{
    			"input": "%s.",
    			"args": []interface{}{
    				std.Trimprefix(ctx, map[string]interface{}{
    					"input":  app.PublicEndpoint,
    					"prefix": "https://",
    				}, nil).Result,
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		appRecord, err := domain.NewRecord(ctx, "app", &domain.RecordArgs{
    			DnsZone: pulumi.String("scaleway-terraform.com"),
    			Name:    pulumi.String("subdomain"),
    			Type:    pulumi.String("CNAME"),
    			Data:    invokeFormat.Result,
    			Ttl:     pulumi.Int(3600),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = containers.NewDomain(ctx, "app", &containers.DomainArgs{
    			ContainerId: app.ID(),
    			Hostname: pulumi.All(appRecord.Name, appRecord.DnsZone).ApplyT(func(_args []interface{}) (string, error) {
    				name := _args[0].(string)
    				dnsZone := _args[1].(string)
    				return fmt.Sprintf("%v.%v", name, dnsZone), nil
    			}).(pulumi.StringOutput),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Pulumiverse.Scaleway;
    using Std = Pulumi.Std;
    
    return await Deployment.RunAsync(() => 
    {
        var main = new Scaleway.Containers.Namespace("main");
    
        var app = new Scaleway.Containers.Container("app", new()
        {
            Name = "app",
            NamespaceId = main.Id,
            Image = "nginx:latest",
            Port = 80,
            Privacy = "public",
            Protocol = "http1",
        });
    
        var appRecord = new Scaleway.Domain.Record("app", new()
        {
            DnsZone = "scaleway-terraform.com",
            Name = "subdomain",
            Type = "CNAME",
            Data = Std.Format.Invoke(new()
            {
                Input = "%s.",
                Args = new[]
                {
                    Std.Trimprefix.Invoke(new()
                    {
                        Input = app.PublicEndpoint,
                        Prefix = "https://",
                    }).Result,
                },
            }).Result,
            Ttl = 3600,
        });
    
        var appDomain = new Scaleway.Containers.Domain("app", new()
        {
            ContainerId = app.Id,
            Hostname = Output.Tuple(appRecord.Name, appRecord.DnsZone).Apply(values =>
            {
                var name = values.Item1;
                var dnsZone = values.Item2;
                return $"{name}.{dnsZone}";
            }),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.containers.Namespace;
    import com.pulumi.scaleway.containers.Container;
    import com.pulumi.scaleway.containers.ContainerArgs;
    import com.pulumi.scaleway.domain.Record;
    import com.pulumi.scaleway.domain.RecordArgs;
    import com.pulumi.std.StdFunctions;
    import com.pulumi.scaleway.containers.Domain;
    import com.pulumi.scaleway.containers.DomainArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 main = new Namespace("main");
    
            var app = new Container("app", ContainerArgs.builder()
                .name("app")
                .namespaceId(main.id())
                .image("nginx:latest")
                .port(80)
                .privacy("public")
                .protocol("http1")
                .build());
    
            var appRecord = new Record("appRecord", RecordArgs.builder()
                .dnsZone("scaleway-terraform.com")
                .name("subdomain")
                .type("CNAME")
                .data(StdFunctions.format(Map.ofEntries(
                    Map.entry("input", "%s."),
                    Map.entry("args", Arrays.asList(StdFunctions.trimprefix(Map.ofEntries(
                        Map.entry("input", app.publicEndpoint()),
                        Map.entry("prefix", "https://")
                    )).result()))
                )).result())
                .ttl(3600)
                .build());
    
            var appDomain = new Domain("appDomain", DomainArgs.builder()
                .containerId(app.id())
                .hostname(Output.tuple(appRecord.name(), appRecord.dnsZone()).applyValue(values -> {
                    var name = values.t1;
                    var dnsZone = values.t2;
                    return String.format("%s.%s", name,dnsZone);
                }))
                .build());
    
        }
    }
    
    resources:
      main:
        type: scaleway:containers:Namespace
      app:
        type: scaleway:containers:Container
        properties:
          name: app
          namespaceId: ${main.id}
          image: nginx:latest
          port: 80
          privacy: public
          protocol: http1
      appRecord:
        type: scaleway:domain:Record
        name: app
        properties:
          dnsZone: scaleway-terraform.com
          name: subdomain
          type: CNAME
          data:
            fn::invoke:
              function: std:format
              arguments:
                input: '%s.'
                args:
                  - fn::invoke:
                      function: std:trimprefix
                      arguments:
                        input: ${app.publicEndpoint}
                        prefix: https://
                      return: result
              return: result
          ttl: 3600
      appDomain:
        type: scaleway:containers:Domain
        name: app
        properties:
          containerId: ${app.id}
          hostname: ${appRecord.name}.${appRecord.dnsZone}
    
    Example coming soon!
    

    Create Domain Resource

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

    Constructor syntax

    new Domain(name: string, args: DomainArgs, opts?: CustomResourceOptions);
    @overload
    def Domain(resource_name: str,
               args: DomainArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Domain(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               container_id: Optional[str] = None,
               hostname: Optional[str] = None,
               region: Optional[str] = None)
    func NewDomain(ctx *Context, name string, args DomainArgs, opts ...ResourceOption) (*Domain, error)
    public Domain(string name, DomainArgs args, CustomResourceOptions? opts = null)
    public Domain(String name, DomainArgs args)
    public Domain(String name, DomainArgs args, CustomResourceOptions options)
    
    type: scaleway:containers:Domain
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "scaleway_containers_domain" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args DomainArgs
    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 DomainArgs
    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 DomainArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DomainArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DomainArgs
    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 domainResource = new Scaleway.Containers.Domain("domainResource", new()
    {
        ContainerId = "string",
        Hostname = "string",
        Region = "string",
    });
    
    example, err := containers.NewDomain(ctx, "domainResource", &containers.DomainArgs{
    	ContainerId: pulumi.String("string"),
    	Hostname:    pulumi.String("string"),
    	Region:      pulumi.String("string"),
    })
    
    resource "scaleway_containers_domain" "domainResource" {
      container_id = "string"
      hostname     = "string"
      region       = "string"
    }
    
    var domainResource = new com.pulumi.scaleway.containers.Domain("domainResource", com.pulumi.scaleway.containers.DomainArgs.builder()
        .containerId("string")
        .hostname("string")
        .region("string")
        .build());
    
    domain_resource = scaleway.containers.Domain("domainResource",
        container_id="string",
        hostname="string",
        region="string")
    
    const domainResource = new scaleway.containers.Domain("domainResource", {
        containerId: "string",
        hostname: "string",
        region: "string",
    });
    
    type: scaleway:containers:Domain
    properties:
        containerId: string
        hostname: string
        region: string
    

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

    ContainerId string
    The unique identifier of the container.
    Hostname string
    The hostname with a CNAME record.
    Region string
    region) The region in which the container exists.
    ContainerId string
    The unique identifier of the container.
    Hostname string
    The hostname with a CNAME record.
    Region string
    region) The region in which the container exists.
    container_id string
    The unique identifier of the container.
    hostname string
    The hostname with a CNAME record.
    region string
    region) The region in which the container exists.
    containerId String
    The unique identifier of the container.
    hostname String
    The hostname with a CNAME record.
    region String
    region) The region in which the container exists.
    containerId string
    The unique identifier of the container.
    hostname string
    The hostname with a CNAME record.
    region string
    region) The region in which the container exists.
    container_id str
    The unique identifier of the container.
    hostname str
    The hostname with a CNAME record.
    region str
    region) The region in which the container exists.
    containerId String
    The unique identifier of the container.
    hostname String
    The hostname with a CNAME record.
    region String
    region) The region in which the container exists.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Url string
    (Deprecated) The URL used to query the container.

    Deprecated: URL won't be displayed on v1

    Id string
    The provider-assigned unique ID for this managed resource.
    Url string
    (Deprecated) The URL used to query the container.

    Deprecated: URL won't be displayed on v1

    id string
    The provider-assigned unique ID for this managed resource.
    url string
    (Deprecated) The URL used to query the container.

    Deprecated: URL won't be displayed on v1

    id String
    The provider-assigned unique ID for this managed resource.
    url String
    (Deprecated) The URL used to query the container.

    Deprecated: URL won't be displayed on v1

    id string
    The provider-assigned unique ID for this managed resource.
    url string
    (Deprecated) The URL used to query the container.

    Deprecated: URL won't be displayed on v1

    id str
    The provider-assigned unique ID for this managed resource.
    url str
    (Deprecated) The URL used to query the container.

    Deprecated: URL won't be displayed on v1

    id String
    The provider-assigned unique ID for this managed resource.
    url String
    (Deprecated) The URL used to query the container.

    Deprecated: URL won't be displayed on v1

    Look up Existing Domain Resource

    Get an existing Domain 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?: DomainState, opts?: CustomResourceOptions): Domain
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            container_id: Optional[str] = None,
            hostname: Optional[str] = None,
            region: Optional[str] = None,
            url: Optional[str] = None) -> Domain
    func GetDomain(ctx *Context, name string, id IDInput, state *DomainState, opts ...ResourceOption) (*Domain, error)
    public static Domain Get(string name, Input<string> id, DomainState? state, CustomResourceOptions? opts = null)
    public static Domain get(String name, Output<String> id, DomainState state, CustomResourceOptions options)
    resources:  _:    type: scaleway:containers:Domain    get:      id: ${id}
    import {
      to = scaleway_containers_domain.example
      id = "${id}"
    }
    
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ContainerId string
    The unique identifier of the container.
    Hostname string
    The hostname with a CNAME record.
    Region string
    region) The region in which the container exists.
    Url string
    (Deprecated) The URL used to query the container.

    Deprecated: URL won't be displayed on v1

    ContainerId string
    The unique identifier of the container.
    Hostname string
    The hostname with a CNAME record.
    Region string
    region) The region in which the container exists.
    Url string
    (Deprecated) The URL used to query the container.

    Deprecated: URL won't be displayed on v1

    container_id string
    The unique identifier of the container.
    hostname string
    The hostname with a CNAME record.
    region string
    region) The region in which the container exists.
    url string
    (Deprecated) The URL used to query the container.

    Deprecated: URL won't be displayed on v1

    containerId String
    The unique identifier of the container.
    hostname String
    The hostname with a CNAME record.
    region String
    region) The region in which the container exists.
    url String
    (Deprecated) The URL used to query the container.

    Deprecated: URL won't be displayed on v1

    containerId string
    The unique identifier of the container.
    hostname string
    The hostname with a CNAME record.
    region string
    region) The region in which the container exists.
    url string
    (Deprecated) The URL used to query the container.

    Deprecated: URL won't be displayed on v1

    container_id str
    The unique identifier of the container.
    hostname str
    The hostname with a CNAME record.
    region str
    region) The region in which the container exists.
    url str
    (Deprecated) The URL used to query the container.

    Deprecated: URL won't be displayed on v1

    containerId String
    The unique identifier of the container.
    hostname String
    The hostname with a CNAME record.
    region String
    region) The region in which the container exists.
    url String
    (Deprecated) The URL used to query the container.

    Deprecated: URL won't be displayed on v1

    Import

    Container domain binding can be imported using {region}/{id}, as shown below:

    $ pulumi import scaleway:containers/domain:Domain main fr-par/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
    Viewing docs for Scaleway v1.49.0
    published on Thursday, May 14, 2026 by pulumiverse

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial