1. Packages
  2. Grafana Cloud
  3. API Docs
  4. enterprise
  5. DataSourceConfigLbacRules
Grafana v0.10.0 published on Friday, Jan 10, 2025 by pulumiverse

grafana.enterprise.DataSourceConfigLbacRules

Explore with Pulumi AI

grafana logo
Grafana v0.10.0 published on Friday, Jan 10, 2025 by pulumiverse

    Manages LBAC rules for a data source.

    !> Warning: The resource is experimental and will be subject to change. This resource manages the entire LBAC rules tree, and will overwrite any existing rules.

    This resource requires Grafana >=11.5.0.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as grafana from "@pulumiverse/grafana";
    
    const team = new grafana.oss.Team("team", {name: "Team Name"});
    const test = new grafana.oss.DataSource("test", {
        type: "loki",
        name: "loki-from-terraform",
        url: "https://mylokiurl.net",
        basicAuthEnabled: true,
        basicAuthUsername: "username",
        jsonDataEncoded: JSON.stringify({
            authType: "default",
            basicAuthPassword: "password",
        }),
    });
    
    import pulumi
    import json
    import pulumiverse_grafana as grafana
    
    team = grafana.oss.Team("team", name="Team Name")
    test = grafana.oss.DataSource("test",
        type="loki",
        name="loki-from-terraform",
        url="https://mylokiurl.net",
        basic_auth_enabled=True,
        basic_auth_username="username",
        json_data_encoded=json.dumps({
            "authType": "default",
            "basicAuthPassword": "password",
        }))
    
    package main
    
    import (
    	"encoding/json"
    
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-grafana/sdk/go/grafana/oss"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := oss.NewTeam(ctx, "team", &oss.TeamArgs{
    			Name: pulumi.String("Team Name"),
    		})
    		if err != nil {
    			return err
    		}
    		tmpJSON0, err := json.Marshal(map[string]interface{}{
    			"authType":          "default",
    			"basicAuthPassword": "password",
    		})
    		if err != nil {
    			return err
    		}
    		json0 := string(tmpJSON0)
    		_, err = oss.NewDataSource(ctx, "test", &oss.DataSourceArgs{
    			Type:              pulumi.String("loki"),
    			Name:              pulumi.String("loki-from-terraform"),
    			Url:               pulumi.String("https://mylokiurl.net"),
    			BasicAuthEnabled:  pulumi.Bool(true),
    			BasicAuthUsername: pulumi.String("username"),
    			JsonDataEncoded:   pulumi.String(json0),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.Json;
    using Pulumi;
    using Grafana = Pulumiverse.Grafana;
    
    return await Deployment.RunAsync(() => 
    {
        var team = new Grafana.Oss.Team("team", new()
        {
            Name = "Team Name",
        });
    
        var test = new Grafana.Oss.DataSource("test", new()
        {
            Type = "loki",
            Name = "loki-from-terraform",
            Url = "https://mylokiurl.net",
            BasicAuthEnabled = true,
            BasicAuthUsername = "username",
            JsonDataEncoded = JsonSerializer.Serialize(new Dictionary<string, object?>
            {
                ["authType"] = "default",
                ["basicAuthPassword"] = "password",
            }),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.grafana.oss.Team;
    import com.pulumi.grafana.oss.TeamArgs;
    import com.pulumi.grafana.oss.DataSource;
    import com.pulumi.grafana.oss.DataSourceArgs;
    import static com.pulumi.codegen.internal.Serialization.*;
    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 team = new Team("team", TeamArgs.builder()
                .name("Team Name")
                .build());
    
            var test = new DataSource("test", DataSourceArgs.builder()
                .type("loki")
                .name("loki-from-terraform")
                .url("https://mylokiurl.net")
                .basicAuthEnabled(true)
                .basicAuthUsername("username")
                .jsonDataEncoded(serializeJson(
                    jsonObject(
                        jsonProperty("authType", "default"),
                        jsonProperty("basicAuthPassword", "password")
                    )))
                .build());
    
        }
    }
    
    resources:
      team:
        type: grafana:oss:Team
        properties:
          name: Team Name
      test:
        type: grafana:oss:DataSource
        properties:
          type: loki
          name: loki-from-terraform
          url: https://mylokiurl.net
          basicAuthEnabled: true
          basicAuthUsername: username
          jsonDataEncoded:
            fn::toJSON:
              authType: default
              basicAuthPassword: password
    

    Create DataSourceConfigLbacRules Resource

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

    Constructor syntax

    new DataSourceConfigLbacRules(name: string, args: DataSourceConfigLbacRulesArgs, opts?: CustomResourceOptions);
    @overload
    def DataSourceConfigLbacRules(resource_name: str,
                                  args: DataSourceConfigLbacRulesArgs,
                                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def DataSourceConfigLbacRules(resource_name: str,
                                  opts: Optional[ResourceOptions] = None,
                                  datasource_uid: Optional[str] = None,
                                  rules: Optional[str] = None)
    func NewDataSourceConfigLbacRules(ctx *Context, name string, args DataSourceConfigLbacRulesArgs, opts ...ResourceOption) (*DataSourceConfigLbacRules, error)
    public DataSourceConfigLbacRules(string name, DataSourceConfigLbacRulesArgs args, CustomResourceOptions? opts = null)
    public DataSourceConfigLbacRules(String name, DataSourceConfigLbacRulesArgs args)
    public DataSourceConfigLbacRules(String name, DataSourceConfigLbacRulesArgs args, CustomResourceOptions options)
    
    type: grafana:enterprise:DataSourceConfigLbacRules
    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 DataSourceConfigLbacRulesArgs
    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 DataSourceConfigLbacRulesArgs
    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 DataSourceConfigLbacRulesArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DataSourceConfigLbacRulesArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DataSourceConfigLbacRulesArgs
    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 dataSourceConfigLbacRulesResource = new Grafana.Enterprise.DataSourceConfigLbacRules("dataSourceConfigLbacRulesResource", new()
    {
        DatasourceUid = "string",
        Rules = "string",
    });
    
    example, err := enterprise.NewDataSourceConfigLbacRules(ctx, "dataSourceConfigLbacRulesResource", &enterprise.DataSourceConfigLbacRulesArgs{
    	DatasourceUid: pulumi.String("string"),
    	Rules:         pulumi.String("string"),
    })
    
    var dataSourceConfigLbacRulesResource = new DataSourceConfigLbacRules("dataSourceConfigLbacRulesResource", DataSourceConfigLbacRulesArgs.builder()
        .datasourceUid("string")
        .rules("string")
        .build());
    
    data_source_config_lbac_rules_resource = grafana.enterprise.DataSourceConfigLbacRules("dataSourceConfigLbacRulesResource",
        datasource_uid="string",
        rules="string")
    
    const dataSourceConfigLbacRulesResource = new grafana.enterprise.DataSourceConfigLbacRules("dataSourceConfigLbacRulesResource", {
        datasourceUid: "string",
        rules: "string",
    });
    
    type: grafana:enterprise:DataSourceConfigLbacRules
    properties:
        datasourceUid: string
        rules: string
    

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

    DatasourceUid string
    The UID of the datasource.
    Rules string
    JSON-encoded LBAC rules for the data source. Map of team UIDs to lists of rule strings.
    DatasourceUid string
    The UID of the datasource.
    Rules string
    JSON-encoded LBAC rules for the data source. Map of team UIDs to lists of rule strings.
    datasourceUid String
    The UID of the datasource.
    rules String
    JSON-encoded LBAC rules for the data source. Map of team UIDs to lists of rule strings.
    datasourceUid string
    The UID of the datasource.
    rules string
    JSON-encoded LBAC rules for the data source. Map of team UIDs to lists of rule strings.
    datasource_uid str
    The UID of the datasource.
    rules str
    JSON-encoded LBAC rules for the data source. Map of team UIDs to lists of rule strings.
    datasourceUid String
    The UID of the datasource.
    rules String
    JSON-encoded LBAC rules for the data source. Map of team UIDs to lists of rule strings.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing DataSourceConfigLbacRules Resource

    Get an existing DataSourceConfigLbacRules 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?: DataSourceConfigLbacRulesState, opts?: CustomResourceOptions): DataSourceConfigLbacRules
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            datasource_uid: Optional[str] = None,
            rules: Optional[str] = None) -> DataSourceConfigLbacRules
    func GetDataSourceConfigLbacRules(ctx *Context, name string, id IDInput, state *DataSourceConfigLbacRulesState, opts ...ResourceOption) (*DataSourceConfigLbacRules, error)
    public static DataSourceConfigLbacRules Get(string name, Input<string> id, DataSourceConfigLbacRulesState? state, CustomResourceOptions? opts = null)
    public static DataSourceConfigLbacRules get(String name, Output<String> id, DataSourceConfigLbacRulesState state, CustomResourceOptions options)
    resources:  _:    type: grafana:enterprise:DataSourceConfigLbacRules    get:      id: ${id}
    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:
    DatasourceUid string
    The UID of the datasource.
    Rules string
    JSON-encoded LBAC rules for the data source. Map of team UIDs to lists of rule strings.
    DatasourceUid string
    The UID of the datasource.
    Rules string
    JSON-encoded LBAC rules for the data source. Map of team UIDs to lists of rule strings.
    datasourceUid String
    The UID of the datasource.
    rules String
    JSON-encoded LBAC rules for the data source. Map of team UIDs to lists of rule strings.
    datasourceUid string
    The UID of the datasource.
    rules string
    JSON-encoded LBAC rules for the data source. Map of team UIDs to lists of rule strings.
    datasource_uid str
    The UID of the datasource.
    rules str
    JSON-encoded LBAC rules for the data source. Map of team UIDs to lists of rule strings.
    datasourceUid String
    The UID of the datasource.
    rules String
    JSON-encoded LBAC rules for the data source. Map of team UIDs to lists of rule strings.

    Import

    $ pulumi import grafana:enterprise/dataSourceConfigLbacRules:DataSourceConfigLbacRules name "{{ datasource_uid }}"
    

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

    Package Details

    Repository
    grafana pulumiverse/pulumi-grafana
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the grafana Terraform Provider.
    grafana logo
    Grafana v0.10.0 published on Friday, Jan 10, 2025 by pulumiverse