
Scaleway v1.8.0, Apr 11 23

Scaleway v1.8.0, Apr 11 23
scaleway.FunctionToken
Explore with Pulumi AI
Creates and manages Scaleway Function Token. 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",
handler: "Handle",
privacy: "private",
});
// Namespace Token
const namespace = new scaleway.FunctionToken("namespace", {
namespaceId: mainFunctionNamespace.id,
expiresAt: "2022-10-18T11:35:15+02:00",
});
// Function Token
const _function = new scaleway.FunctionToken("function", {functionId: mainFunction.id});
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",
handler="Handle",
privacy="private")
# Namespace Token
namespace = scaleway.FunctionToken("namespace",
namespace_id=main_function_namespace.id,
expires_at="2022-10-18T11:35:15+02:00")
# Function Token
function = scaleway.FunctionToken("function", function_id=main_function.id)
using System.Collections.Generic;
using System.Linq;
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",
Handler = "Handle",
Privacy = "private",
});
// Namespace Token
var @namespace = new Scaleway.FunctionToken("namespace", new()
{
NamespaceId = mainFunctionNamespace.Id,
ExpiresAt = "2022-10-18T11:35:15+02:00",
});
// Function Token
var function = new Scaleway.FunctionToken("function", new()
{
FunctionId = mainFunction.Id,
});
});
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"),
Handler: pulumi.String("Handle"),
Privacy: pulumi.String("private"),
})
if err != nil {
return err
}
_, err = scaleway.NewFunctionToken(ctx, "namespace", &scaleway.FunctionTokenArgs{
NamespaceId: mainFunctionNamespace.ID(),
ExpiresAt: pulumi.String("2022-10-18T11:35:15+02:00"),
})
if err != nil {
return err
}
_, err = scaleway.NewFunctionToken(ctx, "function", &scaleway.FunctionTokenArgs{
FunctionId: mainFunction.ID(),
})
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.FunctionToken;
import com.pulumi.scaleway.FunctionTokenArgs;
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")
.handler("Handle")
.privacy("private")
.build());
var namespace = new FunctionToken("namespace", FunctionTokenArgs.builder()
.namespaceId(mainFunctionNamespace.id())
.expiresAt("2022-10-18T11:35:15+02:00")
.build());
var function = new FunctionToken("function", FunctionTokenArgs.builder()
.functionId(mainFunction.id())
.build());
}
}
resources:
mainFunctionNamespace:
type: scaleway:FunctionNamespace
mainFunction:
type: scaleway:Function
properties:
namespaceId: ${mainFunctionNamespace.id}
runtime: go118
handler: Handle
privacy: private
# Namespace Token
namespace:
type: scaleway:FunctionToken
properties:
namespaceId: ${mainFunctionNamespace.id}
expiresAt: 2022-10-18T11:35:15+02:00
# Function Token
function:
type: scaleway:FunctionToken
properties:
functionId: ${mainFunction.id}
Create FunctionToken Resource
new FunctionToken(name: string, args?: FunctionTokenArgs, opts?: CustomResourceOptions);
@overload
def FunctionToken(resource_name: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
expires_at: Optional[str] = None,
function_id: Optional[str] = None,
namespace_id: Optional[str] = None,
region: Optional[str] = None)
@overload
def FunctionToken(resource_name: str,
args: Optional[FunctionTokenArgs] = None,
opts: Optional[ResourceOptions] = None)
func NewFunctionToken(ctx *Context, name string, args *FunctionTokenArgs, opts ...ResourceOption) (*FunctionToken, error)
public FunctionToken(string name, FunctionTokenArgs? args = null, CustomResourceOptions? opts = null)
public FunctionToken(String name, FunctionTokenArgs args)
public FunctionToken(String name, FunctionTokenArgs args, CustomResourceOptions options)
type: scaleway:FunctionToken
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args FunctionTokenArgs
- 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 FunctionTokenArgs
- 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 FunctionTokenArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args FunctionTokenArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args FunctionTokenArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
FunctionToken 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 FunctionToken resource accepts the following input properties:
- Description string
The description of the token.
- Expires
At string The expiration date of the token.
- Function
Id string The ID of the function.
- Namespace
Id string The ID of the function namespace.
- Region string
region
). The region in which the namespace should be created.
- Description string
The description of the token.
- Expires
At string The expiration date of the token.
- Function
Id string The ID of the function.
- Namespace
Id string The ID of the function namespace.
- Region string
region
). The region in which the namespace should be created.
- description String
The description of the token.
- expires
At String The expiration date of the token.
- function
Id String The ID of the function.
- namespace
Id String The ID of the function namespace.
- region String
region
). The region in which the namespace should be created.
- description string
The description of the token.
- expires
At string The expiration date of the token.
- function
Id string The ID of the function.
- namespace
Id string The ID of the function namespace.
- region string
region
). The region in which the namespace should be created.
- description str
The description of the token.
- expires_
at str The expiration date of the token.
- function_
id str The ID of the function.
- namespace_
id str The ID of the function namespace.
- region str
region
). The region in which the namespace should be created.
- description String
The description of the token.
- expires
At String The expiration date of the token.
- function
Id String The ID of the function.
- namespace
Id String The ID of the function namespace.
- region String
region
). The region in which the namespace should be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the FunctionToken resource produces the following output properties:
Look up Existing FunctionToken Resource
Get an existing FunctionToken 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?: FunctionTokenState, opts?: CustomResourceOptions): FunctionToken
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
expires_at: Optional[str] = None,
function_id: Optional[str] = None,
namespace_id: Optional[str] = None,
region: Optional[str] = None,
token: Optional[str] = None) -> FunctionToken
func GetFunctionToken(ctx *Context, name string, id IDInput, state *FunctionTokenState, opts ...ResourceOption) (*FunctionToken, error)
public static FunctionToken Get(string name, Input<string> id, FunctionTokenState? state, CustomResourceOptions? opts = null)
public static FunctionToken get(String name, Output<String> id, FunctionTokenState 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.
- Description string
The description of the token.
- Expires
At string The expiration date of the token.
- Function
Id string The ID of the function.
- Namespace
Id string The ID of the function namespace.
- Region string
region
). The region in which the namespace should be created.- Token string
The token.
- Description string
The description of the token.
- Expires
At string The expiration date of the token.
- Function
Id string The ID of the function.
- Namespace
Id string The ID of the function namespace.
- Region string
region
). The region in which the namespace should be created.- Token string
The token.
- description String
The description of the token.
- expires
At String The expiration date of the token.
- function
Id String The ID of the function.
- namespace
Id String The ID of the function namespace.
- region String
region
). The region in which the namespace should be created.- token String
The token.
- description string
The description of the token.
- expires
At string The expiration date of the token.
- function
Id string The ID of the function.
- namespace
Id string The ID of the function namespace.
- region string
region
). The region in which the namespace should be created.- token string
The token.
- description str
The description of the token.
- expires_
at str The expiration date of the token.
- function_
id str The ID of the function.
- namespace_
id str The ID of the function namespace.
- region str
region
). The region in which the namespace should be created.- token str
The token.
- description String
The description of the token.
- expires
At String The expiration date of the token.
- function
Id String The ID of the function.
- namespace
Id String The ID of the function namespace.
- region String
region
). The region in which the namespace should be created.- token String
The token.
Import
Tokens can be imported using the {region}/{id}
, e.g. bash
$ pulumi import scaleway:index/functionToken:FunctionToken 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.