1. Packages
  2. Scaleway
  3. API Docs
  4. CockpitToken
Scaleway v1.26.0 published on Friday, Mar 28, 2025 by pulumiverse

scaleway.CockpitToken

Explore with Pulumi AI

Deprecated: scaleway.index/cockpittoken.CockpitToken has been deprecated in favor of scaleway.observability/token.Token

The scaleway.observability.Token resource allows you to create and manage your Cockpit tokens.

Refer to Cockpit’s product documentation and API documentation for more information.

Example Usage

Use a Cockpit token

The following commands allow you to:

  • create a Scaleway Project named my-project
  • create a Cockpit token named my-awesome-token inside the Project
  • assign read permissions to the token for metrics and logs
  • disable write permissions for metrics and logs
import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@pulumiverse/scaleway";

const project = new scaleway.account.Project("project", {name: "my-project"});
const main = new scaleway.observability.Token("main", {
    projectId: project.id,
    name: "my-awesome-token",
});
Copy
import pulumi
import pulumiverse_scaleway as scaleway

project = scaleway.account.Project("project", name="my-project")
main = scaleway.observability.Token("main",
    project_id=project.id,
    name="my-awesome-token")
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/account"
	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/observability"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		project, err := account.NewProject(ctx, "project", &account.ProjectArgs{
			Name: pulumi.String("my-project"),
		})
		if err != nil {
			return err
		}
		_, err = observability.NewToken(ctx, "main", &observability.TokenArgs{
			ProjectId: project.ID(),
			Name:      pulumi.String("my-awesome-token"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Pulumiverse.Scaleway;

return await Deployment.RunAsync(() => 
{
    var project = new Scaleway.Account.Project("project", new()
    {
        Name = "my-project",
    });

    var main = new Scaleway.Observability.Token("main", new()
    {
        ProjectId = project.Id,
        Name = "my-awesome-token",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.account.Project;
import com.pulumi.scaleway.account.ProjectArgs;
import com.pulumi.scaleway.observability.Token;
import com.pulumi.scaleway.observability.TokenArgs;
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 project = new Project("project", ProjectArgs.builder()
            .name("my-project")
            .build());

        var main = new Token("main", TokenArgs.builder()
            .projectId(project.id())
            .name("my-awesome-token")
            .build());

    }
}
Copy
resources:
  project:
    type: scaleway:account:Project
    properties:
      name: my-project
  main:
    type: scaleway:observability:Token
    properties:
      projectId: ${project.id}
      name: my-awesome-token
Copy
import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@pulumiverse/scaleway";

const project = new scaleway.account.Project("project", {name: "my-project"});
// Create a token that can read metrics and logs but not write
const main = new scaleway.observability.Token("main", {
    projectId: project.id,
    name: "my-awesome-token",
    scopes: {
        queryMetrics: true,
        writeMetrics: false,
        queryLogs: true,
        writeLogs: false,
    },
});
Copy
import pulumi
import pulumiverse_scaleway as scaleway

project = scaleway.account.Project("project", name="my-project")
# Create a token that can read metrics and logs but not write
main = scaleway.observability.Token("main",
    project_id=project.id,
    name="my-awesome-token",
    scopes={
        "query_metrics": True,
        "write_metrics": False,
        "query_logs": True,
        "write_logs": False,
    })
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/account"
	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/observability"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		project, err := account.NewProject(ctx, "project", &account.ProjectArgs{
			Name: pulumi.String("my-project"),
		})
		if err != nil {
			return err
		}
		// Create a token that can read metrics and logs but not write
		_, err = observability.NewToken(ctx, "main", &observability.TokenArgs{
			ProjectId: project.ID(),
			Name:      pulumi.String("my-awesome-token"),
			Scopes: &observability.TokenScopesArgs{
				QueryMetrics: pulumi.Bool(true),
				WriteMetrics: pulumi.Bool(false),
				QueryLogs:    pulumi.Bool(true),
				WriteLogs:    pulumi.Bool(false),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Pulumiverse.Scaleway;

return await Deployment.RunAsync(() => 
{
    var project = new Scaleway.Account.Project("project", new()
    {
        Name = "my-project",
    });

    // Create a token that can read metrics and logs but not write
    var main = new Scaleway.Observability.Token("main", new()
    {
        ProjectId = project.Id,
        Name = "my-awesome-token",
        Scopes = new Scaleway.Observability.Inputs.TokenScopesArgs
        {
            QueryMetrics = true,
            WriteMetrics = false,
            QueryLogs = true,
            WriteLogs = false,
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.account.Project;
import com.pulumi.scaleway.account.ProjectArgs;
import com.pulumi.scaleway.observability.Token;
import com.pulumi.scaleway.observability.TokenArgs;
import com.pulumi.scaleway.observability.inputs.TokenScopesArgs;
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 project = new Project("project", ProjectArgs.builder()
            .name("my-project")
            .build());

        // Create a token that can read metrics and logs but not write
        var main = new Token("main", TokenArgs.builder()
            .projectId(project.id())
            .name("my-awesome-token")
            .scopes(TokenScopesArgs.builder()
                .queryMetrics(true)
                .writeMetrics(false)
                .queryLogs(true)
                .writeLogs(false)
                .build())
            .build());

    }
}
Copy
resources:
  project:
    type: scaleway:account:Project
    properties:
      name: my-project
  # Create a token that can read metrics and logs but not write
  main:
    type: scaleway:observability:Token
    properties:
      projectId: ${project.id}
      name: my-awesome-token
      scopes:
        queryMetrics: true
        writeMetrics: false
        queryLogs: true
        writeLogs: false
Copy

Create CockpitToken Resource

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

Constructor syntax

new CockpitToken(name: string, args?: CockpitTokenArgs, opts?: CustomResourceOptions);
@overload
def CockpitToken(resource_name: str,
                 args: Optional[CockpitTokenArgs] = None,
                 opts: Optional[ResourceOptions] = None)

@overload
def CockpitToken(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 name: Optional[str] = None,
                 project_id: Optional[str] = None,
                 region: Optional[str] = None,
                 scopes: Optional[CockpitTokenScopesArgs] = None)
func NewCockpitToken(ctx *Context, name string, args *CockpitTokenArgs, opts ...ResourceOption) (*CockpitToken, error)
public CockpitToken(string name, CockpitTokenArgs? args = null, CustomResourceOptions? opts = null)
public CockpitToken(String name, CockpitTokenArgs args)
public CockpitToken(String name, CockpitTokenArgs args, CustomResourceOptions options)
type: scaleway:CockpitToken
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args CockpitTokenArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args CockpitTokenArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args CockpitTokenArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args CockpitTokenArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. CockpitTokenArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

Name Changes to this property will trigger replacement. string
The name of the token.
ProjectId Changes to this property will trigger replacement. string
) The ID of the Project the Cockpit is associated with.
Region Changes to this property will trigger replacement. string
) The region where the Cockpit token is located.
Scopes Changes to this property will trigger replacement. Pulumiverse.Scaleway.Inputs.CockpitTokenScopes
Scopes allowed, each with default values:
Name Changes to this property will trigger replacement. string
The name of the token.
ProjectId Changes to this property will trigger replacement. string
) The ID of the Project the Cockpit is associated with.
Region Changes to this property will trigger replacement. string
) The region where the Cockpit token is located.
Scopes Changes to this property will trigger replacement. CockpitTokenScopesArgs
Scopes allowed, each with default values:
name Changes to this property will trigger replacement. String
The name of the token.
projectId Changes to this property will trigger replacement. String
) The ID of the Project the Cockpit is associated with.
region Changes to this property will trigger replacement. String
) The region where the Cockpit token is located.
scopes Changes to this property will trigger replacement. CockpitTokenScopes
Scopes allowed, each with default values:
name Changes to this property will trigger replacement. string
The name of the token.
projectId Changes to this property will trigger replacement. string
) The ID of the Project the Cockpit is associated with.
region Changes to this property will trigger replacement. string
) The region where the Cockpit token is located.
scopes Changes to this property will trigger replacement. CockpitTokenScopes
Scopes allowed, each with default values:
name Changes to this property will trigger replacement. str
The name of the token.
project_id Changes to this property will trigger replacement. str
) The ID of the Project the Cockpit is associated with.
region Changes to this property will trigger replacement. str
) The region where the Cockpit token is located.
scopes Changes to this property will trigger replacement. CockpitTokenScopesArgs
Scopes allowed, each with default values:
name Changes to this property will trigger replacement. String
The name of the token.
projectId Changes to this property will trigger replacement. String
) The ID of the Project the Cockpit is associated with.
region Changes to this property will trigger replacement. String
) The region where the Cockpit token is located.
scopes Changes to this property will trigger replacement. Property Map
Scopes allowed, each with default values:

