1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. arms
  5. GrafanaWorkspace
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.arms.GrafanaWorkspace

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    Provides a ARMS Grafana Workspace resource.

    For information about ARMS Grafana Workspace and how to use it, see What is Grafana Workspace.

    NOTE: Available since v1.215.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const default = alicloud.resourcemanager.getResourceGroups({});
    const defaultGrafanaWorkspace = new alicloud.arms.GrafanaWorkspace("default", {
        grafanaVersion: "9.0.x",
        description: name,
        resourceGroupId: _default.then(_default => _default.ids?.[0]),
        grafanaWorkspaceEdition: "standard",
        grafanaWorkspaceName: name,
        tags: {
            Created: "tf",
            For: "example",
        },
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.resourcemanager.get_resource_groups()
    default_grafana_workspace = alicloud.arms.GrafanaWorkspace("default",
        grafana_version="9.0.x",
        description=name,
        resource_group_id=default.ids[0],
        grafana_workspace_edition="standard",
        grafana_workspace_name=name,
        tags={
            "Created": "tf",
            "For": "example",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/arms"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/resourcemanager"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_default, err := resourcemanager.GetResourceGroups(ctx, &resourcemanager.GetResourceGroupsArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = arms.NewGrafanaWorkspace(ctx, "default", &arms.GrafanaWorkspaceArgs{
    			GrafanaVersion:          pulumi.String("9.0.x"),
    			Description:             pulumi.String(name),
    			ResourceGroupId:         pulumi.String(_default.Ids[0]),
    			GrafanaWorkspaceEdition: pulumi.String("standard"),
    			GrafanaWorkspaceName:    pulumi.String(name),
    			Tags: pulumi.StringMap{
    				"Created": pulumi.String("tf"),
    				"For":     pulumi.String("example"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var @default = AliCloud.ResourceManager.GetResourceGroups.Invoke();
    
        var defaultGrafanaWorkspace = new AliCloud.Arms.GrafanaWorkspace("default", new()
        {
            GrafanaVersion = "9.0.x",
            Description = name,
            ResourceGroupId = @default.Apply(@default => @default.Apply(getResourceGroupsResult => getResourceGroupsResult.Ids[0])),
            GrafanaWorkspaceEdition = "standard",
            GrafanaWorkspaceName = name,
            Tags = 
            {
                { "Created", "tf" },
                { "For", "example" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.resourcemanager.ResourcemanagerFunctions;
    import com.pulumi.alicloud.resourcemanager.inputs.GetResourceGroupsArgs;
    import com.pulumi.alicloud.arms.GrafanaWorkspace;
    import com.pulumi.alicloud.arms.GrafanaWorkspaceArgs;
    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 config = ctx.config();
            final var name = config.get("name").orElse("terraform-example");
            final var default = ResourcemanagerFunctions.getResourceGroups();
    
            var defaultGrafanaWorkspace = new GrafanaWorkspace("defaultGrafanaWorkspace", GrafanaWorkspaceArgs.builder()
                .grafanaVersion("9.0.x")
                .description(name)
                .resourceGroupId(default_.ids()[0])
                .grafanaWorkspaceEdition("standard")
                .grafanaWorkspaceName(name)
                .tags(Map.ofEntries(
                    Map.entry("Created", "tf"),
                    Map.entry("For", "example")
                ))
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      defaultGrafanaWorkspace:
        type: alicloud:arms:GrafanaWorkspace
        name: default
        properties:
          grafanaVersion: 9.0.x
          description: ${name}
          resourceGroupId: ${default.ids[0]}
          grafanaWorkspaceEdition: standard
          grafanaWorkspaceName: ${name}
          tags:
            Created: tf
            For: example
    variables:
      default:
        fn::invoke:
          Function: alicloud:resourcemanager:getResourceGroups
          Arguments: {}
    

    Create GrafanaWorkspace Resource

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

    Constructor syntax

    new GrafanaWorkspace(name: string, args?: GrafanaWorkspaceArgs, opts?: CustomResourceOptions);
    @overload
    def GrafanaWorkspace(resource_name: str,
                         args: Optional[GrafanaWorkspaceArgs] = None,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def GrafanaWorkspace(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         description: Optional[str] = None,
                         grafana_version: Optional[str] = None,
                         grafana_workspace_edition: Optional[str] = None,
                         grafana_workspace_name: Optional[str] = None,
                         resource_group_id: Optional[str] = None,
                         tags: Optional[Mapping[str, str]] = None)
    func NewGrafanaWorkspace(ctx *Context, name string, args *GrafanaWorkspaceArgs, opts ...ResourceOption) (*GrafanaWorkspace, error)
    public GrafanaWorkspace(string name, GrafanaWorkspaceArgs? args = null, CustomResourceOptions? opts = null)
    public GrafanaWorkspace(String name, GrafanaWorkspaceArgs args)
    public GrafanaWorkspace(String name, GrafanaWorkspaceArgs args, CustomResourceOptions options)
    
    type: alicloud:arms:GrafanaWorkspace
    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 GrafanaWorkspaceArgs
    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 GrafanaWorkspaceArgs
    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 GrafanaWorkspaceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GrafanaWorkspaceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GrafanaWorkspaceArgs
    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 grafanaWorkspaceResource = new AliCloud.Arms.GrafanaWorkspace("grafanaWorkspaceResource", new()
    {
        Description = "string",
        GrafanaVersion = "string",
        GrafanaWorkspaceEdition = "string",
        GrafanaWorkspaceName = "string",
        ResourceGroupId = "string",
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := arms.NewGrafanaWorkspace(ctx, "grafanaWorkspaceResource", &arms.GrafanaWorkspaceArgs{
    	Description:             pulumi.String("string"),
    	GrafanaVersion:          pulumi.String("string"),
    	GrafanaWorkspaceEdition: pulumi.String("string"),
    	GrafanaWorkspaceName:    pulumi.String("string"),
    	ResourceGroupId:         pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var grafanaWorkspaceResource = new GrafanaWorkspace("grafanaWorkspaceResource", GrafanaWorkspaceArgs.builder()
        .description("string")
        .grafanaVersion("string")
        .grafanaWorkspaceEdition("string")
        .grafanaWorkspaceName("string")
        .resourceGroupId("string")
        .tags(Map.of("string", "string"))
        .build());
    
    grafana_workspace_resource = alicloud.arms.GrafanaWorkspace("grafanaWorkspaceResource",
        description="string",
        grafana_version="string",
        grafana_workspace_edition="string",
        grafana_workspace_name="string",
        resource_group_id="string",
        tags={
            "string": "string",
        })
    
    const grafanaWorkspaceResource = new alicloud.arms.GrafanaWorkspace("grafanaWorkspaceResource", {
        description: "string",
        grafanaVersion: "string",
        grafanaWorkspaceEdition: "string",
        grafanaWorkspaceName: "string",
        resourceGroupId: "string",
        tags: {
            string: "string",
        },
    });
    
    type: alicloud:arms:GrafanaWorkspace
    properties:
        description: string
        grafanaVersion: string
        grafanaWorkspaceEdition: string
        grafanaWorkspaceName: string
        resourceGroupId: string
        tags:
            string: string
    

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

    Description string
    Description.
    GrafanaVersion string
    The version of the grafana.
    GrafanaWorkspaceEdition string
    The edition of the grafana.
    GrafanaWorkspaceName string
    The name of the resource.
    ResourceGroupId string
    The ID of the resource group.
    Tags Dictionary<string, string>
    The tag of the resource.
    Description string
    Description.
    GrafanaVersion string
    The version of the grafana.
    GrafanaWorkspaceEdition string
    The edition of the grafana.
    GrafanaWorkspaceName string
    The name of the resource.
    ResourceGroupId string
    The ID of the resource group.
    Tags map[string]string
    The tag of the resource.
    description String
    Description.
    grafanaVersion String
    The version of the grafana.
    grafanaWorkspaceEdition String
    The edition of the grafana.
    grafanaWorkspaceName String
    The name of the resource.
    resourceGroupId String
    The ID of the resource group.
    tags Map<String,String>
    The tag of the resource.
    description string
    Description.
    grafanaVersion string
    The version of the grafana.
    grafanaWorkspaceEdition string
    The edition of the grafana.
    grafanaWorkspaceName string
    The name of the resource.
    resourceGroupId string
    The ID of the resource group.
    tags {[key: string]: string}
    The tag of the resource.
    description str
    Description.
    grafana_version str
    The version of the grafana.
    grafana_workspace_edition str
    The edition of the grafana.
    grafana_workspace_name str
    The name of the resource.
    resource_group_id str
    The ID of the resource group.
    tags Mapping[str, str]
    The tag of the resource.
    description String
    Description.
    grafanaVersion String
    The version of the grafana.
    grafanaWorkspaceEdition String
    The edition of the grafana.
    grafanaWorkspaceName String
    The name of the resource.
    resourceGroupId String
    The ID of the resource group.
    tags Map<String>
    The tag of the resource.

    Outputs

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

    CreateTime string
    The creation time of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the resource.
    CreateTime string
    The creation time of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the resource.
    createTime String
    The creation time of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the resource.
    createTime string
    The creation time of the resource.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the resource.
    create_time str
    The creation time of the resource.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of the resource.
    createTime String
    The creation time of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the resource.

    Look up Existing GrafanaWorkspace Resource

    Get an existing GrafanaWorkspace 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?: GrafanaWorkspaceState, opts?: CustomResourceOptions): GrafanaWorkspace
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            create_time: Optional[str] = None,
            description: Optional[str] = None,
            grafana_version: Optional[str] = None,
            grafana_workspace_edition: Optional[str] = None,
            grafana_workspace_name: Optional[str] = None,
            resource_group_id: Optional[str] = None,
            status: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None) -> GrafanaWorkspace
    func GetGrafanaWorkspace(ctx *Context, name string, id IDInput, state *GrafanaWorkspaceState, opts ...ResourceOption) (*GrafanaWorkspace, error)
    public static GrafanaWorkspace Get(string name, Input<string> id, GrafanaWorkspaceState? state, CustomResourceOptions? opts = null)
    public static GrafanaWorkspace get(String name, Output<String> id, GrafanaWorkspaceState 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:
    CreateTime string
    The creation time of the resource.
    Description string
    Description.
    GrafanaVersion string
    The version of the grafana.
    GrafanaWorkspaceEdition string
    The edition of the grafana.
    GrafanaWorkspaceName string
    The name of the resource.
    ResourceGroupId string
    The ID of the resource group.
    Status string
    The status of the resource.
    Tags Dictionary<string, string>
    The tag of the resource.
    CreateTime string
    The creation time of the resource.
    Description string
    Description.
    GrafanaVersion string
    The version of the grafana.
    GrafanaWorkspaceEdition string
    The edition of the grafana.
    GrafanaWorkspaceName string
    The name of the resource.
    ResourceGroupId string
    The ID of the resource group.
    Status string
    The status of the resource.
    Tags map[string]string
    The tag of the resource.
    createTime String
    The creation time of the resource.
    description String
    Description.
    grafanaVersion String
    The version of the grafana.
    grafanaWorkspaceEdition String
    The edition of the grafana.
    grafanaWorkspaceName String
    The name of the resource.
    resourceGroupId String
    The ID of the resource group.
    status String
    The status of the resource.
    tags Map<String,String>
    The tag of the resource.
    createTime string
    The creation time of the resource.
    description string
    Description.
    grafanaVersion string
    The version of the grafana.
    grafanaWorkspaceEdition string
    The edition of the grafana.
    grafanaWorkspaceName string
    The name of the resource.
    resourceGroupId string
    The ID of the resource group.
    status string
    The status of the resource.
    tags {[key: string]: string}
    The tag of the resource.
    create_time str
    The creation time of the resource.
    description str
    Description.
    grafana_version str
    The version of the grafana.
    grafana_workspace_edition str
    The edition of the grafana.
    grafana_workspace_name str
    The name of the resource.
    resource_group_id str
    The ID of the resource group.
    status str
    The status of the resource.
    tags Mapping[str, str]
    The tag of the resource.
    createTime String
    The creation time of the resource.
    description String
    Description.
    grafanaVersion String
    The version of the grafana.
    grafanaWorkspaceEdition String
    The edition of the grafana.
    grafanaWorkspaceName String
    The name of the resource.
    resourceGroupId String
    The ID of the resource group.
    status String
    The status of the resource.
    tags Map<String>
    The tag of the resource.

    Import

    ARMS Grafana Workspace can be imported using the id, e.g.

    $ pulumi import alicloud:arms/grafanaWorkspace:GrafanaWorkspace example <id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi