1. Packages
  2. Scaleway
  3. API Docs
  4. ContainerToken
Scaleway v1.12.0 published on Monday, Mar 11, 2024 by pulumiverse

scaleway.ContainerToken

Explore with Pulumi AI

scaleway logo
Scaleway v1.12.0 published on Monday, Mar 11, 2024 by pulumiverse

    Creates and manages Scaleway Container Token. For more information see the documentation.

    Example Usage

    Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    const mainContainerNamespace = new scaleway.ContainerNamespace("mainContainerNamespace", {});
    const mainContainer = new scaleway.Container("mainContainer", {namespaceId: mainContainerNamespace.id});
    // Namespace Token
    const namespace = new scaleway.ContainerToken("namespace", {
        namespaceId: mainContainerNamespace.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_container_namespace = scaleway.ContainerNamespace("mainContainerNamespace")
    main_container = scaleway.Container("mainContainer", namespace_id=main_container_namespace.id)
    # Namespace Token
    namespace = scaleway.ContainerToken("namespace",
        namespace_id=main_container_namespace.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 {
    		mainContainerNamespace, err := scaleway.NewContainerNamespace(ctx, "mainContainerNamespace", nil)
    		if err != nil {
    			return err
    		}
    		mainContainer, err := scaleway.NewContainer(ctx, "mainContainer", &scaleway.ContainerArgs{
    			NamespaceId: mainContainerNamespace.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		// Namespace Token
    		_, err = scaleway.NewContainerToken(ctx, "namespace", &scaleway.ContainerTokenArgs{
    			NamespaceId: mainContainerNamespace.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 mainContainerNamespace = new Scaleway.ContainerNamespace("mainContainerNamespace");
    
        var mainContainer = new Scaleway.Container("mainContainer", new()
        {
            NamespaceId = mainContainerNamespace.Id,
        });
    
        // Namespace Token
        var @namespace = new Scaleway.ContainerToken("namespace", new()
        {
            NamespaceId = mainContainerNamespace.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.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 mainContainerNamespace = new ContainerNamespace("mainContainerNamespace");
    
            var mainContainer = new Container("mainContainer", ContainerArgs.builder()        
                .namespaceId(mainContainerNamespace.id())
                .build());
    
            var namespace = new ContainerToken("namespace", ContainerTokenArgs.builder()        
                .namespaceId(mainContainerNamespace.id())
                .expiresAt("2022-10-18T11:35:15+02:00")
                .build());
    
            var container = new ContainerToken("container", ContainerTokenArgs.builder()        
                .containerId(mainContainer.id())
                .build());
    
        }
    }
    
    resources:
      mainContainerNamespace:
        type: scaleway:ContainerNamespace
      mainContainer:
        type: scaleway:Container
        properties:
          namespaceId: ${mainContainerNamespace.id}
      # Namespace Token
      namespace:
        type: scaleway:ContainerToken
        properties:
          namespaceId: ${mainContainerNamespace.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.

    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

    The ContainerToken resource accepts the following input properties:

    ContainerId string

    The ID 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 ID of the container namespace.
    Region string

    region). The region in which the namespace should be created.

    Important Updates to any fields will recreate the token.

    ContainerId string

    The ID 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 ID of the container namespace.
    Region string

    region). The region in which the namespace should be created.

    Important Updates to any fields will recreate the token.

    containerId String

    The ID 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 ID of the container namespace.
    region String

    region). The region in which the namespace should be created.

    Important Updates to any fields will recreate the token.

    containerId string

    The ID 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 ID of the container namespace.
    region string

    region). The region in which the namespace should be created.

    Important Updates to any fields will recreate the token.

    container_id str

    The ID 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 ID of the container namespace.
    region str

    region). The region in which the namespace should be created.

    Important Updates to any fields will recreate the token.

    containerId String

    The ID 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 ID of the container namespace.
    region String

    region). The region in which the namespace should be created.

    Important Updates to any fields 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 ID 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 ID of the container namespace.
    Region string

    region). The region in which the namespace should be created.

    Important Updates to any fields will recreate the token.

    Token string
    The token.
    ContainerId string

    The ID 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 ID of the container namespace.
    Region string

    region). The region in which the namespace should be created.

    Important Updates to any fields will recreate the token.

    Token string
    The token.
    containerId String

    The ID 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 ID of the container namespace.
    region String

    region). The region in which the namespace should be created.

    Important Updates to any fields will recreate the token.

    token String
    The token.
    containerId string

    The ID 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 ID of the container namespace.
    region string

    region). The region in which the namespace should be created.

    Important Updates to any fields will recreate the token.

    token string
    The token.
    container_id str

    The ID 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 ID of the container namespace.
    region str

    region). The region in which the namespace should be created.

    Important Updates to any fields will recreate the token.

    token str
    The token.
    containerId String

    The ID 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 ID of the container namespace.
    region String

    region). The region in which the namespace should be created.

    Important Updates to any fields will recreate the token.

    token String
    The token.

    Import

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

    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.12.0 published on Monday, Mar 11, 2024 by pulumiverse