Outputs

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

CreatedAt string
The date and time of the creation of the Cockpit Token (Format ISO 8601)
Id string
The provider-assigned unique ID for this managed resource.
SecretKey string
The secret key of the token.
UpdatedAt string
The date and time of the last update of the Cockpit Token (Format ISO 8601)
CreatedAt string
The date and time of the creation of the Cockpit Token (Format ISO 8601)
Id string
The provider-assigned unique ID for this managed resource.
SecretKey string
The secret key of the token.
UpdatedAt string
The date and time of the last update of the Cockpit Token (Format ISO 8601)
createdAt String
The date and time of the creation of the Cockpit Token (Format ISO 8601)
id String
The provider-assigned unique ID for this managed resource.
secretKey String
The secret key of the token.
updatedAt String
The date and time of the last update of the Cockpit Token (Format ISO 8601)
createdAt string
The date and time of the creation of the Cockpit Token (Format ISO 8601)
id string
The provider-assigned unique ID for this managed resource.
secretKey string
The secret key of the token.
updatedAt string
The date and time of the last update of the Cockpit Token (Format ISO 8601)
created_at str
The date and time of the creation of the Cockpit Token (Format ISO 8601)
id str
The provider-assigned unique ID for this managed resource.
secret_key str
The secret key of the token.
updated_at str
The date and time of the last update of the Cockpit Token (Format ISO 8601)
createdAt String
The date and time of the creation of the Cockpit Token (Format ISO 8601)
id String
The provider-assigned unique ID for this managed resource.
secretKey String
The secret key of the token.
updatedAt String
The date and time of the last update of the Cockpit Token (Format ISO 8601)

