tencentcloud.MonitorGrafanaSsoAccount
Explore with Pulumi AI
Provides a resource to create a monitor grafana ssoAccount
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const config = new pulumi.Config();
const availabilityZone = config.get("availabilityZone") || "ap-guangzhou-6";
const vpc = new tencentcloud.Vpc("vpc", {cidrBlock: "10.0.0.0/16"});
const subnet = new tencentcloud.Subnet("subnet", {
vpcId: vpc.vpcId,
availabilityZone: availabilityZone,
cidrBlock: "10.0.1.0/24",
});
const foo = new tencentcloud.MonitorGrafanaInstance("foo", {
instanceName: "test-grafana",
vpcId: vpc.vpcId,
subnetIds: [subnet.subnetId],
grafanaInitPassword: "1234567890",
enableInternet: false,
tags: {
createdBy: "test",
},
});
const ssoAccount = new tencentcloud.MonitorGrafanaSsoAccount("ssoAccount", {
instanceId: foo.monitorGrafanaInstanceId,
userId: "111",
notes: "desc12222",
roles: [{
organization: "Main Org.",
role: "Admin",
}],
});
import pulumi
import pulumi_tencentcloud as tencentcloud
config = pulumi.Config()
availability_zone = config.get("availabilityZone")
if availability_zone is None:
availability_zone = "ap-guangzhou-6"
vpc = tencentcloud.Vpc("vpc", cidr_block="10.0.0.0/16")
subnet = tencentcloud.Subnet("subnet",
vpc_id=vpc.vpc_id,
availability_zone=availability_zone,
cidr_block="10.0.1.0/24")
foo = tencentcloud.MonitorGrafanaInstance("foo",
instance_name="test-grafana",
vpc_id=vpc.vpc_id,
subnet_ids=[subnet.subnet_id],
grafana_init_password="1234567890",
enable_internet=False,
tags={
"createdBy": "test",
})
sso_account = tencentcloud.MonitorGrafanaSsoAccount("ssoAccount",
instance_id=foo.monitor_grafana_instance_id,
user_id="111",
notes="desc12222",
roles=[{
"organization": "Main Org.",
"role": "Admin",
}])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"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, "")
availabilityZone := "ap-guangzhou-6"
if param := cfg.Get("availabilityZone"); param != "" {
availabilityZone = param
}
vpc, err := tencentcloud.NewVpc(ctx, "vpc", &tencentcloud.VpcArgs{
CidrBlock: pulumi.String("10.0.0.0/16"),
})
if err != nil {
return err
}
subnet, err := tencentcloud.NewSubnet(ctx, "subnet", &tencentcloud.SubnetArgs{
VpcId: vpc.VpcId,
AvailabilityZone: pulumi.String(availabilityZone),
CidrBlock: pulumi.String("10.0.1.0/24"),
})
if err != nil {
return err
}
foo, err := tencentcloud.NewMonitorGrafanaInstance(ctx, "foo", &tencentcloud.MonitorGrafanaInstanceArgs{
InstanceName: pulumi.String("test-grafana"),
VpcId: vpc.VpcId,
SubnetIds: pulumi.StringArray{
subnet.SubnetId,
},
GrafanaInitPassword: pulumi.String("1234567890"),
EnableInternet: pulumi.Bool(false),
Tags: pulumi.StringMap{
"createdBy": pulumi.String("test"),
},
})
if err != nil {
return err
}
_, err = tencentcloud.NewMonitorGrafanaSsoAccount(ctx, "ssoAccount", &tencentcloud.MonitorGrafanaSsoAccountArgs{
InstanceId: foo.MonitorGrafanaInstanceId,
UserId: pulumi.String("111"),
Notes: pulumi.String("desc12222"),
Roles: tencentcloud.MonitorGrafanaSsoAccountRoleArray{
&tencentcloud.MonitorGrafanaSsoAccountRoleArgs{
Organization: pulumi.String("Main Org."),
Role: pulumi.String("Admin"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var availabilityZone = config.Get("availabilityZone") ?? "ap-guangzhou-6";
var vpc = new Tencentcloud.Vpc("vpc", new()
{
CidrBlock = "10.0.0.0/16",
});
var subnet = new Tencentcloud.Subnet("subnet", new()
{
VpcId = vpc.VpcId,
AvailabilityZone = availabilityZone,
CidrBlock = "10.0.1.0/24",
});
var foo = new Tencentcloud.MonitorGrafanaInstance("foo", new()
{
InstanceName = "test-grafana",
VpcId = vpc.VpcId,
SubnetIds = new[]
{
subnet.SubnetId,
},
GrafanaInitPassword = "1234567890",
EnableInternet = false,
Tags =
{
{ "createdBy", "test" },
},
});
var ssoAccount = new Tencentcloud.MonitorGrafanaSsoAccount("ssoAccount", new()
{
InstanceId = foo.MonitorGrafanaInstanceId,
UserId = "111",
Notes = "desc12222",
Roles = new[]
{
new Tencentcloud.Inputs.MonitorGrafanaSsoAccountRoleArgs
{
Organization = "Main Org.",
Role = "Admin",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.Vpc;
import com.pulumi.tencentcloud.VpcArgs;
import com.pulumi.tencentcloud.Subnet;
import com.pulumi.tencentcloud.SubnetArgs;
import com.pulumi.tencentcloud.MonitorGrafanaInstance;
import com.pulumi.tencentcloud.MonitorGrafanaInstanceArgs;
import com.pulumi.tencentcloud.MonitorGrafanaSsoAccount;
import com.pulumi.tencentcloud.MonitorGrafanaSsoAccountArgs;
import com.pulumi.tencentcloud.inputs.MonitorGrafanaSsoAccountRoleArgs;
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 availabilityZone = config.get("availabilityZone").orElse("ap-guangzhou-6");
var vpc = new Vpc("vpc", VpcArgs.builder()
.cidrBlock("10.0.0.0/16")
.build());
var subnet = new Subnet("subnet", SubnetArgs.builder()
.vpcId(vpc.vpcId())
.availabilityZone(availabilityZone)
.cidrBlock("10.0.1.0/24")
.build());
var foo = new MonitorGrafanaInstance("foo", MonitorGrafanaInstanceArgs.builder()
.instanceName("test-grafana")
.vpcId(vpc.vpcId())
.subnetIds(subnet.subnetId())
.grafanaInitPassword("1234567890")
.enableInternet(false)
.tags(Map.of("createdBy", "test"))
.build());
var ssoAccount = new MonitorGrafanaSsoAccount("ssoAccount", MonitorGrafanaSsoAccountArgs.builder()
.instanceId(foo.monitorGrafanaInstanceId())
.userId("111")
.notes("desc12222")
.roles(MonitorGrafanaSsoAccountRoleArgs.builder()
.organization("Main Org.")
.role("Admin")
.build())
.build());
}
}
configuration:
availabilityZone:
type: string
default: ap-guangzhou-6
resources:
vpc:
type: tencentcloud:Vpc
properties:
cidrBlock: 10.0.0.0/16
subnet:
type: tencentcloud:Subnet
properties:
vpcId: ${vpc.vpcId}
availabilityZone: ${availabilityZone}
cidrBlock: 10.0.1.0/24
foo:
type: tencentcloud:MonitorGrafanaInstance
properties:
instanceName: test-grafana
vpcId: ${vpc.vpcId}
subnetIds:
- ${subnet.subnetId}
grafanaInitPassword: '1234567890'
enableInternet: false
tags:
createdBy: test
ssoAccount:
type: tencentcloud:MonitorGrafanaSsoAccount
properties:
instanceId: ${foo.monitorGrafanaInstanceId}
userId: '111'
notes: desc12222
roles:
- organization: Main Org.
role: Admin
Create MonitorGrafanaSsoAccount Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new MonitorGrafanaSsoAccount(name: string, args: MonitorGrafanaSsoAccountArgs, opts?: CustomResourceOptions);
@overload
def MonitorGrafanaSsoAccount(resource_name: str,
args: MonitorGrafanaSsoAccountArgs,
opts: Optional[ResourceOptions] = None)
@overload
def MonitorGrafanaSsoAccount(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance_id: Optional[str] = None,
user_id: Optional[str] = None,
monitor_grafana_sso_account_id: Optional[str] = None,
notes: Optional[str] = None,
roles: Optional[Sequence[MonitorGrafanaSsoAccountRoleArgs]] = None)
func NewMonitorGrafanaSsoAccount(ctx *Context, name string, args MonitorGrafanaSsoAccountArgs, opts ...ResourceOption) (*MonitorGrafanaSsoAccount, error)
public MonitorGrafanaSsoAccount(string name, MonitorGrafanaSsoAccountArgs args, CustomResourceOptions? opts = null)
public MonitorGrafanaSsoAccount(String name, MonitorGrafanaSsoAccountArgs args)
public MonitorGrafanaSsoAccount(String name, MonitorGrafanaSsoAccountArgs args, CustomResourceOptions options)
type: tencentcloud:MonitorGrafanaSsoAccount
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 MonitorGrafanaSsoAccountArgs
- 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 MonitorGrafanaSsoAccountArgs
- 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 MonitorGrafanaSsoAccountArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MonitorGrafanaSsoAccountArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args MonitorGrafanaSsoAccountArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
MonitorGrafanaSsoAccount 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 MonitorGrafanaSsoAccount resource accepts the following input properties:
- Instance
Id string - grafana instance id.
- User
Id string - sub account uin of specific user.
- Monitor
Grafana stringSso Account Id - ID of the resource.
- Notes string
- account related description.
- Roles
List<Monitor
Grafana Sso Account Role> - grafana role.
- Instance
Id string - grafana instance id.
- User
Id string - sub account uin of specific user.
- Monitor
Grafana stringSso Account Id - ID of the resource.
- Notes string
- account related description.
- Roles
[]Monitor
Grafana Sso Account Role Args - grafana role.
- instance
Id String - grafana instance id.
- user
Id String - sub account uin of specific user.
- monitor
Grafana StringSso Account Id - ID of the resource.
- notes String
- account related description.
- roles
List<Monitor
Grafana Sso Account Role> - grafana role.
- instance
Id string - grafana instance id.
- user
Id string - sub account uin of specific user.
- monitor
Grafana stringSso Account Id - ID of the resource.
- notes string
- account related description.
- roles
Monitor
Grafana Sso Account Role[] - grafana role.
- instance_
id str - grafana instance id.
- user_
id str - sub account uin of specific user.
- monitor_
grafana_ strsso_ account_ id - ID of the resource.
- notes str
- account related description.
- roles
Sequence[Monitor
Grafana Sso Account Role Args] - grafana role.
- instance
Id String - grafana instance id.
- user
Id String - sub account uin of specific user.
- monitor
Grafana StringSso Account Id - ID of the resource.
- notes String
- account related description.
- roles List<Property Map>
- grafana role.
Outputs
All input properties are implicitly available as output properties. Additionally, the MonitorGrafanaSsoAccount 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 MonitorGrafanaSsoAccount Resource
Get an existing MonitorGrafanaSsoAccount 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?: MonitorGrafanaSsoAccountState, opts?: CustomResourceOptions): MonitorGrafanaSsoAccount
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
instance_id: Optional[str] = None,
monitor_grafana_sso_account_id: Optional[str] = None,
notes: Optional[str] = None,
roles: Optional[Sequence[MonitorGrafanaSsoAccountRoleArgs]] = None,
user_id: Optional[str] = None) -> MonitorGrafanaSsoAccount
func GetMonitorGrafanaSsoAccount(ctx *Context, name string, id IDInput, state *MonitorGrafanaSsoAccountState, opts ...ResourceOption) (*MonitorGrafanaSsoAccount, error)
public static MonitorGrafanaSsoAccount Get(string name, Input<string> id, MonitorGrafanaSsoAccountState? state, CustomResourceOptions? opts = null)
public static MonitorGrafanaSsoAccount get(String name, Output<String> id, MonitorGrafanaSsoAccountState state, CustomResourceOptions options)
resources: _: type: tencentcloud:MonitorGrafanaSsoAccount 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.
- Instance
Id string - grafana instance id.
- Monitor
Grafana stringSso Account Id - ID of the resource.
- Notes string
- account related description.
- Roles
List<Monitor
Grafana Sso Account Role> - grafana role.
- User
Id string - sub account uin of specific user.
- Instance
Id string - grafana instance id.
- Monitor
Grafana stringSso Account Id - ID of the resource.
- Notes string
- account related description.
- Roles
[]Monitor
Grafana Sso Account Role Args - grafana role.
- User
Id string - sub account uin of specific user.
- instance
Id String - grafana instance id.
- monitor
Grafana StringSso Account Id - ID of the resource.
- notes String
- account related description.
- roles
List<Monitor
Grafana Sso Account Role> - grafana role.
- user
Id String - sub account uin of specific user.
- instance
Id string - grafana instance id.
- monitor
Grafana stringSso Account Id - ID of the resource.
- notes string
- account related description.
- roles
Monitor
Grafana Sso Account Role[] - grafana role.
- user
Id string - sub account uin of specific user.
- instance_
id str - grafana instance id.
- monitor_
grafana_ strsso_ account_ id - ID of the resource.
- notes str
- account related description.
- roles
Sequence[Monitor
Grafana Sso Account Role Args] - grafana role.
- user_
id str - sub account uin of specific user.
- instance
Id String - grafana instance id.
- monitor
Grafana StringSso Account Id - ID of the resource.
- notes String
- account related description.
- roles List<Property Map>
- grafana role.
- user
Id String - sub account uin of specific user.
Supporting Types
MonitorGrafanaSsoAccountRole, MonitorGrafanaSsoAccountRoleArgs
- Organization string
- Grafana organization id string.
- Role string
- Grafana role, one of {Admin,Editor,Viewer}.
- Organization string
- Grafana organization id string.
- Role string
- Grafana role, one of {Admin,Editor,Viewer}.
- organization String
- Grafana organization id string.
- role String
- Grafana role, one of {Admin,Editor,Viewer}.
- organization string
- Grafana organization id string.
- role string
- Grafana role, one of {Admin,Editor,Viewer}.
- organization str
- Grafana organization id string.
- role str
- Grafana role, one of {Admin,Editor,Viewer}.
- organization String
- Grafana organization id string.
- role String
- Grafana role, one of {Admin,Editor,Viewer}.
Import
monitor grafana ssoAccount can be imported using the instance_id#user_id, e.g.
$ pulumi import tencentcloud:index/monitorGrafanaSsoAccount:MonitorGrafanaSsoAccount ssoAccount grafana-50nj6v00#111
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.