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

scaleway.ContainerToken

Explore with Pulumi AI

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

    The scaleway.ContainerToken resource allows you to create and manage authentication tokens for Scaleway Serverless Containers.

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

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    const main = new scaleway.ContainerNamespace("main", {name: "test-container-token-ns"});
    const mainContainer = new scaleway.Container("main", {namespaceId: main.id});
    // Namespace Token
    const namespace = new scaleway.ContainerToken("namespace", {
        namespaceId: main.id,
        expiresAt: "2022-10-18T11:35:15+02:00",
    });
    // Container Token
    const container = new scaleway.ContainerToken("container", {containerId: mainContainer.id});
    
    import pulumi
    import pulumiverse_scaleway as scaleway
    
    main = scaleway.ContainerNamespace("main", name="test-container-token-ns")
    main_container = scaleway.Container("main", namespace_id=main.id)
    # Namespace Token
    namespace = scaleway.ContainerToken("namespace",
        namespace_id=main.id,
        expires_at="2022-10-18T11:35:15+02:00")
    # Container Token
    container = scaleway.ContainerToken("container", container_id=main_container.id)
    
    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 {
    		main, err := scaleway.NewContainerNamespace(ctx, "main", &scaleway.ContainerNamespaceArgs{
    			Name: pulumi.String("test-container-token-ns"),
    		})
    		if err != nil {
    			return err
    		}
    		mainContainer, err := scaleway.NewContainer(ctx, "main", &scaleway.ContainerArgs{
    			NamespaceId: main.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		// Namespace Token
    		_, err = scaleway.NewContainerToken(ctx, "namespace", &scaleway.ContainerTokenArgs{
    			NamespaceId: main.ID(),
    			ExpiresAt:   pulumi.String("2022-10-18T11:35:15+02:00"),
    		})
    		if err != nil {
    			return err
    		}
    		// Container Token
    		_, err = scaleway.NewContainerToken(ctx, "container", &scaleway.ContainerTokenArgs{
    			ContainerId: mainContainer.ID(),
    		})
    		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 main = new Scaleway.ContainerNamespace("main", new()
        {
            Name = "test-container-token-ns",
        });
    
        var mainContainer = new Scaleway.Container("main", new()
        {
            NamespaceId = main.Id,
        });
    
        // Namespace Token
        var @namespace = new Scaleway.ContainerToken("namespace", new()
        {
            NamespaceId = main.Id,
            ExpiresAt = "2022-10-18T11:35:15+02:00",
        });
    
        // Container Token
        var container = new Scaleway.ContainerToken("container", new()
        {
            ContainerId = mainContainer.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.ContainerNamespace;
    import com.pulumi.scaleway.ContainerNamespaceArgs;
    import com.pulumi.scaleway.Container;
    import com.pulumi.scaleway.ContainerArgs;
    import com.pulumi.scaleway.ContainerToken;
    import com.pulumi.scaleway.ContainerTokenArgs;
    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 main = new ContainerNamespace("main", ContainerNamespaceArgs.builder()
                .name("test-container-token-ns")
                .build());
    
            var mainContainer = new Container("mainContainer", ContainerArgs.builder()
                .namespaceId(main.id())
                .build());
    
            // Namespace Token
            var namespace = new ContainerToken("namespace", ContainerTokenArgs.builder()
                .namespaceId(main.id())
                .expiresAt("2022-10-18T11:35:15+02:00")
                .build());
    
            // Container Token
            var container = new ContainerToken("container", ContainerTokenArgs.builder()
                .containerId(mainContainer.id())
                .build());
    
        }
    }
    
    resources:
      main:
        type: scaleway:ContainerNamespace
        properties:
          name: test-container-token-ns
      mainContainer:
        type: scaleway:Container
        name: main
        properties:
          namespaceId: ${main.id}
      # Namespace Token
      namespace:
        type: scaleway:ContainerToken
        properties:
          namespaceId: ${main.id}
          expiresAt: 2022-10-18T11:35:15+02:00
      # Container Token
      container:
        type: scaleway:ContainerToken
        properties:
          containerId: ${mainContainer.id}
    

    Create ContainerToken Resource

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

    Constructor syntax

    new ContainerToken(name: string, args?: ContainerTokenArgs, opts?: CustomResourceOptions);
    @overload
    def ContainerToken(resource_name: str,
                       args: Optional[ContainerTokenArgs] = None,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def ContainerToken(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       container_id: Optional[str] = None,
                       description: Optional[str] = None,
                       expires_at: Optional[str] = None,
                       namespace_id: Optional[str] = None,
                       region: Optional[str] = None)
    func NewContainerToken(ctx *Context, name string, args *ContainerTokenArgs, opts ...ResourceOption) (*ContainerToken, error)
    public ContainerToken(string name, ContainerTokenArgs? args = null, CustomResourceOptions? opts = null)
    public ContainerToken(String name, ContainerTokenArgs args)
    public ContainerToken(String name, ContainerTokenArgs args, CustomResourceOptions options)
    
    type: scaleway:ContainerToken
    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 ContainerTokenArgs
    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 ContainerTokenArgs
    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 ContainerTokenArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ContainerTokenArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ContainerTokenArgs
    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 containerTokenResource = new Scaleway.ContainerToken("containerTokenResource", new()
    {
        ContainerId = "string",
        Description = "string",
        ExpiresAt = "string",
        NamespaceId = "string",
        Region = "string",
    });
    
    example, err := scaleway.NewContainerToken(ctx, "containerTokenResource", &scaleway.ContainerTokenArgs{
    	ContainerId: pulumi.String("string"),
    	Description: pulumi.String("string"),
    	ExpiresAt:   pulumi.String("string"),
    	NamespaceId: pulumi.String("string"),
    	Region:      pulumi.String("string"),
    })
    
    var containerTokenResource = new ContainerToken("containerTokenResource", ContainerTokenArgs.builder()
        .containerId("string")
        .description("string")
        .expiresAt("string")
        .namespaceId("string")
        .region("string")
        .build());
    
    container_token_resource = scaleway.ContainerToken("containerTokenResource",
        container_id="string",
        description="string",
        expires_at="string",
        namespace_id="string",
        region="string")
    
    const containerTokenResource = new scaleway.ContainerToken("containerTokenResource", {
        containerId: "string",
        description: "string",
        expiresAt: "string",
        namespaceId: "string",
        region: "string",
    });
    
    type: scaleway:ContainerToken
    properties:
        containerId: string
        description: string
        expiresAt: string
        namespaceId: string
        region: string
    

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

    ContainerId string

    The unique identifier of the container.

    Only one of namespace_id or container_id must be set.

    Description string
    The description of the token.
    ExpiresAt string
    The expiration date of the token.
    NamespaceId string
    The unique identifier of the Containers namespace.
    Region string

    region). The region in which the namespace is created.

    Important Updating any of the arguments above will recreate the token.

    ContainerId string

    The unique identifier of the container.

    Only one of namespace_id or container_id must be set.

    Description string
    The description of the token.
    ExpiresAt string
    The expiration date of the token.
    NamespaceId string
    The unique identifier of the Containers namespace.
    Region string

    region). The region in which the namespace is created.

    Important Updating any of the arguments above will recreate the token.

    containerId String

    The unique identifier of the container.

    Only one of namespace_id or container_id must be set.

    description String
    The description of the token.
    expiresAt String
    The expiration date of the token.
    namespaceId String
    The unique identifier of the Containers namespace.
    region String

    region). The region in which the namespace is created.

    Important Updating any of the arguments above will recreate the token.

    containerId string

    The unique identifier of the container.

    Only one of namespace_id or container_id must be set.

    description string
    The description of the token.
    expiresAt string
    The expiration date of the token.
    namespaceId string
    The unique identifier of the Containers namespace.
    region string

    region). The region in which the namespace is created.

    Important Updating any of the arguments above will recreate the token.

    container_id str

    The unique identifier of the container.

    Only one of namespace_id or container_id must be set.

    description str
    The description of the token.
    expires_at str
    The expiration date of the token.
    namespace_id str
    The unique identifier of the Containers namespace.
    region str

    region). The region in which the namespace is created.

    Important Updating any of the arguments above will recreate the token.

    containerId String

    The unique identifier of the container.

    Only one of namespace_id or container_id must be set.

    description String
    The description of the token.
    expiresAt String
    The expiration date of the token.
    namespaceId String
    The unique identifier of the Containers namespace.
    region String

    region). The region in which the namespace is created.

    Important Updating any of the arguments above will recreate the token.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Token string
    The token.
    Id string
    The provider-assigned unique ID for this managed resource.
    Token string
    The token.
    id String
    The provider-assigned unique ID for this managed resource.
    token String
    The token.
    id string
    The provider-assigned unique ID for this managed resource.
    token string
    The token.
    id str
    The provider-assigned unique ID for this managed resource.
    token str
    The token.
    id String
    The provider-assigned unique ID for this managed resource.
    token String
    The token.

    Look up Existing ContainerToken Resource

    Get an existing ContainerToken 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?: ContainerTokenState, opts?: CustomResourceOptions): ContainerToken
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            container_id: Optional[str] = None,
            description: Optional[str] = None,
            expires_at: Optional[str] = None,
            namespace_id: Optional[str] = None,
            region: Optional[str] = None,
            token: Optional[str] = None) -> ContainerToken
    func GetContainerToken(ctx *Context, name string, id IDInput, state *ContainerTokenState, opts ...ResourceOption) (*ContainerToken, error)
    public static ContainerToken Get(string name, Input<string> id, ContainerTokenState? state, CustomResourceOptions? opts = null)
    public static ContainerToken get(String name, Output<String> id, ContainerTokenState 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:
    ContainerId string

    The unique identifier of the container.

    Only one of namespace_id or container_id must be set.

    Description string
    The description of the token.
    ExpiresAt string
    The expiration date of the token.
    NamespaceId string
    The unique identifier of the Containers namespace.
    Region string

    region). The region in which the namespace is created.

    Important Updating any of the arguments above will recreate the token.

    Token string
    The token.
    ContainerId string

    The unique identifier of the container.

    Only one of namespace_id or container_id must be set.

    Description string
    The description of the token.
    ExpiresAt string
    The expiration date of the token.
    NamespaceId string
    The unique identifier of the Containers namespace.
    Region string

    region). The region in which the namespace is created.

    Important Updating any of the arguments above will recreate the token.

    Token string
    The token.
    containerId String

    The unique identifier of the container.

    Only one of namespace_id or container_id must be set.

    description String
    The description of the token.
    expiresAt String
    The expiration date of the token.
    namespaceId String
    The unique identifier of the Containers namespace.
    region String

    region). The region in which the namespace is created.

    Important Updating any of the arguments above will recreate the token.

    token String
    The token.
    containerId string

    The unique identifier of the container.

    Only one of namespace_id or container_id must be set.

    description string
    The description of the token.
    expiresAt string
    The expiration date of the token.
    namespaceId string
    The unique identifier of the Containers namespace.
    region string

    region). The region in which the namespace is created.

    Important Updating any of the arguments above will recreate the token.

    token string
    The token.
    container_id str

    The unique identifier of the container.

    Only one of namespace_id or container_id must be set.

    description str
    The description of the token.
    expires_at str
    The expiration date of the token.
    namespace_id str
    The unique identifier of the Containers namespace.
    region str

    region). The region in which the namespace is created.

    Important Updating any of the arguments above will recreate the token.

    token str
    The token.
    containerId String

    The unique identifier of the container.

    Only one of namespace_id or container_id must be set.

    description String
    The description of the token.
    expiresAt String
    The expiration date of the token.
    namespaceId String
    The unique identifier of the Containers namespace.
    region String

    region). The region in which the namespace is created.

    Important Updating any of the arguments above will recreate the token.

    token String
    The token.

    Import

    Tokens can be imported using {region}/{id}, as shown below:

    bash

    $ pulumi import scaleway:index/containerToken:ContainerToken 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
    Scaleway v1.20.0 published on Monday, Nov 4, 2024 by pulumiverse