
Scaleway v1.8.0, Apr 11 23

Scaleway v1.8.0, Apr 11 23
scaleway.CockpitToken
Explore with Pulumi AI
Creates and manages Scaleway Cockpit Tokens.
For more information consult the documentation.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Lbrlabs.PulumiPackage.Scaleway;
using Scaleway = Pulumi.Scaleway;
return await Deployment.RunAsync(() =>
{
var mainCockpit = Scaleway.GetCockpit.Invoke();
// Create a token for the cockpit that can write metrics and logs
var mainCockpitToken = new Scaleway.CockpitToken("mainCockpitToken", new()
{
ProjectId = mainCockpit.Apply(getCockpitResult => getCockpitResult.ProjectId),
});
});
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 {
mainCockpit, err := scaleway.LookupCockpit(ctx, nil, nil)
if err != nil {
return err
}
_, err = scaleway.NewCockpitToken(ctx, "mainCockpitToken", &scaleway.CockpitTokenArgs{
ProjectId: *pulumi.String(mainCockpit.ProjectId),
})
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.ScalewayFunctions;
import com.pulumi.scaleway.inputs.GetCockpitArgs;
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) {
final var mainCockpit = ScalewayFunctions.getCockpit();
var mainCockpitToken = new CockpitToken("mainCockpitToken", CockpitTokenArgs.builder()
.projectId(mainCockpit.applyValue(getCockpitResult -> getCockpitResult.projectId()))
.build());
}
}
import pulumi
import lbrlabs_pulumi_scaleway as scaleway
import pulumi_scaleway as scaleway
main_cockpit = scaleway.get_cockpit()
# Create a token for the cockpit that can write metrics and logs
main_cockpit_token = scaleway.CockpitToken("mainCockpitToken", project_id=main_cockpit.project_id)
import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@lbrlabs/pulumi-scaleway";
import * as scaleway from "@pulumi/scaleway";
const mainCockpit = scaleway.getCockpit({});
// Create a token for the cockpit that can write metrics and logs
const mainCockpitToken = new scaleway.CockpitToken("mainCockpitToken", {projectId: mainCockpit.then(mainCockpit => mainCockpit.projectId)});
resources:
# Create a token for the cockpit that can write metrics and logs
mainCockpitToken:
type: scaleway:CockpitToken
properties:
projectId: ${mainCockpit.projectId}
variables:
mainCockpit:
fn::invoke:
Function: scaleway:getCockpit
Arguments: {}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Lbrlabs.PulumiPackage.Scaleway;
using Scaleway = Pulumi.Scaleway;
return await Deployment.RunAsync(() =>
{
var mainCockpit = Scaleway.GetCockpit.Invoke();
// Create a token for the cockpit that can read metrics and logs but not write
var mainCockpitToken = new Scaleway.CockpitToken("mainCockpitToken", new()
{
ProjectId = mainCockpit.Apply(getCockpitResult => getCockpitResult.ProjectId),
Scopes = new Scaleway.Inputs.CockpitTokenScopesArgs
{
QueryMetrics = true,
WriteMetrics = false,
QueryLogs = true,
WriteLogs = false,
},
});
});
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 {
mainCockpit, err := scaleway.LookupCockpit(ctx, nil, nil)
if err != nil {
return err
}
_, err = scaleway.NewCockpitToken(ctx, "mainCockpitToken", &scaleway.CockpitTokenArgs{
ProjectId: *pulumi.String(mainCockpit.ProjectId),
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
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.ScalewayFunctions;
import com.pulumi.scaleway.inputs.GetCockpitArgs;
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) {
final var mainCockpit = ScalewayFunctions.getCockpit();
var mainCockpitToken = new CockpitToken("mainCockpitToken", CockpitTokenArgs.builder()
.projectId(mainCockpit.applyValue(getCockpitResult -> getCockpitResult.projectId()))
.scopes(CockpitTokenScopesArgs.builder()
.queryMetrics(true)
.writeMetrics(false)
.queryLogs(true)
.writeLogs(false)
.build())
.build());
}
}
import pulumi
import lbrlabs_pulumi_scaleway as scaleway
import pulumi_scaleway as scaleway
main_cockpit = scaleway.get_cockpit()
# Create a token for the cockpit that can read metrics and logs but not write
main_cockpit_token = scaleway.CockpitToken("mainCockpitToken",
project_id=main_cockpit.project_id,
scopes=scaleway.CockpitTokenScopesArgs(
query_metrics=True,
write_metrics=False,
query_logs=True,
write_logs=False,
))
import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@lbrlabs/pulumi-scaleway";
import * as scaleway from "@pulumi/scaleway";
const mainCockpit = scaleway.getCockpit({});
// Create a token for the cockpit that can read metrics and logs but not write
const mainCockpitToken = new scaleway.CockpitToken("mainCockpitToken", {
projectId: mainCockpit.then(mainCockpit => mainCockpit.projectId),
scopes: {
queryMetrics: true,
writeMetrics: false,
queryLogs: true,
writeLogs: false,
},
});
resources:
# Create a token for the cockpit that can read metrics and logs but not write
mainCockpitToken:
type: scaleway:CockpitToken
properties:
projectId: ${mainCockpit.projectId}
scopes:
queryMetrics: true
writeMetrics: false
queryLogs: true
writeLogs: false
variables:
mainCockpit:
fn::invoke:
Function: scaleway:getCockpit
Arguments: {}
Create CockpitToken Resource
new CockpitToken(name: string, args?: CockpitTokenArgs, opts?: CustomResourceOptions);
@overload
def CockpitToken(resource_name: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
project_id: Optional[str] = None,
scopes: Optional[CockpitTokenScopesArgs] = None)
@overload
def CockpitToken(resource_name: str,
args: Optional[CockpitTokenArgs] = None,
opts: Optional[ResourceOptions] = 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.
- 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.
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.- Scopes
Lbrlabs.
Pulumi Package. Scaleway. Inputs. 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.- 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.- 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.- scopes
Cockpit
Token Scopes Args Allowed scopes
- name str
The name of the token
- project_
id str project_id
) The ID of the project the cockpit is associated with.- 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.- scopes Property Map
Allowed scopes
Outputs
All input properties are implicitly available as output properties. Additionally, the CockpitToken resource produces the following output properties:
- id str
The provider-assigned unique ID for this managed resource.
- secret_
key str The secret key of the token
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,
name: Optional[str] = None,
project_id: Optional[str] = None,
scopes: Optional[CockpitTokenScopesArgs] = None,
secret_key: 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.
- Name string
The name of the token
- Project
Id string project_id
) The ID of the project the cockpit is associated with.- Scopes
Lbrlabs.
Pulumi Package. Scaleway. Inputs. Cockpit Token Scopes Args Allowed scopes
- Secret
Key string The secret key of the token
- Name string
The name of the token
- Project
Id string project_id
) The ID of the project the cockpit is associated with.- Scopes
Cockpit
Token Scopes Args Allowed scopes
- Secret
Key string The secret key of the token
- name String
The name of the token
- project
Id String project_id
) The ID of the project the cockpit is associated with.- scopes
Cockpit
Token Scopes Args Allowed scopes
- secret
Key String The secret key of the token
- name string
The name of the token
- project
Id string project_id
) The ID of the project the cockpit is associated with.- scopes
Cockpit
Token Scopes Args Allowed scopes
- secret
Key string The secret key of the token
- name str
The name of the token
- project_
id str project_id
) The ID of the project the cockpit is associated with.- scopes
Cockpit
Token Scopes Args Allowed scopes
- secret_
key str The secret key of the token
- name String
The name of the token
- project
Id String project_id
) The ID of the project the cockpit is associated with.- scopes Property Map
Allowed scopes
- secret
Key String The secret key of the token
Supporting Types
CockpitTokenScopes
- Query
Logs bool Query logs
- Query
Metrics bool Query metrics
- 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
- Query
Logs bool Query logs
- Query
Metrics bool Query metrics
- 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
- query
Logs Boolean Query logs
- query
Metrics Boolean Query metrics
- 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
- query
Logs boolean Query logs
- query
Metrics boolean Query metrics
- 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
- query_
logs bool Query logs
- query_
metrics bool Query metrics
- 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
- query
Logs Boolean Query logs
- query
Metrics Boolean Query metrics
- 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
Import
Cockpits can be imported using the token ID, e.g. bash
$ pulumi import scaleway:index/cockpitToken:CockpitToken main 11111111-1111-1111-1111-111111111111
Package Details
- Repository
- scaleway lbrlabs/pulumi-scaleway
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
scaleway
Terraform Provider.