Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AV-65088] Better access example for creating db user #61

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 1.0.0 (Unreleased)

## October 18 2023
UPGRADE NOTES:
- Upgraded provider to use Golang 1.20+ and Terraform 1.5+
- Upgraded terraform-plugin-framework to 1.4.1

BUG FIXES:
- Update cluster will no longer fail for PoC organization with developer pro plan.
- User removed from organization from Capella UI won't break the terraform provider.

ENHANCEMENTS:
- Detailed examples and README with sample outputs
22 changes: 19 additions & 3 deletions examples/database_credential/terraform.template.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ host = "https://cloudapi.cloud.couchbase.com"
database_credential_name = "test_db_user"
cluster_id = "<cluster_id>"
password = "Secret12$#"
access = [{
privileges = ["data_reader", "data_writer"]
}]
access = [
{
privileges = ["data_writer"]
resources = {
buckets = [{
name = "new_terraform_bucket"
scopes = [
{
name = "_default"
collections = ["_default"]
}
]
}]
}
},
{
privileges = ["data_reader"]
}
]
22 changes: 19 additions & 3 deletions examples/demo/terraform.template.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,25 @@ support = {
database_credential_name = "terraform_db_credential"
password = "Secret12$#"

access = [{
privileges = ["data_reader", "data_writer"]
}]
access = [
{
privileges = ["data_writer"]
resources = {
buckets = [{
name = "new_terraform_bucket"
scopes = [
{
name = "_default"
collections = ["_default"]
}
]
}]
}
},
{
privileges = ["data_reader"]
}
]

comment = "Allow access from a public IP"
cidr = "8.8.8.8/32"
Expand Down
9 changes: 9 additions & 0 deletions examples/demo/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ variable "password" {
variable "access" {
type = list(object({
privileges = list(string)
resources = optional(object({
buckets = list(object({
name = string
scopes = optional(list(object({
name = string
collections = optional(list(string))
})))
}))
}))
}))
}

Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ github.com/hashicorp/go-plugin v1.5.1 h1:oGm7cWBaYIp3lJpx1RUEfLWophprE2EV/KUeqBY
github.com/hashicorp/go-plugin v1.5.1/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4=
github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=
github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/terraform-plugin-framework v1.4.0 h1:WKbtCRtNrjsh10eA7NZvC/Qyr7zp77j+D21aDO5th9c=
github.com/hashicorp/terraform-plugin-framework v1.4.0/go.mod h1:XC0hPcQbBvlbxwmjxuV/8sn8SbZRg4XwGMs22f+kqV0=
github.com/hashicorp/terraform-plugin-framework v1.4.1 h1:ZC29MoB3Nbov6axHdgPbMz7799pT5H8kIrM8YAsaVrs=
github.com/hashicorp/terraform-plugin-framework v1.4.1/go.mod h1:XC0hPcQbBvlbxwmjxuV/8sn8SbZRg4XwGMs22f+kqV0=
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 h1:HOjBuMbOEzl7snOdOoUfE2Jgeto6JOjLVQ39Ls2nksc=
Expand Down