From d622a0a80ac8fd0b548db44da4fb19e82e328d55 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Tue, 13 Oct 2020 23:12:03 -0400 Subject: [PATCH] Update docs and Makefile target (#57) * Update examples * Remove update-deps target...go get -u is generally not what you want and we want more targeted updates * Go mod tidy * Fix up tools * Update docs --- Makefile | 11 +++-- README.md | 11 +++-- docs/index.md | 2 +- docs/resources/account.md | 9 ++-- docs/resources/auth_method.md | 9 ++-- docs/resources/group.md | 26 ++++++----- docs/resources/host.md | 19 ++++---- docs/resources/host_catalog.md | 17 +++---- docs/resources/host_set.md | 17 +++---- docs/resources/role.md | 46 ++++++++++--------- docs/resources/scope.md | 26 +++++------ docs/resources/target.md | 22 ++++----- docs/resources/user.md | 9 ++-- .../resources/boundary_account/resource.tf | 9 ++-- .../boundary_auth_method/resource.tf | 9 ++-- .../project-specific/resource.tf | 17 +++---- .../boundary_group/simple/resource.tf | 9 ++-- examples/resources/boundary_host/resource.tf | 17 +++---- .../boundary_host_catalog/resource.tf | 17 +++---- .../resources/boundary_host_set/resource.tf | 17 +++---- .../project-specific/resource.tf | 17 +++---- .../boundary_role/simple/resource.tf | 9 ++-- .../boundary_role/user-grants/resource.tf | 9 ++-- .../resources/boundary_role/user/resource.tf | 9 ++-- examples/resources/boundary_scope/global.tf | 5 +- .../resources/boundary_scope/organization.tf | 9 ++-- examples/resources/boundary_scope/project.tf | 8 ++-- .../resources/boundary_target/resource.tf | 22 ++++----- examples/resources/boundary_user/resource.tf | 9 ++-- go.sum | 4 -- internal/provider/resource_scope.go | 2 +- tools/tools.go | 2 + 32 files changed, 224 insertions(+), 200 deletions(-) diff --git a/Makefile b/Makefile index 7bb2b556..e4beb845 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -default: update-deps testacc +default: testacc GOOS=$(shell go env GOOS) GOARCH=$(shell go env GOARCH) INSTALL_PATH=~/.local/share/terraform/plugins/localhost/providers/boundary/0.0.1/linux_$(GOARCH) @@ -11,8 +11,10 @@ ifeq ($(GOOS), "windows") INSTALL_PATH=%APPDATA%/HashiCorp/Terraform/plugins/localhost/providers/boundary/0.0.1/windows_$(GOARCH) endif +tools: + go generate -tags tools tools/tools.go + # Run acceptance tests -.PHONY: testacc testacc: TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 120m @@ -22,9 +24,6 @@ testacc-ci: install-go install-go: ./ci/goinstall.sh - -update-deps: - GOPROXY=direct GOSUMDB=off go get -u dev: mkdir -p $(INSTALL_PATH) @@ -38,3 +37,5 @@ all: rm-id-flag-from-docs: find docs/ -name "*.md" -type f | xargs sed -i -e '/- \*\*id\*\*/d' + +.PHONY: testacc tools \ No newline at end of file diff --git a/README.md b/README.md index b6826b39..1947da95 100644 --- a/README.md +++ b/README.md @@ -115,8 +115,9 @@ resource "boundary_scope" "global" { } resource "boundary_scope" "corp" { - scope_id = boundary_scope.global.id - auto_create_role = true + scope_id = boundary_scope.global.id + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_user" "users" { @@ -156,9 +157,9 @@ resource "boundary_role" "organization_admin" { // create a project for core infrastructure resource "boundary_scope" "core_infra" { - description = "Core infrastrcture" - scope_id = boundary_scope.corp.id - auto_create_role = true + description = "Core infrastrcture" + scope_id = boundary_scope.corp.id + auto_create_admin_role = true } resource "boundary_host_catalog" "backend_servers" { diff --git a/docs/index.md b/docs/index.md index 81608afe..692f2350 100644 --- a/docs/index.md +++ b/docs/index.md @@ -34,4 +34,4 @@ provider "boundary" { - **password_auth_method_login_name** (String, Optional) The auth method login name for password-style auth methods - **password_auth_method_password** (String, Optional) The auth method password for password-style auth methods - **recovery_kms_hcl** (String, Optional) Can be a heredoc string or a path on disk. If set, the string/file will be parsed as HCL and used with the recovery KMS mechanism. While this is set, it will override any other authentication information; the KMS mechanism will always be used. See Boundary's KMS docs for examples: https://boundaryproject.io/docs/configuration/kms -- **token** (String, Optional) The Boundary token to use, as a string or path on disk containing just the string. If set, the token read here will be used in place of authenticating with the auth method specified in "auth_method_id", although the recovery KMS mechanism will still override this. Can also be set with the BOUNDARY_TOKEN environment variable. +- **token** (String, Optional) The Boundary token to use, as a string or path on disk containing just the string. If set, the token read here will be used in place of authenticating with the auth method specified in "auth_method_id", although the recovery KMS mechanism will still override this. Can also be set with the BOUNDARY_TOKEN environment variable. \ No newline at end of file diff --git a/docs/resources/account.md b/docs/resources/account.md index 08d3826a..4c37f687 100644 --- a/docs/resources/account.md +++ b/docs/resources/account.md @@ -13,10 +13,11 @@ The account resource allows you to configure a Boundary account. ```terraform resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = "global" - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = "global" + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_auth_method" "password" { diff --git a/docs/resources/auth_method.md b/docs/resources/auth_method.md index 407897f8..dfe15e45 100644 --- a/docs/resources/auth_method.md +++ b/docs/resources/auth_method.md @@ -13,10 +13,11 @@ The auth method resource allows you to configure a Boundary auth_method. ```terraform resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = "global" - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = "global" + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_auth_method" "password" { diff --git a/docs/resources/group.md b/docs/resources/group.md index 17b11d51..21a9df14 100644 --- a/docs/resources/group.md +++ b/docs/resources/group.md @@ -13,10 +13,11 @@ The group resource allows you to configure a Boundary group. ```terraform resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = "global" - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = "global" + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_user" "foo" { @@ -36,17 +37,18 @@ Usage for project-specific group: ```terraform resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = "global" - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = "global" + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_scope" "project" { - name = "project_one" - description = "My first scope!" - scope_id = boundary_scope.org.id - auto_create_role = true + name = "project_one" + description = "My first scope!" + scope_id = boundary_scope.org.id + auto_create_admin_role = true } resource "boundary_user" "foo" { diff --git a/docs/resources/host.md b/docs/resources/host.md index 3b5c7fc3..9bdca318 100644 --- a/docs/resources/host.md +++ b/docs/resources/host.md @@ -13,21 +13,22 @@ The host resource allows you to configure a Boundary static host. Hosts are alwa ```terraform resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = "global" - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = "global" + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_scope" "project" { - name = "project_one" - description = "My first scope!" - scope_id = boundary_scope.org.id - auto_create_role = true + name = "project_one" + description = "My first scope!" + scope_id = boundary_scope.org.id + auto_create_admin_role = true } resource "boundary_host" "example" { - name = "My catalog" + name = "example_host" description = "My first host!" address = "10.0.0.1" scope_id = boundary_scope.project.id diff --git a/docs/resources/host_catalog.md b/docs/resources/host_catalog.md index 0e7c010a..53d03ee4 100644 --- a/docs/resources/host_catalog.md +++ b/docs/resources/host_catalog.md @@ -13,17 +13,18 @@ The host catalog resource allows you to configure a Boundary host catalog. Host ```terraform resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = boundary_scope.global.id - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = boundary_scope.global.id + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_scope" "project" { - name = "project_one" - description = "My first scope!" - scope_id = boundary_scope.org.id - auto_create_role = true + name = "project_one" + description = "My first scope!" + scope_id = boundary_scope.org.id + auto_create_admin_role = true } resource "boundary_host_catalog" "example" { diff --git a/docs/resources/host_set.md b/docs/resources/host_set.md index b6e0a976..0b7662ca 100644 --- a/docs/resources/host_set.md +++ b/docs/resources/host_set.md @@ -13,17 +13,18 @@ The host_set resource allows you to configure a Boundary host set. Host sets are ```terraform resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = "global" - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = "global" + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_scope" "project" { - name = "project_one" - description = "My first scope!" - scope_id = boundary_scope.org.id - auto_create_role = true + name = "project_one" + description = "My first scope!" + scope_id = boundary_scope.org.id + auto_create_admin_role = true } resource "boundary_host_catalog" "static" { diff --git a/docs/resources/role.md b/docs/resources/role.md index 6e4e1a46..267d0693 100644 --- a/docs/resources/role.md +++ b/docs/resources/role.md @@ -15,10 +15,11 @@ Basic usage: ```terraform resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = "global" - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = "global" + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_role" "example" { @@ -32,10 +33,11 @@ Usage with a user resource: ```terraform resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = "global" - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = "global" + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_user" "foo" { @@ -60,10 +62,11 @@ Usage with user and grants resource: ```terraform resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = "global" - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = "global" + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_user" "readonly" { @@ -85,17 +88,18 @@ Usage for a project-specific role: ```terraform resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = "global" - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = "global" + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_scope" "project" { - name = "project_one" - description = "My first scope!" - scope_id = boundary_scope.org.id - auto_create_role = true + name = "project_one" + description = "My first scope!" + scope_id = boundary_scope.org.id + auto_create_admin_role = true } resource "boundary_user" "readonly" { @@ -134,4 +138,4 @@ Import is supported using the following syntax: ```shell terraform import boundary_role.foo -``` +``` \ No newline at end of file diff --git a/docs/resources/scope.md b/docs/resources/scope.md index 9f0d0768..aa9fe0ec 100644 --- a/docs/resources/scope.md +++ b/docs/resources/scope.md @@ -15,9 +15,8 @@ Creating the global scope: ```terraform resource "boundary_scope" "global" { - global_scope = true - scope_id = "global" - auto_create_role = true + global_scope = true + scope_id = "global" } ``` @@ -25,10 +24,11 @@ Creating an organization scope within global: ```terraform resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = boundary_scope.global.id - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = boundary_scope.global.id + auto_create_admin_role = true + auto_create_default_role = true } ``` @@ -36,10 +36,10 @@ Creating an project scope within an organization: ```terraform resource "boundary_scope" "project" { - name = "project_one" - description = "My first scope!" - scope_id = boundary_scope.org.id - auto_create_role = true + name = "project_one" + description = "My first scope!" + scope_id = boundary_scope.org.id + auto_create_admin_role = true } ``` @@ -69,7 +69,7 @@ resource "boundary_role" "org_admin" { ### Optional - **auto_create_admin_role** (Boolean, Optional) If set, when a new scope is created, the provider will not disable the functionality that automatically creates a role in the new scope and gives permissions to manage the scope to the provider's user. Marking this true makes for simpler HCL but results in role resources that are unmanaged by Terraform. -- **auto_create_default_role** (Boolean, Optional) If set, when a new scope is created, the provider will not disable the functionality that automatically creates a role in the new scope and gives listing of scopes and auth methods and the ability to authenticate to the anonymous user. Marking this true makes for simpler HCL but results in role resources that are unmanaged by Terraform. +- **auto_create_default_role** (Boolean, Optional) Only relevant when creating an org scope. If set, when a new scope is created, the provider will not disable the functionality that automatically creates a role in the new scope and gives listing of scopes and auth methods and the ability to authenticate to the anonymous user. Marking this true makes for simpler HCL but results in role resources that are unmanaged by Terraform. - **description** (String, Optional) The scope description. - **global_scope** (Boolean, Optional) Indicates that the scope containing this value is the global scope, which triggers some specialized behavior to allow it to be imported and managed. - **name** (String, Optional) The scope name. Defaults to the resource name. @@ -80,4 +80,4 @@ Import is supported using the following syntax: ```shell terraform import boundary_scope.foo -``` +``` \ No newline at end of file diff --git a/docs/resources/target.md b/docs/resources/target.md index 24ee6c2c..ebbe85ec 100644 --- a/docs/resources/target.md +++ b/docs/resources/target.md @@ -13,23 +13,23 @@ The target resource allows you to configure a Boundary target. ```terraform resource "boundary_scope" "global" { - global_scope = true - scope_id = "global" - auto_create_role = true + global_scope = true + scope_id = "global" } resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = boundary_scope.global.id - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = boundary_scope.global.id + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_scope" "project" { - name = "project_one" - description = "My first scope!" - scope_id = boundary_scope.org.id - auto_create_role = true + name = "project_one" + description = "My first scope!" + scope_id = boundary_scope.org.id + auto_create_admin_role = true } resource "boundary_host_catalog" "foo" { diff --git a/docs/resources/user.md b/docs/resources/user.md index e783d2b9..d5e800a2 100644 --- a/docs/resources/user.md +++ b/docs/resources/user.md @@ -13,10 +13,11 @@ The user resource allows you to configure a Boundary user. ```terraform resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = "global" - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = "global" + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_auth_method" "password" { diff --git a/examples/resources/boundary_account/resource.tf b/examples/resources/boundary_account/resource.tf index 4cea4f6a..b5a210a8 100644 --- a/examples/resources/boundary_account/resource.tf +++ b/examples/resources/boundary_account/resource.tf @@ -1,8 +1,9 @@ resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = "global" - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = "global" + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_auth_method" "password" { diff --git a/examples/resources/boundary_auth_method/resource.tf b/examples/resources/boundary_auth_method/resource.tf index 7a2925a0..83573985 100644 --- a/examples/resources/boundary_auth_method/resource.tf +++ b/examples/resources/boundary_auth_method/resource.tf @@ -1,8 +1,9 @@ resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = "global" - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = "global" + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_auth_method" "password" { diff --git a/examples/resources/boundary_group/project-specific/resource.tf b/examples/resources/boundary_group/project-specific/resource.tf index ebdc5c61..26a5409c 100644 --- a/examples/resources/boundary_group/project-specific/resource.tf +++ b/examples/resources/boundary_group/project-specific/resource.tf @@ -1,15 +1,16 @@ resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = "global" - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = "global" + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_scope" "project" { - name = "project_one" - description = "My first scope!" - scope_id = boundary_scope.org.id - auto_create_role = true + name = "project_one" + description = "My first scope!" + scope_id = boundary_scope.org.id + auto_create_admin_role = true } resource "boundary_user" "foo" { diff --git a/examples/resources/boundary_group/simple/resource.tf b/examples/resources/boundary_group/simple/resource.tf index fe348f27..b18951fa 100644 --- a/examples/resources/boundary_group/simple/resource.tf +++ b/examples/resources/boundary_group/simple/resource.tf @@ -1,8 +1,9 @@ resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = "global" - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = "global" + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_user" "foo" { diff --git a/examples/resources/boundary_host/resource.tf b/examples/resources/boundary_host/resource.tf index d8ff2192..63b4d4dc 100644 --- a/examples/resources/boundary_host/resource.tf +++ b/examples/resources/boundary_host/resource.tf @@ -1,15 +1,16 @@ resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = "global" - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = "global" + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_scope" "project" { - name = "project_one" - description = "My first scope!" - scope_id = boundary_scope.org.id - auto_create_role = true + name = "project_one" + description = "My first scope!" + scope_id = boundary_scope.org.id + auto_create_admin_role = true } resource "boundary_host" "example" { diff --git a/examples/resources/boundary_host_catalog/resource.tf b/examples/resources/boundary_host_catalog/resource.tf index 26a3cf9a..c2b52908 100644 --- a/examples/resources/boundary_host_catalog/resource.tf +++ b/examples/resources/boundary_host_catalog/resource.tf @@ -1,15 +1,16 @@ resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = boundary_scope.global.id - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = boundary_scope.global.id + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_scope" "project" { - name = "project_one" - description = "My first scope!" - scope_id = boundary_scope.org.id - auto_create_role = true + name = "project_one" + description = "My first scope!" + scope_id = boundary_scope.org.id + auto_create_admin_role = true } resource "boundary_host_catalog" "example" { diff --git a/examples/resources/boundary_host_set/resource.tf b/examples/resources/boundary_host_set/resource.tf index 88b2110c..fcf750be 100644 --- a/examples/resources/boundary_host_set/resource.tf +++ b/examples/resources/boundary_host_set/resource.tf @@ -1,15 +1,16 @@ resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = "global" - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = "global" + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_scope" "project" { - name = "project_one" - description = "My first scope!" - scope_id = boundary_scope.org.id - auto_create_role = true + name = "project_one" + description = "My first scope!" + scope_id = boundary_scope.org.id + auto_create_admin_role = true } resource "boundary_host_catalog" "static" { diff --git a/examples/resources/boundary_role/project-specific/resource.tf b/examples/resources/boundary_role/project-specific/resource.tf index 8a8bb9f8..4e715d95 100644 --- a/examples/resources/boundary_role/project-specific/resource.tf +++ b/examples/resources/boundary_role/project-specific/resource.tf @@ -1,15 +1,16 @@ resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = "global" - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = "global" + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_scope" "project" { - name = "project_one" - description = "My first scope!" - scope_id = boundary_scope.org.id - auto_create_role = true + name = "project_one" + description = "My first scope!" + scope_id = boundary_scope.org.id + auto_create_admin_role = true } resource "boundary_user" "readonly" { diff --git a/examples/resources/boundary_role/simple/resource.tf b/examples/resources/boundary_role/simple/resource.tf index 41e65fd5..da4e1357 100644 --- a/examples/resources/boundary_role/simple/resource.tf +++ b/examples/resources/boundary_role/simple/resource.tf @@ -1,8 +1,9 @@ resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = "global" - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = "global" + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_role" "example" { diff --git a/examples/resources/boundary_role/user-grants/resource.tf b/examples/resources/boundary_role/user-grants/resource.tf index ed82b6b6..846e1b84 100644 --- a/examples/resources/boundary_role/user-grants/resource.tf +++ b/examples/resources/boundary_role/user-grants/resource.tf @@ -1,8 +1,9 @@ resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = "global" - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = "global" + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_user" "readonly" { diff --git a/examples/resources/boundary_role/user/resource.tf b/examples/resources/boundary_role/user/resource.tf index e5e40807..3fc2bc76 100644 --- a/examples/resources/boundary_role/user/resource.tf +++ b/examples/resources/boundary_role/user/resource.tf @@ -1,8 +1,9 @@ resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = "global" - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = "global" + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_user" "foo" { diff --git a/examples/resources/boundary_scope/global.tf b/examples/resources/boundary_scope/global.tf index c2a60309..f900af28 100644 --- a/examples/resources/boundary_scope/global.tf +++ b/examples/resources/boundary_scope/global.tf @@ -1,5 +1,4 @@ resource "boundary_scope" "global" { - global_scope = true - scope_id = "global" - auto_create_role = true + global_scope = true + scope_id = "global" } diff --git a/examples/resources/boundary_scope/organization.tf b/examples/resources/boundary_scope/organization.tf index 4aefe2ca..f1608184 100644 --- a/examples/resources/boundary_scope/organization.tf +++ b/examples/resources/boundary_scope/organization.tf @@ -1,6 +1,7 @@ resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = boundary_scope.global.id - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = boundary_scope.global.id + auto_create_admin_role = true + auto_create_default_role = true } diff --git a/examples/resources/boundary_scope/project.tf b/examples/resources/boundary_scope/project.tf index 671cea0f..02480a2c 100644 --- a/examples/resources/boundary_scope/project.tf +++ b/examples/resources/boundary_scope/project.tf @@ -1,6 +1,6 @@ resource "boundary_scope" "project" { - name = "project_one" - description = "My first scope!" - scope_id = boundary_scope.org.id - auto_create_role = true + name = "project_one" + description = "My first scope!" + scope_id = boundary_scope.org.id + auto_create_admin_role = true } diff --git a/examples/resources/boundary_target/resource.tf b/examples/resources/boundary_target/resource.tf index a0312dd1..c6722ae4 100644 --- a/examples/resources/boundary_target/resource.tf +++ b/examples/resources/boundary_target/resource.tf @@ -1,21 +1,21 @@ resource "boundary_scope" "global" { - global_scope = true - scope_id = "global" - auto_create_role = true + global_scope = true + scope_id = "global" } resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = boundary_scope.global.id - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = boundary_scope.global.id + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_scope" "project" { - name = "project_one" - description = "My first scope!" - scope_id = boundary_scope.org.id - auto_create_role = true + name = "project_one" + description = "My first scope!" + scope_id = boundary_scope.org.id + auto_create_admin_role = true } resource "boundary_host_catalog" "foo" { diff --git a/examples/resources/boundary_user/resource.tf b/examples/resources/boundary_user/resource.tf index 0104e97f..853fe915 100644 --- a/examples/resources/boundary_user/resource.tf +++ b/examples/resources/boundary_user/resource.tf @@ -1,8 +1,9 @@ resource "boundary_scope" "org" { - name = "organization_one" - description = "My first scope!" - scope_id = "global" - auto_create_role = true + name = "organization_one" + description = "My first scope!" + scope_id = "global" + auto_create_admin_role = true + auto_create_default_role = true } resource "boundary_auth_method" "password" { diff --git a/go.sum b/go.sum index f0af4e5f..80023fef 100644 --- a/go.sum +++ b/go.sum @@ -452,8 +452,6 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= -github.com/golang-migrate/migrate/v4 v4.12.2 h1:QI43Tlouiwpp2dK5Y767OouX0snJNRP/NubsVaArzDU= -github.com/golang-migrate/migrate/v4 v4.12.2/go.mod h1:HQ1DaC8uLHkg4afY8ZQ8D/P5SG+YW9X5INZBVvm+d2k= github.com/golang-migrate/migrate/v4 v4.13.0 h1:5S7HMjiq9u50X3+WXpzXPbUj1qUFuZRm8NCsX989Tn4= github.com/golang-migrate/migrate/v4 v4.13.0/go.mod h1:RUEXGkgYXTOdBY9Rbs9izc/SOalUK+dDi7YphFV/CUI= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= @@ -563,8 +561,6 @@ github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBt github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/dbassert v0.0.0-20200928193136-88d5f2091187 h1:KULp/ad4VAihhHelqgAy7610xMVEsCIXQ9Tu+uK6Asg= -github.com/hashicorp/dbassert v0.0.0-20200928193136-88d5f2091187/go.mod h1:+B5eZq7vXqN4Gxkgjm4ub1bwG6OTcYzFL0r+bMvWorg= github.com/hashicorp/dbassert v0.0.0-20200930125617-6218396928df h1:Y5++qCYLnJsz036XXKjawzg09aCvWe5Pq2n2DhbgyrA= github.com/hashicorp/dbassert v0.0.0-20200930125617-6218396928df/go.mod h1:+B5eZq7vXqN4Gxkgjm4ub1bwG6OTcYzFL0r+bMvWorg= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= diff --git a/internal/provider/resource_scope.go b/internal/provider/resource_scope.go index c2d94c30..41277c79 100644 --- a/internal/provider/resource_scope.go +++ b/internal/provider/resource_scope.go @@ -56,7 +56,7 @@ func resourceScope() *schema.Resource { Optional: true, }, scopeAutoCreateDefaultRole: { - Description: "If set, when a new scope is created, the provider will not disable the functionality that automatically creates a role in the new scope and gives listing of scopes and auth methods and the ability to authenticate to the anonymous user. Marking this true makes for simpler HCL but results in role resources that are unmanaged by Terraform.", + Description: "Only relevant when creating an org scope. If set, when a new scope is created, the provider will not disable the functionality that automatically creates a role in the new scope and gives listing of scopes and auth methods and the ability to authenticate to the anonymous user. Marking this true makes for simpler HCL but results in role resources that are unmanaged by Terraform.", Type: schema.TypeBool, Optional: true, }, diff --git a/tools/tools.go b/tools/tools.go index 65393f06..2518913a 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -2,6 +2,8 @@ package tools +//go:generate go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs + import ( // docs generator _ "github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs"