scaleway.CockpitToken
Explore with Pulumi AI
Creates and manages Scaleway Cockpit Tokens.
For more information consult the documentation.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@pulumiverse/scaleway";
const project = new scaleway.AccountProject("project", {});
const main = new scaleway.CockpitToken("main", {projectId: project.id});
import pulumi
import pulumiverse_scaleway as scaleway
project = scaleway.AccountProject("project")
main = scaleway.CockpitToken("main", project_id=project.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 {
project, err := scaleway.NewAccountProject(ctx, "project", nil)
if err != nil {
return err
}
_, err = scaleway.NewCockpitToken(ctx, "main", &scaleway.CockpitTokenArgs{
ProjectId: project.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 project = new Scaleway.AccountProject("project");
var main = new Scaleway.CockpitToken("main", new()
{
ProjectId = project.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.AccountProject;
import com.pulumi.scaleway.CockpitToken;
import com.pulumi.scaleway.CockpitTokenArgs;
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 AccountProject("project");
var main = new CockpitToken("main", CockpitTokenArgs.builder()
.projectId(project.id())
.build());
}
}
resources:
project:
type: scaleway:AccountProject
main:
type: scaleway:CockpitToken
properties:
projectId: ${project.id}
import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@pulumiverse/scaleway";
const project = new scaleway.AccountProject("project", {});
// Create a token that can read metrics and logs but not write
const main = new scaleway.CockpitToken("main", {
projectId: project.id,
scopes: {
queryMetrics: true,
writeMetrics: false,
queryLogs: true,
writeLogs: false,
},
});
import pulumi
import pulumiverse_scaleway as scaleway
project = scaleway.AccountProject("project")
# Create a token that can read metrics and logs but not write
main = scaleway.CockpitToken("main",
project_id=project.id,
scopes=scaleway.CockpitTokenScopesArgs(
query_metrics=True,
write_metrics=False,
query_logs=True,
write_logs=False,
))
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 {
project, err := scaleway.NewAccountProject(ctx, "project", nil)
if err != nil {
return err
}
// Create a token that can read metrics and logs but not write
_, err = scaleway.NewCockpitToken(ctx, "main", &scaleway.CockpitTokenArgs{
ProjectId: project.ID(),
Scopes: &scaleway.CockpitTokenScopesArgs{
QueryMetrics: pulumi.Bool(true),
WriteMetrics: pulumi.Bool(false),
QueryLogs: pulumi.Bool(true),
WriteLogs: pulumi.Bool(false),
},
})
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 project = new Scaleway.AccountProject("project");
// Create a token that can read metrics and logs but not write
var main = new Scaleway.CockpitToken("main", new()
{
ProjectId = project.Id,
Scopes = new Scaleway.Inputs.CockpitTokenScopesArgs
{
QueryMetrics = true,
WriteMetrics = false,
QueryLogs = true,
WriteLogs = false,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.AccountProject;
import com.pulumi.scaleway.CockpitToken;
import com.pulumi.scaleway.CockpitTokenArgs;
import com.pulumi.scaleway.inputs.CockpitTokenScopesArgs;
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 AccountProject("project");
// Create a token that can read metrics and logs but not write
var main = new CockpitToken("main", CockpitTokenArgs.builder()
.projectId(project.id())
.scopes(CockpitTokenScopesArgs.builder()
.queryMetrics(true)
.writeMetrics(false)
.queryLogs(true)
.writeLogs(false)
.build())
.build());
}
}
resources:
project:
type: scaleway:AccountProject
# Create a token that can read metrics and logs but not write
main:
type: scaleway:CockpitToken
properties:
projectId: ${project.id}
scopes:
queryMetrics: true
writeMetrics: false
queryLogs: true
writeLogs: false
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 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 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 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 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 String
- The unique name of the resource.
- args CockpitTokenArgs
- 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 cockpitTokenResource = new Scaleway.CockpitToken("cockpitTokenResource", new()
{
Name = "string",
ProjectId = "string",
Region = "string",
Scopes = new Scaleway.Inputs.CockpitTokenScopesArgs
{
QueryLogs = false,
QueryMetrics = false,
QueryTraces = false,
SetupAlerts = false,
SetupLogsRules = false,
SetupMetricsRules = false,
WriteLogs = false,
WriteMetrics = false,
WriteTraces = false,
},
});
example, err := scaleway.NewCockpitToken(ctx, "cockpitTokenResource", &scaleway.CockpitTokenArgs{
Name: pulumi.String("string"),
ProjectId: pulumi.String("string"),
Region: pulumi.String("string"),
Scopes: &scaleway.CockpitTokenScopesArgs{
QueryLogs: pulumi.Bool(false),
QueryMetrics: pulumi.Bool(false),
QueryTraces: pulumi.Bool(false),
SetupAlerts: pulumi.Bool(false),
SetupLogsRules: pulumi.Bool(false),
SetupMetricsRules: pulumi.Bool(false),
WriteLogs: pulumi.Bool(false),
WriteMetrics: pulumi.Bool(false),
WriteTraces: pulumi.Bool(false),
},
})
var cockpitTokenResource = new CockpitToken("cockpitTokenResource", CockpitTokenArgs.builder()
.name("string")
.projectId("string")
.region("string")
.scopes(CockpitTokenScopesArgs.builder()
.queryLogs(false)
.queryMetrics(false)
.queryTraces(false)
.setupAlerts(false)
.setupLogsRules(false)
.setupMetricsRules(false)
.writeLogs(false)
.writeMetrics(false)
.writeTraces(false)
.build())
.build());
cockpit_token_resource = scaleway.CockpitToken("cockpitTokenResource",
name="string",
project_id="string",
region="string",
scopes=scaleway.CockpitTokenScopesArgs(
query_logs=False,
query_metrics=False,
query_traces=False,
setup_alerts=False,
setup_logs_rules=False,
setup_metrics_rules=False,
write_logs=False,
write_metrics=False,
write_traces=False,
))
const cockpitTokenResource = new scaleway.CockpitToken("cockpitTokenResource", {
name: "string",
projectId: "string",
region: "string",
scopes: {
queryLogs: false,
queryMetrics: false,
queryTraces: false,
setupAlerts: false,
setupLogsRules: false,
setupMetricsRules: false,
writeLogs: false,
writeMetrics: false,
writeTraces: false,
},
});
type: scaleway:CockpitToken
properties:
name: string
projectId: string
region: string
scopes:
queryLogs: false
queryMetrics: false
queryTraces: false
setupAlerts: false
setupLogsRules: false
setupMetricsRules: false
writeLogs: false
writeMetrics: false
writeTraces: false
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
The CockpitToken resource accepts the following input properties:
- Name string
- The name of the token.
- Project
Id string project_id
) The ID of the project the cockpit is associated with.- Region string
region
) The region of the cockpit token.- Scopes
Pulumiverse.
Scaleway. Inputs. Cockpit Token Scopes - Allowed scopes.
- Name string
- The name of the token.
- Project
Id string project_id
) The ID of the project the cockpit is associated with.- Region string
region
) The region of the cockpit token.- Scopes
Cockpit
Token Scopes Args - Allowed scopes.
- name String
- The name of the token.
- project
Id String project_id
) The ID of the project the cockpit is associated with.- region String
region
) The region of the cockpit token.- scopes
Cockpit
Token Scopes - Allowed scopes.
- name string
- The name of the token.
- project
Id string project_id
) The ID of the project the cockpit is associated with.- region string
region
) The region of the cockpit token.- scopes
Cockpit
Token Scopes - Allowed scopes.
- name str
- The name of the token.
- project_
id str project_id
) The ID of the project the cockpit is associated with.- region str
region
) The region of the cockpit token.- scopes
Cockpit
Token Scopes Args - Allowed scopes.
- name String
- The name of the token.
- project
Id String project_id
) The ID of the project the cockpit is associated with.- region String
region
) The region of the cockpit token.- scopes Property Map
- Allowed scopes.
Outputs
All input properties are implicitly available as output properties. Additionally, the CockpitToken resource produces the following output properties:
- 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)
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)
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.
- Created
At string - The date and time of the creation of the Cockpit Token (Format ISO 8601)
- Name string
- The name of the token.
- Project
Id string project_id
) The ID of the project the cockpit is associated with.- Region string
region
) The region of the cockpit token.- Scopes
Pulumiverse.
Scaleway. Inputs. Cockpit Token Scopes - Allowed scopes.
- Secret
Key string - The secret key of the token.
- Updated
At string - The date and time of the last update of the Cockpit Token (Format ISO 8601)
- Created
At string - The date and time of the creation of the Cockpit Token (Format ISO 8601)
- Name string
- The name of the token.
- Project
Id string project_id
) The ID of the project the cockpit is associated with.- Region string
region
) The region of the cockpit token.- Scopes
Cockpit
Token Scopes Args - Allowed scopes.
- Secret
Key string - The secret key of the token.
- Updated
At string - The date and time of the last update of the Cockpit Token (Format ISO 8601)
- created
At String - The date and time of the creation of the Cockpit Token (Format ISO 8601)
- name String
- The name of the token.
- project
Id String project_id
) The ID of the project the cockpit is associated with.- region String
region
) The region of the cockpit token.- scopes
Cockpit
Token Scopes - Allowed scopes.
- secret
Key String - The secret key of the token.
- updated
At String - The date and time of the last update of the Cockpit Token (Format ISO 8601)
- created
At string - The date and time of the creation of the Cockpit Token (Format ISO 8601)
- name string
- The name of the token.
- project
Id string project_id
) The ID of the project the cockpit is associated with.- region string
region
) The region of the cockpit token.- scopes
Cockpit
Token Scopes - Allowed scopes.
- secret
Key string - The secret key of the token.
- updated
At 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 str
- The name of the token.
- project_
id str project_id
) The ID of the project the cockpit is associated with.- region str
region
) The region of the cockpit token.- scopes
Cockpit
Token Scopes Args - Allowed scopes.
- 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)
- created
At String - The date and time of the creation of the Cockpit Token (Format ISO 8601)
- name String
- The name of the token.
- project
Id String project_id
) The ID of the project the cockpit is associated with.- region String
region
) The region of the cockpit token.- scopes Property Map
- Allowed scopes.
- secret
Key String - The secret key of the token.
- updated
At String - The date and time of the last update of the Cockpit Token (Format ISO 8601)
Supporting Types
CockpitTokenScopes, CockpitTokenScopesArgs
- Query
Logs bool - Query logs.
- Query
Metrics bool - Query metrics.
- Query
Traces bool - Query traces.
- Setup
Alerts bool - Setup alerts.
- Setup
Logs boolRules - Setup logs rules.
- Setup
Metrics boolRules - Setup metrics rules.
- Write
Logs bool - Write logs.
- Write
Metrics bool - Write metrics.
- Write
Traces bool - Write traces.
- Query
Logs bool - Query logs.
- Query
Metrics bool - Query metrics.
- Query
Traces bool - Query traces.
- Setup
Alerts bool - Setup alerts.
- Setup
Logs boolRules - Setup logs rules.
- Setup
Metrics boolRules - Setup metrics rules.
- Write
Logs bool - Write logs.
- Write
Metrics bool - Write metrics.
- Write
Traces bool - Write traces.
- query
Logs Boolean - Query logs.
- query
Metrics Boolean - Query metrics.
- query
Traces Boolean - Query traces.
- setup
Alerts Boolean - Setup alerts.
- setup
Logs BooleanRules - Setup logs rules.
- setup
Metrics BooleanRules - Setup metrics rules.
- write
Logs Boolean - Write logs.
- write
Metrics Boolean - Write metrics.
- write
Traces Boolean - Write traces.
- query
Logs boolean - Query logs.
- query
Metrics boolean - Query metrics.
- query
Traces boolean - Query traces.
- setup
Alerts boolean - Setup alerts.
- setup
Logs booleanRules - Setup logs rules.
- setup
Metrics booleanRules - Setup metrics rules.
- write
Logs boolean - Write logs.
- write
Metrics boolean - Write metrics.
- write
Traces boolean - Write traces.
- query_
logs bool - Query logs.
- query_
metrics bool - Query metrics.
- query_
traces bool - Query traces.
- setup_
alerts bool - Setup alerts.
- setup_
logs_ boolrules - Setup logs rules.
- setup_
metrics_ boolrules - Setup metrics rules.
- write_
logs bool - Write logs.
- write_
metrics bool - Write metrics.
- write_
traces bool - Write traces.
- query
Logs Boolean - Query logs.
- query
Metrics Boolean - Query metrics.
- query
Traces Boolean - Query traces.
- setup
Alerts Boolean - Setup alerts.
- setup
Logs BooleanRules - Setup logs rules.
- setup
Metrics BooleanRules - Setup metrics rules.
- write
Logs Boolean - Write logs.
- write
Metrics Boolean - Write metrics.
- write
Traces Boolean - Write traces.
Import
Cockpits tokens can be imported using the {region}/{id}
, e.g.
bash
$ pulumi import scaleway:index/cockpitToken:CockpitToken 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.