Scaleway

v1.4.0 published on Monday, Nov 28, 2022 by lbrlabs

ContainerToken

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

Examples

Basic

import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@lbrlabs/pulumi-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 lbrlabs_pulumi_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)
using System.Collections.Generic;
using Pulumi;
using Scaleway = Lbrlabs.PulumiPackage.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 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 {
		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
		}
		_, 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
		}
		_, err = scaleway.NewContainerToken(ctx, "container", &scaleway.ContainerTokenArgs{
			ContainerId: mainContainer.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.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

new ContainerToken(name: string, args?: ContainerTokenArgs, opts?: CustomResourceOptions);
@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)
@overload
def ContainerToken(resource_name: str,
                   args: Optional[ContainerTokenArgs] = None,
                   opts: Optional[ResourceOptions] = 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.

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.

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.

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.

ContainerId string

The ID of the container.

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.

containerId String

The ID of the container.

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.

containerId string

The ID of the container.

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.

container_id str

The ID of the container.

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.

containerId String

The ID of the container.

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.

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.

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.

Token string

The token.

ContainerId string

The ID of the container.

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.

Token string

The token.

containerId String

The ID of the container.

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.

token String

The token.

containerId string

The ID of the container.

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.

token string

The token.

container_id str

The ID of the container.

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.

token str

The token.

containerId String

The ID of the container.

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.

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

Package Details

Repository
https://github.com/lbrlabs/pulumi-scaleway
License
Apache-2.0
Notes

This Pulumi package is based on the scaleway Terraform Provider.