Look up Existing CockpitToken Resource

Get an existing CockpitToken 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?: CockpitTokenState, opts?: CustomResourceOptions): CockpitToken
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        created_at: Optional[str] = None,
        name: Optional[str] = None,
        project_id: Optional[str] = None,
        region: Optional[str] = None,
        scopes: Optional[CockpitTokenScopesArgs] = None,
        secret_key: Optional[str] = None,
        updated_at: Optional[str] = None) -> CockpitToken
func GetCockpitToken(ctx *Context, name string, id IDInput, state *CockpitTokenState, opts ...ResourceOption) (*CockpitToken, error)
public static CockpitToken Get(string name, Input<string> id, CockpitTokenState? state, CustomResourceOptions? opts = null)
public static CockpitToken get(String name, Output<String> id, CockpitTokenState state, CustomResourceOptions options)
resources:  _:    type: scaleway:CockpitToken    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
CreatedAt string
The date and time of the creation of the Cockpit Token (Format ISO 8601)
Name Changes to this property will trigger replacement. string
The name of the token.
ProjectId Changes to this property will trigger replacement. string
) The ID of the Project the Cockpit is associated with.
Region Changes to this property will trigger replacement. string
) The region where the Cockpit token is located.
Scopes Changes to this property will trigger replacement. Pulumiverse.Scaleway.Inputs.CockpitTokenScopes
Scopes allowed, each with default values:
SecretKey string
The secret key of the token.
UpdatedAt string
The date and time of the last update of the Cockpit Token (Format ISO 8601)
CreatedAt string
The date and time of the creation of the Cockpit Token (Format ISO 8601)
Name Changes to this property will trigger replacement. string
The name of the token.
ProjectId Changes to this property will trigger replacement. string
) The ID of the Project the Cockpit is associated with.
Region Changes to this property will trigger replacement. string
) The region where the Cockpit token is located.
Scopes Changes to this property will trigger replacement. CockpitTokenScopesArgs
Scopes allowed, each with default values:
SecretKey string
The secret key of the token.
UpdatedAt string
The date and time of the last update of the Cockpit Token (Format ISO 8601)
createdAt String
The date and time of the creation of the Cockpit Token (Format ISO 8601)
name Changes to this property will trigger replacement. String
The name of the token.
projectId Changes to this property will trigger replacement. String
) The ID of the Project the Cockpit is associated with.
region Changes to this property will trigger replacement. String
) The region where the Cockpit token is located.
scopes Changes to this property will trigger replacement. CockpitTokenScopes
Scopes allowed, each with default values:
secretKey String
The secret key of the token.
updatedAt String
The date and time of the last update of the Cockpit Token (Format ISO 8601)
createdAt string
The date and time of the creation of the Cockpit Token (Format ISO 8601)
name Changes to this property will trigger replacement. string
The name of the token.
projectId Changes to this property will trigger replacement. string
) The ID of the Project the Cockpit is associated with.
region Changes to this property will trigger replacement. string
) The region where the Cockpit token is located.
scopes Changes to this property will trigger replacement. CockpitTokenScopes
Scopes allowed, each with default values:
secretKey string
The secret key of the token.
updatedAt string
The date and time of the last update of the Cockpit Token (Format ISO 8601)
created_at str
The date and time of the creation of the Cockpit Token (Format ISO 8601)
name Changes to this property will trigger replacement. str
The name of the token.
project_id Changes to this property will trigger replacement. str
) The ID of the Project the Cockpit is associated with.
region Changes to this property will trigger replacement. str
) The region where the Cockpit token is located.
scopes Changes to this property will trigger replacement. CockpitTokenScopesArgs
Scopes allowed, each with default values:
secret_key str
The secret key of the token.
updated_at str
The date and time of the last update of the Cockpit Token (Format ISO 8601)
createdAt String
The date and time of the creation of the Cockpit Token (Format ISO 8601)
name Changes to this property will trigger replacement. String
The name of the token.
projectId Changes to this property will trigger replacement. String
) The ID of the Project the Cockpit is associated with.
region Changes to this property will trigger replacement. String
) The region where the Cockpit token is located.
scopes Changes to this property will trigger replacement. Property Map
Scopes allowed, each with default values:
secretKey String
The secret key of the token.
updatedAt String
The date and time of the last update of the Cockpit Token (Format ISO 8601)

Supporting Types

CockpitTokenScopes
, CockpitTokenScopesArgs

QueryLogs Changes to this property will trigger replacement. bool
Permission to query logs.
QueryMetrics Changes to this property will trigger replacement. bool
Permission to query metrics.
QueryTraces Changes to this property will trigger replacement. bool
Permission to query traces.
SetupAlerts Changes to this property will trigger replacement. bool
Permission to set up alerts.
SetupLogsRules Changes to this property will trigger replacement. bool
Permission to set up logs rules.
SetupMetricsRules Changes to this property will trigger replacement. bool
Permission to set up metrics rules.
WriteLogs Changes to this property will trigger replacement. bool
Permission to write logs.
WriteMetrics Changes to this property will trigger replacement. bool
Permission to write metrics.
WriteTraces Changes to this property will trigger replacement. bool
Permission to write traces.
QueryLogs Changes to this property will trigger replacement. bool
Permission to query logs.
QueryMetrics Changes to this property will trigger replacement. bool
Permission to query metrics.
QueryTraces Changes to this property will trigger replacement. bool
Permission to query traces.
SetupAlerts Changes to this property will trigger replacement. bool
Permission to set up alerts.
SetupLogsRules Changes to this property will trigger replacement. bool
Permission to set up logs rules.
SetupMetricsRules Changes to this property will trigger replacement. bool
Permission to set up metrics rules.
WriteLogs Changes to this property will trigger replacement. bool
Permission to write logs.
WriteMetrics Changes to this property will trigger replacement. bool
Permission to write metrics.
WriteTraces Changes to this property will trigger replacement. bool
Permission to write traces.
queryLogs Changes to this property will trigger replacement. Boolean
Permission to query logs.
queryMetrics Changes to this property will trigger replacement. Boolean
Permission to query metrics.
queryTraces Changes to this property will trigger replacement. Boolean
Permission to query traces.
setupAlerts Changes to this property will trigger replacement. Boolean
Permission to set up alerts.
setupLogsRules Changes to this property will trigger replacement. Boolean
Permission to set up logs rules.
setupMetricsRules Changes to this property will trigger replacement. Boolean
Permission to set up metrics rules.
writeLogs Changes to this property will trigger replacement. Boolean
Permission to write logs.
writeMetrics Changes to this property will trigger replacement. Boolean
Permission to write metrics.
writeTraces Changes to this property will trigger replacement. Boolean
Permission to write traces.
queryLogs Changes to this property will trigger replacement. boolean
Permission to query logs.
queryMetrics Changes to this property will trigger replacement. boolean
Permission to query metrics.
queryTraces Changes to this property will trigger replacement. boolean
Permission to query traces.
setupAlerts Changes to this property will trigger replacement. boolean
Permission to set up alerts.
setupLogsRules Changes to this property will trigger replacement. boolean
Permission to set up logs rules.
setupMetricsRules Changes to this property will trigger replacement. boolean
Permission to set up metrics rules.
writeLogs Changes to this property will trigger replacement. boolean
Permission to write logs.
writeMetrics Changes to this property will trigger replacement. boolean
Permission to write metrics.
writeTraces Changes to this property will trigger replacement. boolean
Permission to write traces.
query_logs Changes to this property will trigger replacement. bool
Permission to query logs.
query_metrics Changes to this property will trigger replacement. bool
Permission to query metrics.
query_traces Changes to this property will trigger replacement. bool
Permission to query traces.
setup_alerts Changes to this property will trigger replacement. bool
Permission to set up alerts.
setup_logs_rules Changes to this property will trigger replacement. bool
Permission to set up logs rules.
setup_metrics_rules Changes to this property will trigger replacement. bool
Permission to set up metrics rules.
write_logs Changes to this property will trigger replacement. bool
Permission to write logs.
write_metrics Changes to this property will trigger replacement. bool
Permission to write metrics.
write_traces Changes to this property will trigger replacement. bool
Permission to write traces.
queryLogs Changes to this property will trigger replacement. Boolean
Permission to query logs.
queryMetrics Changes to this property will trigger replacement. Boolean
Permission to query metrics.
queryTraces Changes to this property will trigger replacement. Boolean
Permission to query traces.
setupAlerts Changes to this property will trigger replacement. Boolean
Permission to set up alerts.
setupLogsRules Changes to this property will trigger replacement. Boolean
Permission to set up logs rules.
setupMetricsRules Changes to this property will trigger replacement. Boolean
Permission to set up metrics rules.
writeLogs Changes to this property will trigger replacement. Boolean
Permission to write logs.
writeMetrics Changes to this property will trigger replacement. Boolean
Permission to write metrics.
writeTraces Changes to this property will trigger replacement. Boolean
Permission to write traces.

Import

This section explains how to import a Cockpit token using the {region}/{id} format.

bash

$ pulumi import scaleway:index/cockpitToken:CockpitToken main fr-par/11111111-1111-1111-1111-111111111111
Copy

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.