scaleway.CockpitGrafanaUser
Explore with Pulumi AI
Creates and manages Scaleway Cockpit Grafana Users.
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 an editor grafana user for the cockpit
var mainCockpitGrafanaUser = new Scaleway.CockpitGrafanaUser("mainCockpitGrafanaUser", new()
{
ProjectId = mainCockpit.Apply(getCockpitResult => getCockpitResult.ProjectId),
Login = "my-awesome-user",
Role = "editor",
});
});
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.NewCockpitGrafanaUser(ctx, "mainCockpitGrafanaUser", &scaleway.CockpitGrafanaUserArgs{
ProjectId: *pulumi.String(mainCockpit.ProjectId),
Login: pulumi.String("my-awesome-user"),
Role: pulumi.String("editor"),
})
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.CockpitGrafanaUser;
import com.pulumi.scaleway.CockpitGrafanaUserArgs;
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 mainCockpitGrafanaUser = new CockpitGrafanaUser("mainCockpitGrafanaUser", CockpitGrafanaUserArgs.builder()
.projectId(mainCockpit.applyValue(getCockpitResult -> getCockpitResult.projectId()))
.login("my-awesome-user")
.role("editor")
.build());
}
}
import pulumi
import lbrlabs_pulumi_scaleway as scaleway
import pulumi_scaleway as scaleway
main_cockpit = scaleway.get_cockpit()
# Create an editor grafana user for the cockpit
main_cockpit_grafana_user = scaleway.CockpitGrafanaUser("mainCockpitGrafanaUser",
project_id=main_cockpit.project_id,
login="my-awesome-user",
role="editor")
import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@lbrlabs/pulumi-scaleway";
import * as scaleway from "@pulumi/scaleway";
const mainCockpit = scaleway.getCockpit({});
// Create an editor grafana user for the cockpit
const mainCockpitGrafanaUser = new scaleway.CockpitGrafanaUser("mainCockpitGrafanaUser", {
projectId: mainCockpit.then(mainCockpit => mainCockpit.projectId),
login: "my-awesome-user",
role: "editor",
});
resources:
# Create an editor grafana user for the cockpit
mainCockpitGrafanaUser:
type: scaleway:CockpitGrafanaUser
properties:
projectId: ${mainCockpit.projectId}
login: my-awesome-user
role: editor
variables:
mainCockpit:
fn::invoke:
Function: scaleway:getCockpit
Arguments: {}
Create CockpitGrafanaUser Resource
new CockpitGrafanaUser(name: string, args: CockpitGrafanaUserArgs, opts?: CustomResourceOptions);
@overload
def CockpitGrafanaUser(resource_name: str,
opts: Optional[ResourceOptions] = None,
login: Optional[str] = None,
project_id: Optional[str] = None,
role: Optional[str] = None)
@overload
def CockpitGrafanaUser(resource_name: str,
args: CockpitGrafanaUserArgs,
opts: Optional[ResourceOptions] = None)
func NewCockpitGrafanaUser(ctx *Context, name string, args CockpitGrafanaUserArgs, opts ...ResourceOption) (*CockpitGrafanaUser, error)
public CockpitGrafanaUser(string name, CockpitGrafanaUserArgs args, CustomResourceOptions? opts = null)
public CockpitGrafanaUser(String name, CockpitGrafanaUserArgs args)
public CockpitGrafanaUser(String name, CockpitGrafanaUserArgs args, CustomResourceOptions options)
type: scaleway:CockpitGrafanaUser
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CockpitGrafanaUserArgs
- 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 CockpitGrafanaUserArgs
- 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 CockpitGrafanaUserArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CockpitGrafanaUserArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CockpitGrafanaUserArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
CockpitGrafanaUser 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 CockpitGrafanaUser resource accepts the following input properties:
- login str
The login of the grafana user.
- role str
The role of the grafana user. Must be
editor
orviewer
.- project_
id str project_id
) The ID of the project the cockpit is associated with.
Outputs
All input properties are implicitly available as output properties. Additionally, the CockpitGrafanaUser resource produces the following output properties:
Look up Existing CockpitGrafanaUser Resource
Get an existing CockpitGrafanaUser 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?: CockpitGrafanaUserState, opts?: CustomResourceOptions): CockpitGrafanaUser
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
login: Optional[str] = None,
password: Optional[str] = None,
project_id: Optional[str] = None,
role: Optional[str] = None) -> CockpitGrafanaUser
func GetCockpitGrafanaUser(ctx *Context, name string, id IDInput, state *CockpitGrafanaUserState, opts ...ResourceOption) (*CockpitGrafanaUser, error)
public static CockpitGrafanaUser Get(string name, Input<string> id, CockpitGrafanaUserState? state, CustomResourceOptions? opts = null)
public static CockpitGrafanaUser get(String name, Output<String> id, CockpitGrafanaUserState 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.
- login str
The login of the grafana user.
- password str
The password of the grafana user
- project_
id str project_id
) The ID of the project the cockpit is associated with.- role str
The role of the grafana user. Must be
editor
orviewer
.
Import
Cockpits Grafana Users can be imported using the project ID and the grafana user ID formatted {project_id}/{grafana_user_id}
, e.g. bash
$ pulumi import scaleway:index/cockpitGrafanaUser:CockpitGrafanaUser main 11111111-1111-1111-1111-111111111111/2
Package Details
- Repository
- scaleway lbrlabs/pulumi-scaleway
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
scaleway
Terraform Provider.