Skip to content

Commit

Permalink
Add resource "neon_project_permission"
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Kisler <admin@dkisler.com>
  • Loading branch information
kislerdm authored Jan 28, 2024
2 parents be055f8 + ef7da06 commit 8b49f9b
Show file tree
Hide file tree
Showing 17 changed files with 735 additions and 183 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v0.4.0] - 2024-01-28

### Added

- Added the resource `neon_project_permission` to manage the project's permissions.

### Changed

- Updated dependencies:
- Neon Go SDK [v0.4.3](https://github.com/kislerdm/neon-sdk-go/releases/tag/v0.4.3)
- Terraform docs [v0.18.0](https://github.com/hashicorp/terraform-plugin-docs/releases/tag/v0.18.0)

## [v0.3.2] - 2024-01-11

### Fixed
Expand Down
2 changes: 0 additions & 2 deletions docs/resources/branch.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,3 @@ See details: https://neon.tech/docs/reference/glossary/#lsn

- `id` (String) Branch ID.
- `logical_size` (Number) Branch logical size in MB.


2 changes: 0 additions & 2 deletions docs/resources/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,3 @@ resource "neon_database" "example" {
### Read-Only

- `id` (String) The ID of this resource.


2 changes: 0 additions & 2 deletions docs/resources/endpoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,3 @@ The maximum value is 604800 seconds (1 week)
- `host` (String) Endpoint URI.
- `id` (String) Endpoint ID.
- `proxy_host` (String)


2 changes: 0 additions & 2 deletions docs/resources/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,3 @@ Optional:
- `data_transfer_bytes` (Number) Total amount of data transferred from all of a project's branches using the proxy.
- `logical_size_bytes` (Number) Limit on the logical size of every project's branch.
- `written_data_bytes` (Number) Total amount of data written to all of a project's branches.


37 changes: 37 additions & 0 deletions docs/resources/project_permission.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "neon_project_permission Resource - terraform-provider-neon"
subcategory: ""
description: |-
Project's access permission.
---

# neon_project_permission (Resource)

Project's access permission.

## Example Usage

```terraform
resource "neon_project" "example" {
name = "foo"
}
# grant project access to the user with the email foo@bar.qux
resource "neon_project_permission" "share" {
project_id = neon_project.example.id
grantee = "foo@bar.qux"
}
```

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

### Required

- `grantee` (String) Email of the user whom to grant project permission.
- `project_id` (String) Project ID.

### Read-Only

- `id` (String) The ID of this resource.
2 changes: 0 additions & 2 deletions docs/resources/role.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,3 @@ resource "neon_role" "example" {
- `id` (String) The ID of this resource.
- `password` (String, Sensitive) Database authentication password.
- `protected` (Boolean)


9 changes: 9 additions & 0 deletions examples/resources/neon_project_permission/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resource "neon_project" "example" {
name = "foo"
}

# grant project access to the user with the email foo@bar.qux
resource "neon_project_permission" "share" {
project_id = neon_project.example.id
grantee = "foo@bar.qux"
}
34 changes: 20 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,28 @@ module github.com/kislerdm/terraform-provider-neon
go 1.21

require (
github.com/hashicorp/terraform-plugin-docs v0.13.0
github.com/google/uuid v1.3.1
github.com/hashicorp/terraform-plugin-docs v0.18.0
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.31.0
github.com/kislerdm/neon-sdk-go v0.4.2
github.com/kislerdm/neon-sdk-go v0.4.3
)

require (
github.com/Kunde21/markdownfmt/v3 v3.1.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.1.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.2 // indirect
github.com/Masterminds/semver/v3 v3.2.0 // indirect
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
github.com/agext/levenshtein v1.2.2 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/cloudflare/circl v1.3.3 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/hashicorp/cli v1.1.6 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
Expand All @@ -35,17 +37,17 @@ require (
github.com/hashicorp/hc-install v0.6.2 // indirect
github.com/hashicorp/hcl/v2 v2.19.1 // indirect
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform-exec v0.19.0 // indirect
github.com/hashicorp/terraform-json v0.18.0 // indirect
github.com/hashicorp/terraform-exec v0.20.0 // indirect
github.com/hashicorp/terraform-json v0.21.0 // indirect
github.com/hashicorp/terraform-plugin-go v0.20.0 // indirect
github.com/hashicorp/terraform-registry-address v0.2.3 // indirect
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/huandu/xstrings v1.3.3 // indirect
github.com/imdario/mergo v0.3.15 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mitchellh/cli v1.1.5 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
Expand All @@ -59,8 +61,11 @@ require (
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/yuin/goldmark v1.6.0 // indirect
github.com/yuin/goldmark-meta v1.1.0 // indirect
github.com/zclconf/go-cty v1.14.1 // indirect
golang.org/x/crypto v0.16.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.18.0 // indirect
golang.org/x/sys v0.15.0 // indirect
Expand All @@ -69,4 +74,5 @@ require (
google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect
google.golang.org/grpc v1.60.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v2 v2.3.0 // indirect
)
Loading

0 comments on commit 8b49f9b

Please sign in to comment.