1+ resource "tencentcloud_vpc" "vpc" {
2+ cidr_block = " 10.0.0.0/16"
3+ name = " tf_monitor_vpc"
4+ }
5+
6+ resource "tencentcloud_subnet" "subnet" {
7+ vpc_id = tencentcloud_vpc. vpc . id
8+ availability_zone = var. availability_zone
9+ name = " tf_monitor_subnet"
10+ cidr_block = " 10.0.1.0/24"
11+ }
12+
13+ resource "tencentcloud_monitor_grafana_instance" "foo" {
14+ instance_name = " test-grafana"
15+ vpc_id = tencentcloud_vpc. vpc . id
16+ subnet_ids = [tencentcloud_subnet . subnet . id ]
17+ grafana_init_password = " 1234567890"
18+ enable_internet = false
19+
20+ tags = {
21+ " createdBy" = " test"
22+ }
23+ }
24+
25+ resource "tencentcloud_monitor_grafana_integration" "grafanaIntegration" {
26+ instance_id = tencentcloud_monitor_grafana_instance. foo . id
27+ kind = " tencentcloud-monitor-app"
28+ content = " {\" kind\" :\" tencentcloud-monitor-app\" ,\" spec\" :{\" dataSourceSpec\" :{\" authProvider\" :{\" __anyOf\" :\" 使用密钥\" ,\" useRole\" :true,\" secretId\" :\" arunma@tencent.com\" ,\" secretKey\" :\" 12345678\" },\" name\" :\" uint-test\" },\" grafanaSpec\" :{\" organizationIds\" :[]}}}"
29+ }
30+
31+ resource "tencentcloud_monitor_alarm_notice" "foo" {
32+ name = " tf_alarm_notice"
33+ notice_type = " ALL"
34+ notice_language = " zh-CN"
35+
36+ user_notices {
37+ receiver_type = " USER"
38+ start_time = 0
39+ end_time = 1
40+ notice_way = [" SMS" ," EMAIL" ]
41+ user_ids = [10001 ]
42+ group_ids = []
43+ phone_order = [10001 ]
44+ phone_circle_times = 2
45+ phone_circle_interval = 50
46+ phone_inner_interval = 60
47+ need_phone_arrive_notice = 1
48+ phone_call_type = " CIRCLE"
49+ weekday = [1 ,2 ,3 ,4 ,5 ,6 ,7 ]
50+ }
51+
52+ url_notices {
53+ url = " https://www.mytest.com/validate"
54+ end_time = 0
55+ start_time = 1
56+ weekday = [1 ,2 ,3 ,4 ,5 ,6 ,7 ]
57+ }
58+ }
59+
60+ resource "tencentcloud_monitor_grafana_notification_channel" "grafanaNotificationChannel" {
61+ instance_id = tencentcloud_monitor_grafana_instance. foo . id
62+ channel_name = " tf-channel"
63+ org_id = 1
64+ receivers = [tencentcloud_monitor_alarm_notice . foo . amp_consumer_id ]
65+ extra_org_ids = [" 1" ]
66+ }
67+
68+ resource "tencentcloud_monitor_grafana_plugin" "grafanaPlugin" {
69+ instance_id = tencentcloud_monitor_grafana_instance. foo . id
70+ plugin_id = " grafana-piechart-panel"
71+ version = " 1.6.2"
72+ }
73+
74+ resource "tencentcloud_monitor_grafana_sso_account" "ssoAccount" {
75+ instance_id = tencentcloud_monitor_grafana_instance. foo . id
76+ user_id = var. user_id
77+ notes = " desc12222"
78+ role {
79+ organization = " Main Org."
80+ role = " Admin"
81+ }
82+ }
0 commit comments