scaleway logo
Scaleway v1.6.0, Dec 17 22

scaleway.FunctionDomain

Creates and manages Scaleway Function Domain bindings. For more information see the documentation.

Examples

Basic

import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@lbrlabs/pulumi-scaleway";

const mainFunctionNamespace = new scaleway.FunctionNamespace("mainFunctionNamespace", {});
const mainFunction = new scaleway.Function("mainFunction", {
    namespaceId: mainFunctionNamespace.id,
    runtime: "go118",
    privacy: "private",
    handler: "Handle",
    zipFile: "testfixture/gofunction.zip",
    deploy: true,
});
const mainFunctionDomain = new scaleway.FunctionDomain("mainFunctionDomain", {
    functionId: mainFunction.id,
    hostname: "example.com",
}, {
    dependsOn: [mainFunction],
});
import pulumi
import lbrlabs_pulumi_scaleway as scaleway

main_function_namespace = scaleway.FunctionNamespace("mainFunctionNamespace")
main_function = scaleway.Function("mainFunction",
    namespace_id=main_function_namespace.id,
    runtime="go118",
    privacy="private",
    handler="Handle",
    zip_file="testfixture/gofunction.zip",
    deploy=True)
main_function_domain = scaleway.FunctionDomain("mainFunctionDomain",
    function_id=main_function.id,
    hostname="example.com",
    opts=pulumi.ResourceOptions(depends_on=[main_function]))
using System.Collections.Generic;
using Pulumi;
using Scaleway = Lbrlabs.PulumiPackage.Scaleway;

return await Deployment.RunAsync(() => 
{
    var mainFunctionNamespace = new Scaleway.FunctionNamespace("mainFunctionNamespace");

    var mainFunction = new Scaleway.Function("mainFunction", new()
    {
        NamespaceId = mainFunctionNamespace.Id,
        Runtime = "go118",
        Privacy = "private",
        Handler = "Handle",
        ZipFile = "testfixture/gofunction.zip",
        Deploy = true,
    });

    var mainFunctionDomain = new Scaleway.FunctionDomain("mainFunctionDomain", new()
    {
        FunctionId = mainFunction.Id,
        Hostname = "example.com",
    }, new CustomResourceOptions
    {
        DependsOn = new[]
        {
            mainFunction,
        },
    });

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		mainFunctionNamespace, err := scaleway.NewFunctionNamespace(ctx, "mainFunctionNamespace", nil)
		if err != nil {
			return err
		}
		mainFunction, err := scaleway.NewFunction(ctx, "mainFunction", &scaleway.FunctionArgs{
			NamespaceId: mainFunctionNamespace.ID(),
			Runtime:     pulumi.String("go118"),
			Privacy:     pulumi.String("private"),
			Handler:     pulumi.String("Handle"),
			ZipFile:     pulumi.String("testfixture/gofunction.zip"),
			Deploy:      pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		_, err = scaleway.NewFunctionDomain(ctx, "mainFunctionDomain", &scaleway.FunctionDomainArgs{
			FunctionId: mainFunction.ID(),
			Hostname:   pulumi.String("example.com"),
		}, pulumi.DependsOn([]pulumi.Resource{
			mainFunction,
		}))
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.FunctionNamespace;
import com.pulumi.scaleway.Function;
import com.pulumi.scaleway.FunctionArgs;
import com.pulumi.scaleway.FunctionDomain;
import com.pulumi.scaleway.FunctionDomainArgs;
import com.pulumi.resources.CustomResourceOptions;
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 mainFunctionNamespace = new FunctionNamespace("mainFunctionNamespace");

        var mainFunction = new Function("mainFunction", FunctionArgs.builder()        
            .namespaceId(mainFunctionNamespace.id())
            .runtime("go118")
            .privacy("private")
            .handler("Handle")
            .zipFile("testfixture/gofunction.zip")
            .deploy(true)
            .build());

        var mainFunctionDomain = new FunctionDomain("mainFunctionDomain", FunctionDomainArgs.builder()        
            .functionId(mainFunction.id())
            .hostname("example.com")
            .build(), CustomResourceOptions.builder()
                .dependsOn(mainFunction)
                .build());

    }
}
resources:
  mainFunctionDomain:
    type: scaleway:FunctionDomain
    properties:
      functionId: ${mainFunction.id}
      hostname: example.com
    options:
      dependson:
        - ${mainFunction}
  mainFunctionNamespace:
    type: scaleway:FunctionNamespace
  mainFunction:
    type: scaleway:Function
    properties:
      namespaceId: ${mainFunctionNamespace.id}
      runtime: go118
      privacy: private
      handler: Handle
      zipFile: testfixture/gofunction.zip
      deploy: true

Create FunctionDomain Resource

new FunctionDomain(name: string, args: FunctionDomainArgs, opts?: CustomResourceOptions);
@overload
def FunctionDomain(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   function_id: Optional[str] = None,
                   hostname: Optional[str] = None,
                   region: Optional[str] = None)
@overload
def FunctionDomain(resource_name: str,
                   args: FunctionDomainArgs,
                   opts: Optional[ResourceOptions] = None)
func NewFunctionDomain(ctx *Context, name string, args FunctionDomainArgs, opts ...ResourceOption) (*FunctionDomain, error)
public FunctionDomain(string name, FunctionDomainArgs args, CustomResourceOptions? opts = null)
public FunctionDomain(String name, FunctionDomainArgs args)
public FunctionDomain(String name, FunctionDomainArgs args, CustomResourceOptions options)
type: scaleway:FunctionDomain
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args FunctionDomainArgs
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 FunctionDomainArgs
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 FunctionDomainArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args FunctionDomainArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args FunctionDomainArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

FunctionDomain Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The FunctionDomain resource accepts the following input properties:

FunctionId string

The ID of the function you want to create a domain with.

Hostname string

The hostname that should resolve to your function id native domain. You should use a CNAME domain record that point to your native function domain_name for it.

Region string

The region you want to attach the resource to

FunctionId string

The ID of the function you want to create a domain with.

Hostname string

The hostname that should resolve to your function id native domain. You should use a CNAME domain record that point to your native function domain_name for it.

Region string

The region you want to attach the resource to

functionId String

The ID of the function you want to create a domain with.

hostname String

The hostname that should resolve to your function id native domain. You should use a CNAME domain record that point to your native function domain_name for it.

region String

The region you want to attach the resource to

functionId string

The ID of the function you want to create a domain with.

hostname string

The hostname that should resolve to your function id native domain. You should use a CNAME domain record that point to your native function domain_name for it.

region string

The region you want to attach the resource to

function_id str

The ID of the function you want to create a domain with.

hostname str

The hostname that should resolve to your function id native domain. You should use a CNAME domain record that point to your native function domain_name for it.

region str

The region you want to attach the resource to

functionId String

The ID of the function you want to create a domain with.

hostname String

The hostname that should resolve to your function id native domain. You should use a CNAME domain record that point to your native function domain_name for it.

region String

The region you want to attach the resource to

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

Url string

The URL that triggers the function

Id string

The provider-assigned unique ID for this managed resource.

Url string

The URL that triggers the function

id String

The provider-assigned unique ID for this managed resource.

url String

The URL that triggers the function

id string

The provider-assigned unique ID for this managed resource.

url string

The URL that triggers the function

id str

The provider-assigned unique ID for this managed resource.

url str

The URL that triggers the function

id String

The provider-assigned unique ID for this managed resource.

url String

The URL that triggers the function

Look up Existing FunctionDomain Resource

Get an existing FunctionDomain 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?: FunctionDomainState, opts?: CustomResourceOptions): FunctionDomain
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        function_id: Optional[str] = None,
        hostname: Optional[str] = None,
        region: Optional[str] = None,
        url: Optional[str] = None) -> FunctionDomain
