Skip to content

Commit

Permalink
feat: Add dashboard, monitor, blacklist (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
yufeiminds authored May 7, 2023
1 parent dae40be commit 7f9c993
Show file tree
Hide file tree
Showing 75 changed files with 3,452 additions and 2,487 deletions.
28 changes: 20 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,34 @@ The Guance Provider provides resources to manage [Guance Cloud](https://en.guanc

## Documentation, questions, and discussions

Official documentation on how to use this provider can be found on the [Terraform Registry](https://registry.terraform.io/providers/guance/guance/latest/docs).
Official documentation on how to use this provider can be found on the [Terraform Registry](https://registry.terraform.io/providers/GuanceCloud/guance/latest/docs).

The remainder of this document will focus on the development aspects of the provider.

The resource supports as follows:

* [x] notification
* [x] pipeline
* [x] members
* [x] member group
* [x] alert policy
* [ ] mute
* [ ] monitor, see built-in modules at [terraform-guance-monitor](https://github.com/GuanceCloud/terraform-guance-monitor)
* [ ] dashboard, see built-in modules at [terraform-guance-dashboard](https://github.com/GuanceCloud/terraform-guance-dashboard)
* [x] mute
* [x] black list
* [x] monitor, see built-in modules at [terraform-guance-monitor](https://github.com/GuanceCloud/terraform-guance-monitor)
* [x] dashboard, see built-in modules at [terraform-guance-dashboard](https://github.com/GuanceCloud/terraform-guance-dashboard)

The data source supports as follows:

* [x] members

The region supports as follows:

* [x] hangzhou
* [x] ningxia
* [x] zhangjiakou
* [x] guangzhou
* [x] oregon

If there are more resources you need, create an [issue]() for free.
If there are more resources you need, create an [issue](https://github.com/GuanceCloud/terraform-provider-guance/issues) for free.

## Compatibility

Expand All @@ -30,11 +42,11 @@ version it implements, and Terraform:

| Guance Provider | Terraform Plugin Protocol | Terraform |
|:---------------:|:-------------------------:|:---------:|
| `>= 0.x` | `5` and `6` | `>= 0.12` |
| `>= 0.x` | `6` | `>= 1.0` |

Details can be found by querying the [Registry API](https://www.terraform.io/internals/provider-registry-protocol#list-available-versions)
that return all the details about which versions are currently available for a particular provider.
[Here](https://registry.terraform.io/v1/providers/guance/guance/versions) are the details.
[Here](https://registry.terraform.io/v1/providers/GuanceCloud/guance/versions) are the details.

## Requirements

Expand Down
14 changes: 7 additions & 7 deletions docs/data-sources/members.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ graph LR

### Optional

- `filter` (Attributes List) The list of the resource (see [below for nested schema](#nestedatt--filter))
- `filters` (Attributes List) The list of the resource (see [below for nested schema](#nestedatt--filters))
- `max_results` (Number) The max results count of the resource will be returned.

### Read-Only

- `id` (String) Identifier of the resource.
- `id` (String) The hasd id of the resource.
- `items` (Attributes List) The list of the resource (see [below for nested schema](#nestedatt--items))

<a id="nestedatt--filter"></a>
### Nested Schema for `filter`
<a id="nestedatt--filters"></a>
### Nested Schema for `filters`

Required:

Expand All @@ -54,11 +54,11 @@ Required:
Optional:

- `email` (String) Email
- `role` (String) Role
- `role` (String) Role, value must be one of: *owner*, *wsAdmin*, *general*, *readOnly*, other value will be ignored.

Read-Only:

- `created_at` (String) Timestamp of the last Terraform update of the order.
- `id` (String) Numeric identifier of the order.
- `created_at` (String) The RFC3339/ISO8601 time string of resource created at.
- `id` (String) The Guance Resource Name (GRN) of cloud resource.


73 changes: 69 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,77 @@
page_title: "guance Provider"
subcategory: ""
description: |-
Interact with Guance Cloud.
Terraform Provider: Guance
The Guance Provider provides resources to manage Guance Cloud https://en.guance.com/ resources.
To learn the basics of Terraform using this provider, follow the hands-on get started tutorials.
Interested in the provider's latest features, or want to make sure you're up to date? Check out the changelog for version information and release notes.
Authenticating to Guance Cloud
Terraform supports a number of different methods for authenticating to Guance Cloud:
Workspace Key ID https://console.guance.com/workspace/apiManage
Usage
```terraform
We strongly recommend using the required_providers block to set the
Guance Cloud Provider source and version being used
terraform {
required_version = ">=0.12"
required_providers {
guance = {
source = "GuanceCloud/guance"
version = "=0.0.4"
}
}
}
// We also recommend use secret environment variables to set the provider,
// Such as GUANCEACCESSTOKEN and GUANCEREGION
provider "guance" {
# accesstoken = "your access token, recommend store in environment variable"
region = "hangzhou"
}
```
More Examples
---

# guance Provider

Interact with Guance Cloud.
# Terraform Provider: Guance

The Guance Provider provides resources to manage [Guance Cloud](https://en.guance.com/) resources.

To learn the basics of Terraform using this provider, follow the hands-on get started tutorials.

Interested in the provider's latest features, or want to make sure you're up to date? Check out the changelog for version information and release notes.

## Authenticating to Guance Cloud

Terraform supports a number of different methods for authenticating to Guance Cloud:

* [Workspace Key ID](https://console.guance.com/workspace/apiManage)

## Usage

```terraform
# We strongly recommend using the required_providers block to set the
# Guance Cloud Provider source and version being used
terraform {
required_version = ">=0.12"
required_providers {
guance = {
source = "GuanceCloud/guance"
version = "=0.0.4"
}
}
}
// We also recommend use secret environment variables to set the provider,
// Such as GUANCE_ACCESS_TOKEN and GUANCE_REGION
provider "guance" {
# access_token = "your access token, recommend store in environment variable"
region = "hangzhou"
}
```

## More Examples



Expand All @@ -17,5 +82,5 @@ Interact with Guance Cloud.

### Optional

- `region` (String) Region for Guance Cloud API. May also be provided via GUANCE_REGION environment variable.
- `token` (String, Sensitive) Access token for Guance Cloud API. May also be provided via GUANCE_TOKEN environment variable.
- `access_token` (String, Sensitive) Access token for Guance Cloud API. May also be provided via GUANCE_ACCESS_TOKEN environment variable. Get an Key ID from [Guance Cloud](https://console.guance.com/workspace/apiManage) as access token.
- `region` (String) Region for Guance Cloud API. May also be provided via GUANCE_REGION environment variable. See [GitHub](https://github.com/GuanceCloud/terraform-provider-guance) for a list of available regions.
10 changes: 5 additions & 5 deletions docs/resources/alertpolicy.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ description: |-
type = string
}
data "guance_members" "demo" {
filter = [
filters = [
{
name = "email"
values = [var.email]
Expand Down Expand Up @@ -123,7 +123,7 @@ variable "email" {
}
data "guance_members" "demo" {
filter = [
filters = [
{
name = "email"
values = [var.email]
Expand Down Expand Up @@ -194,15 +194,15 @@ resource "guance_alertpolicy" "demo" {

### Read-Only

- `created_at` (String) Timestamp of the last Terraform update of the order.
- `id` (String) Numeric identifier of the order.
- `created_at` (String) The RFC3339/ISO8601 time string of resource created at.
- `id` (String) The Guance Resource Name (GRN) of cloud resource.

<a id="nestedatt--alert_targets"></a>
### Nested Schema for `alert_targets`

Required:

- `type` (String) Alert type
- `type` (String) Alert type, value must be one of: *member_group*, *notification*, other value will be ignored.

Optional:

Expand Down
104 changes: 104 additions & 0 deletions docs/resources/blacklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "guance_blacklist Resource - guance"
subcategory: ""
description: |-
Black List
Guance Cloud supports filtering data that meets the conditions by setting a blacklist.
After configuring the blacklist, the data that meets the conditions will no longer be reported to the Guance Cloud
workspace, helping you save data storage costs.
Create
The first let me create a resource. We will send the create operation to the resource management service
```terraform
resource "guance_blacklist" "demo" {
source = {
type = "logging"
name = "nginx"
}
filter_rules = [
{
name = "foo"
operation = "in"
condition = "and"
values = ["oac-*"]
}
]
}
```
---

# guance_blacklist (Resource)

# Black List

Guance Cloud supports filtering data that meets the conditions by setting a blacklist.

After configuring the blacklist, the data that meets the conditions will no longer be reported to the Guance Cloud
workspace, helping you save data storage costs.

## Create

The first let me create a resource. We will send the create operation to the resource management service

```terraform
resource "guance_blacklist" "demo" {
source = {
type = "logging"
name = "nginx"
}
filter_rules = [
{
name = "foo"
operation = "in"
condition = "and"
values = ["oac-*"]
}
]
}
```



<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `source` (Attributes) Source (see [below for nested schema](#nestedatt--source))

### Optional

- `filter_rules` (Attributes List) Filters (see [below for nested schema](#nestedatt--filter_rules))

### Read-Only

- `created_at` (String) The RFC3339/ISO8601 time string of resource created at.
- `id` (String) The Guance Resource Name (GRN) of cloud resource.

<a id="nestedatt--source"></a>
### Nested Schema for `source`

Required:

- `type` (String) Source Type, value must be one of: *logging*, *object*, *custom_object*, *network*, *tracing*, *rum*, *security*, *keyevent*, *metric*, other value will be ignored.

Optional:

- `name` (String) Source


<a id="nestedatt--filter_rules"></a>
### Nested Schema for `filter_rules`

Required:

- `condition` (String) Condition, represented by DQL
- `name` (String) Name
- `operation` (String) Operation, value must be one of: *in*, *not in*, *match*, *not match*, other value will be ignored.

Optional:

- `values` (List of String) Values


Loading

0 comments on commit 7f9c993

Please sign in to comment.