-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: complete the first edition of terraform provider
- Loading branch information
1 parent
577abfc
commit 80ef196
Showing
100 changed files
with
3,250 additions
and
1,902 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# Alert Policy | ||
|
||
Alert policy is a set of rules that define when to trigger an alert. You can create alert policies for your data | ||
sources, and set up alert targets to receive alerts. | ||
|
||
Guance Cloud supports alert policy management for the results of monitor checks, by sending alert notification emails or | ||
group message notifications, so that you can know about the abnormal data situation of the monitoring in time, find | ||
problems, and solve problems. | ||
|
||
Relationships: | ||
|
||
```mermaid | ||
graph LR | ||
A[Monitor] --> B[Alert Policy] --> C[Notification] | ||
``` | ||
|
||
Notes: | ||
|
||
1. When a monitor is created, an alert policy must be selected, and the default is selected by default; | ||
2. When a certain alert policy is deleted, the monitor under the deleted alert policy will automatically be classified | ||
into the default. | ||
|
||
## Create | ||
|
||
The first let me create a resource. We will send the create operation to the resource management service | ||
|
||
```terraform | ||
variable "ding_talk_webhook" { | ||
type = string | ||
} | ||
variable "ding_talk_secret" { | ||
type = string | ||
} | ||
variable "email" { | ||
type = string | ||
} | ||
data "guance_members" "demo" { | ||
filter = [ | ||
{ | ||
name = "email" | ||
values = [var.email] | ||
} | ||
] | ||
} | ||
resource "guance_membergroup" "demo" { | ||
name = "oac-demo" | ||
member_ids = data.guance_members.demo.items[*].id | ||
} | ||
resource "guance_notification" "demo" { | ||
name = "oac-demo" | ||
type = "ding_talk_robot" | ||
ding_talk_robot = { | ||
webhook = var.ding_talk_webhook | ||
secret = var.ding_talk_secret | ||
} | ||
} | ||
resource "guance_alertpolicy" "demo" { | ||
name = "oac-demo" | ||
silent_timeout = 3600 | ||
statuses = [ | ||
"critical", | ||
"error", | ||
"warning", | ||
"info", | ||
"ok", | ||
"nodata", | ||
"nodata_ok", | ||
"nodata_as_ok", | ||
] | ||
alert_targets = [ | ||
{ | ||
type = "member_group" | ||
member_group = { | ||
id = guance_membergroup.demo.id | ||
} | ||
}, | ||
{ | ||
type = "notification" | ||
notification = { | ||
id = guance_notification.demo.id | ||
} | ||
} | ||
] | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
variable "ding_talk_webhook" { | ||
type = string | ||
} | ||
|
||
variable "ding_talk_secret" { | ||
type = string | ||
} | ||
|
||
variable "email" { | ||
type = string | ||
} | ||
|
||
data "guance_members" "demo" { | ||
filter = [ | ||
{ | ||
name = "email" | ||
values = [var.email] | ||
} | ||
] | ||
} | ||
|
||
resource "guance_membergroup" "demo" { | ||
name = "oac-demo" | ||
member_ids = data.guance_members.demo.items[*].id | ||
} | ||
|
||
resource "guance_notification" "demo" { | ||
name = "oac-demo" | ||
type = "ding_talk_robot" | ||
ding_talk_robot = { | ||
webhook = var.ding_talk_webhook | ||
secret = var.ding_talk_secret | ||
} | ||
} | ||
|
||
resource "guance_alertpolicy" "demo" { | ||
name = "oac-demo" | ||
silent_timeout = 3600 | ||
|
||
statuses = [ | ||
"critical", | ||
"error", | ||
"warning", | ||
"info", | ||
"ok", | ||
"nodata", | ||
"nodata_ok", | ||
"nodata_as_ok", | ||
] | ||
|
||
alert_targets = [ | ||
{ | ||
type = "member_group" | ||
member_group = { | ||
id = guance_membergroup.demo.id | ||
} | ||
}, | ||
{ | ||
type = "notification" | ||
notification = { | ||
id = guance_notification.demo.id | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
terraform { | ||
required_version = ">=0.12" | ||
|
||
required_providers { | ||
guance = { | ||
source = "GuanceCloud/guance" | ||
} | ||
} | ||
} | ||
|
||
provider "guance" { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Dashboard | ||
|
||
**WORKING IN PROGRESS!** | ||
|
||
A dashboard is a collection of visualizations that you can use to monitor the health of your systems and applications. Dashboards are made up of one or more panels, which are the visualizations themselves. Each panel displays a single metric or a single aggregation of metrics. | ||
|
||
Dashboards are a great way to visualize your data and monitor your systems. You can use them to track metrics over time, and to quickly see how your systems are performing. You can also use them to compare metrics from different systems and applications. | ||
|
||
Guance Cloud's dashboard is used to clearly show the range in which the metric data values are located. It is suitable for slicing messy data into points. | ||
|
||
## Create | ||
|
||
The first let me create a resource. We will send the create operation to the resource management service | ||
|
||
```terraform | ||
resource "guance_dashboard" "demo" { | ||
name = "oac-demo" | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
resource "guance_dashboard" "demo" { | ||
name = "oac-demo" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
terraform { | ||
required_version = ">=0.12" | ||
|
||
required_providers { | ||
guance = { | ||
source = "GuanceCloud/guance" | ||
} | ||
} | ||
} | ||
|
||
provider "guance" { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Member Group | ||
|
||
Member group is a collection of members in a workspace, and member groups can be authorized to access the resources in | ||
the workspace. | ||
|
||
Member group is an abstract concept, it can be a team, or a department, it can help us build a reasonable organizational | ||
structure, optimize the management efficiency and user experience of the observability platform. | ||
|
||
Relationships: | ||
|
||
```mermaid | ||
graph LR | ||
A[Workspace] --> B[Member] | ||
A --> C[MemberGroup] | ||
``` | ||
|
||
## Create | ||
|
||
The first let me create a resource. We will send the create operation to the resource management service | ||
|
||
```terraform | ||
variable "email" { | ||
type = string | ||
} | ||
data "guance_members" "demo" { | ||
filter = [ | ||
{ | ||
name = "email" | ||
values = [var.email] | ||
} | ||
] | ||
} | ||
resource "guance_membergroup" "demo" { | ||
name = "oac-demo" | ||
member_ids = data.guance_members.demo.items[*].id | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
variable "email" { | ||
type = string | ||
} | ||
|
||
data "guance_members" "demo" { | ||
filter = [ | ||
{ | ||
name = "email" | ||
values = [var.email] | ||
} | ||
] | ||
} | ||
|
||
resource "guance_membergroup" "demo" { | ||
name = "oac-demo" | ||
member_ids = data.guance_members.demo.items[*].id | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
terraform { | ||
required_version = ">=0.12" | ||
|
||
required_providers { | ||
guance = { | ||
source = "GuanceCloud/guance" | ||
} | ||
} | ||
} | ||
|
||
provider "guance" { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Monitor | ||
|
||
**WORKING IN PROGRESS!** | ||
|
||
A monitor is a set of checks that you can run against your data. A monitor watches your data over time and alerts you when certain conditions are met. For example, you can create a monitor that watches the average response time of your website and alerts you when the response time is greater than 1 second. | ||
|
||
Monitors are made up of one or more checks. A check is a single test that you can run against your data. For example, you can create a check that watches the average response time of your website. You can also create a check that watches the percentage of 5xx errors in your logs. | ||
|
||
Guance Cloud supports defining monitors, users can customize the configuration of detection rules and trigger conditions, and open the monitors to receive related alarm events triggered by the detection rules. | ||
|
||
Relationships: | ||
|
||
```mermaid | ||
graph LR | ||
A[Monitor] --> B[Alert Policy] --> C[Notification] | ||
``` | ||
|
||
## Create | ||
|
||
The first let me create a resource. We will send the create operation to the resource management service | ||
|
||
```terraform | ||
resource "guance_monitor" "demo" { | ||
name = "oac-demo" | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
resource "guance_monitor" "demo" { | ||
name = "oac-demo" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
terraform { | ||
required_version = ">=0.12" | ||
|
||
required_providers { | ||
guance = { | ||
source = "GuanceCloud/guance" | ||
} | ||
} | ||
} | ||
|
||
provider "guance" { | ||
} |
Oops, something went wrong.