func GetFunctionDomain(ctx *Context, name string, id IDInput, state *FunctionDomainState, opts ...ResourceOption) (*FunctionDomain, error)
public static FunctionDomain Get(string name, Input<string> id, FunctionDomainState? state, CustomResourceOptions? opts = null)
public static FunctionDomain get(String name, Output<String> id, FunctionDomainState 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:
FunctionId string

The ID of the function you want to create a domain with.

Hostname string

The hostname that should resolve to your function id native domain. You should use a CNAME domain record that point to your native function domain_name for it.

Region string

The region you want to attach the resource to

Url string

The URL that triggers the function

FunctionId string

The ID of the function you want to create a domain with.

Hostname string

The hostname that should resolve to your function id native domain. You should use a CNAME domain record that point to your native function domain_name for it.

Region string

The region you want to attach the resource to

Url string

The URL that triggers the function

functionId String

The ID of the function you want to create a domain with.

hostname String

The hostname that should resolve to your function id native domain. You should use a CNAME domain record that point to your native function domain_name for it.

region String

The region you want to attach the resource to

url String

The URL that triggers the function

functionId string

The ID of the function you want to create a domain with.

hostname string

The hostname that should resolve to your function id native domain. You should use a CNAME domain record that point to your native function domain_name for it.

region string

The region you want to attach the resource to

url string

The URL that triggers the function

function_id str

The ID of the function you want to create a domain with.

hostname str

The hostname that should resolve to your function id native domain. You should use a CNAME domain record that point to your native function domain_name for it.

region str

The region you want to attach the resource to

url str

The URL that triggers the function

functionId String

The ID of the function you want to create a domain with.

hostname String

The hostname that should resolve to your function id native domain. You should use a CNAME domain record that point to your native function domain_name for it.

region String

The region you want to attach the resource to

url String

The URL that triggers the function

Import

Domain can be imported using the {region}/{id}, e.g. bash

 $ pulumi import scaleway:index/functionDomain:FunctionDomain main fr-par/11111111-1111-1111-1111-111111111111

Package Details

Repository
scaleway lbrlabs/pulumi-scaleway
License
Apache-2.0
Notes

This Pulumi package is based on the scaleway Terraform Provider.