Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengbo committed Aug 7, 2024
1 parent 160c0fb commit 3c26f5e
Show file tree
Hide file tree
Showing 118 changed files with 1,834 additions and 11,521 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Release
on:
push:
tags:
- 'v*'
- "v*"

# Releases need permissions to read and write the repository contents.
# GitHub considers creating releases and uploading assets as writing contents.
Expand All @@ -23,7 +23,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
go-version-file: "go.mod"
cache: true
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v5
Expand All @@ -34,7 +34,7 @@ jobs:
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
args: release --rm-dist
args: release --clean
env:
# GitHub sets the GITHUB_TOKEN secret automatically.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ dist/
.idea/
.vscode/

# Environment
.env*
80 changes: 38 additions & 42 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,52 @@
# Visit https://goreleaser.com for documentation on how to customize this
# behavior.

version: 2

project_name: terraform-provider-guance
before:
hooks:
# this is just an example and not a requirement for provider building/publishing
- go mod tidy
builds:
- env:
# goreleaser does not work with CGO, it could also complicate
# usage by users in CI/CD systems like Terraform Cloud where
# they are unable to install libraries.
- CGO_ENABLED=0
- GO111MODULE=on
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
- -trimpath
ldflags:
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
goos:
- freebsd
- windows
- linux
- darwin
goarch:
- amd64
- '386'
- arm
- arm64
ignore:
- goos: darwin
goarch: '386'
binary: '{{ .ProjectName }}_v{{ .Version }}'
- env:
# goreleaser does not work with CGO, it could also complicate
# usage by users in CI/CD systems like Terraform Cloud where
# they are unable to install libraries.
- CGO_ENABLED=0
- GO111MODULE=on
mod_timestamp: "{{ .CommitTimestamp }}"
flags:
- -trimpath
ldflags:
- "-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}"
goos:
- freebsd
- windows
- linux
- darwin
goarch:
- amd64
- "386"
- arm
- arm64
ignore:
- goos: darwin
goarch: "386"
binary: "{{ .ProjectName }}_v{{ .Version }}"
archives:
- format: zip
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
- format: zip
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
checksum:
extra_files:
- glob: 'terraform-registry-manifest.json'
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
- glob: "terraform-registry-manifest.json"
name_template: "{{ .ProjectName }}_{{ .Version }}_manifest.json"
name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS"
algorithm: sha256
signs:
- artifacts: checksum
args:
# if you are using this in a GitHub action or some other automated pipeline, you
# if you are using this in a GitHub action or some other automated pipeline, you
# need to pass the batch flag to indicate its not interactive.
- "--batch"
- "--local-user"
Expand All @@ -54,18 +57,12 @@ signs:
- "${artifact}"
release:
extra_files:
- glob: 'terraform-registry-manifest.json'
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
- glob: "terraform-registry-manifest.json"
name_template: "{{ .ProjectName }}_{{ .Version }}_manifest.json"
# If you want to manually examine the release before its live, uncomment this line:
# draft: true

changelog:
# Set this to true if you don't want any changelog at all.
# Warning: this will also ignore any changelog files passed via `--release-notes`,
# and will render an empty changelog.
# This may result in an empty release notes on GitHub/GitLab/Gitea.
skip: false

changelog:
# Changelog generation implementation to use.
#
# Valid options are:
Expand Down Expand Up @@ -102,6 +99,5 @@ changelog:
# the changelog
# Default is empty
exclude:
- '^docs:'
- "^docs:"
- typo

16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,26 @@ The remainder of this document will focus on the development aspects of the prov

The resource supports as follows:

* [x] notification
* [x] pipeline
* [x] member group
* [x] alert policy
* [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)
* [x] role

The data source supports as follows:

* [x] members
* [x] permissions

The region supports as follows:

* [x] hangzhou
* [x] ningxia
* [x] zhangjiakou
* [x] guangzhou
* [x] vnet
* [x] hongkong
* [x] oregon
* [x] frankfurt
* [x] singapore

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

Expand All @@ -55,10 +55,6 @@ that return all the details about which versions are currently available for a p

## Development

### Testing

Guance Cloud Code Generation Pipeline generates this repository. So don't need to test. Please create issues for free.

### Generating documentation

This provider uses [terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs/)
Expand Down
63 changes: 45 additions & 18 deletions docs/data-sources/members.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ description: |-
mermaid
graph LR
A[Workspace] --> B[Member]
Example Usage
```terraform
variable "email" {
type = string
}
data "guance_members" "demo" {
search = var.email
}
output "member" {
value = data.guance_members.demo.members
}
```
---

# guance_members (Data Source)
Expand All @@ -24,41 +37,55 @@ graph LR
A[Workspace] --> B[Member]
```

## Example Usage

```terraform
variable "email" {
type = string
}
<!-- schema generated by tfplugindocs -->
## Schema
data "guance_members" "demo" {
search = var.email
}
### Optional
output "member" {
value = data.guance_members.demo.members
}
```

- `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) The hasd id of the resource.
- `items` (Attributes List) The list of the resource (see [below for nested schema](#nestedatt--items))
<!-- schema generated by tfplugindocs -->
## Schema

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

Required:
- `search` (String) Search the member by email or name.

- `name` (String) The filter path, represent as json path.
- `values` (List of String) The filter values
### Read-Only

- `members` (Attributes List) The list of the members. (see [below for nested schema](#nestedatt--members))

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

Optional:

- `email` (String) Email
- `role` (String) Role, value must be one of: *owner*, *wsAdmin*, *general*, *readOnly*, other value will be ignored.
- `name` (String) User name
- `roles` (Attributes List) Role, value must be one of: *owner*, *wsAdmin*, *general*, *readOnly*, other value will be ignored. (see [below for nested schema](#nestedatt--members--roles))

Read-Only:

- `created_at` (String) The RFC3339/ISO8601 time string of resource created at.
- `id` (String) The Guance Resource Name (GRN) of cloud resource.
- `create_at` (String) The unix timestamp in seconds of the member creation.
- `uuid` (String) The uuid of the member.

<a id="nestedatt--members--roles"></a>
### Nested Schema for `members.roles`

Optional:

- `name` (String) The name of the role.
- `uuid` (String) The UUID of the role.


80 changes: 80 additions & 0 deletions docs/data-sources/permissions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "guance_permissions Data Source - guance"
subcategory: ""
description: |-
A role permission is defined to grant a user permission to perform a specific action on a specific resource.
Guance Cloud supports a number of different role permissions, and you can create new roles for users and assign permission scopes to roles to meet the permission needs of your organization.
Example Usage
```terraform
data "guance_permissions" "demo" {
}
output "permissions" {
value = data.guance_permissions.demo
}
```
---

# guance_permissions (Data Source)

A role permission is defined to grant a user permission to perform a specific action on a specific resource.

Guance Cloud supports a number of different role permissions, and you can create new roles for users and assign permission scopes to roles to meet the permission needs of your organization.


## Example Usage

```terraform
data "guance_permissions" "demo" {
}
output "permissions" {
value = data.guance_permissions.demo
}
```



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

### Optional

- `is_support_custom_role` (Boolean) Filter the permission list that supports custom role.

### Read-Only

- `permissions` (Attributes List) The list of the permissions. (see [below for nested schema](#nestedatt--permissions))

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

Read-Only:

- `desc` (String) The description of the permission.
- `disabled` (Number) The disabled status of the permission.
- `is_support_custom_role` (Number) Whether support custom role.
- `is_support_general` (Number) Whether support general.
- `is_support_owner` (Number) Whether support owner.
- `is_support_read_only` (Number) Whether support readonly.
- `is_support_ws_admin` (Number) Whether support WsAdmin.
- `key` (String) The key of the permission.
- `name` (String) The name of the permission.
- `subs` (Attributes List) The list of the sub permissions. (see [below for nested schema](#nestedatt--permissions--subs))

<a id="nestedatt--permissions--subs"></a>
### Nested Schema for `permissions.subs`

Read-Only:

- `desc` (String) The description of the permission.
- `disabled` (Number) The disabled status of the permission.
- `is_support_custom_role` (Number) Whether support custom role.
- `is_support_general` (Number) Whether support general.
- `is_support_owner` (Number) Whether support owner.
- `is_support_read_only` (Number) Whether support readonly.
- `is_support_ws_admin` (Number) Whether support WsAdmin.
- `key` (String) The key of the permission.
- `name` (String) The name of the permission.


Loading

0 comments on commit 3c26f5e

Please sign in to comment.