diff --git a/docs/data-sources/scope.md b/docs/data-sources/scope.md index c367e851..13728b91 100644 --- a/docs/data-sources/scope.md +++ b/docs/data-sources/scope.md @@ -15,13 +15,13 @@ Please note that the Global scope will always have an id of "global", and does n ```terraform # Retrieve the ID of a Boundary project data "boundary_scope" "org" { - name = "SecOps" - parent_scope_id = "global" + name = "SecOps" + scope_id = "global" } data "boundary_scope" "project" { - name = "2111" - parent_scope_id = data.boundary_scope.id + name = "2111" + scope_id = data.boundary_scope.id } ``` diff --git a/examples/data-sources/boundary_scope/data-source.tf b/examples/data-sources/boundary_scope/data-source.tf index 3eb375d3..94fc7cef 100644 --- a/examples/data-sources/boundary_scope/data-source.tf +++ b/examples/data-sources/boundary_scope/data-source.tf @@ -1,10 +1,10 @@ # Retrieve the ID of a Boundary project data "boundary_scope" "org" { - name = "SecOps" - parent_scope_id = "global" + name = "SecOps" + scope_id = "global" } data "boundary_scope" "project" { - name = "2111" - parent_scope_id = data.boundary_scope.id + name = "2111" + scope_id = data.boundary_scope.id } diff --git a/internal/provider/const.go b/internal/provider/const.go index 1730403b..8823b0f7 100644 --- a/internal/provider/const.go +++ b/internal/provider/const.go @@ -47,8 +47,8 @@ const ( // workerFilter is used for common "worker_filter" resource attribute WorkerFilterKey = "worker_filter" // common User arguments - LoginNameKey = "login_name" - PrimaryAccountID = "primary_account_id" - ScopeKey = "scope" - ParentScopeId = "parent_scope_id" + LoginNameKey = "login_name" + PrimaryAccountIdKey = "primary_account_id" + ScopeKey = "scope" + ParentScopeIdKey = "parent_scope_id" ) diff --git a/internal/provider/data_source_scope.go b/internal/provider/data_source_scope.go index 304c2d2e..8b5eff3c 100644 --- a/internal/provider/data_source_scope.go +++ b/internal/provider/data_source_scope.go @@ -65,7 +65,7 @@ func dataSourceScopeRead(ctx context.Context, d *schema.ResourceData, meta inter scpls, err := scp.List(ctx, scopeId, opts...) if err != nil { - return diag.Errorf("error calling read scope: %v", err) + return diag.Errorf("error calling list scope: %v", err) } if scpls == nil { return diag.Errorf("no scopes found") diff --git a/internal/provider/data_source_user.go b/internal/provider/data_source_user.go index 29f6bc32..e59e0d61 100644 --- a/internal/provider/data_source_user.go +++ b/internal/provider/data_source_user.go @@ -69,7 +69,7 @@ func dataSourceUser() *schema.Resource { Type: schema.TypeString, Computed: true, }, - ParentScopeId: { + ParentScopeIdKey: { Type: schema.TypeString, Computed: true, }, @@ -89,7 +89,7 @@ func dataSourceUser() *schema.Resource { Type: schema.TypeString, Computed: true, }, - PrimaryAccountID: { + PrimaryAccountIdKey: { Description: "Primary account ID.", Type: schema.TypeString, Computed: true, @@ -151,7 +151,7 @@ func setFromUserItem(d *schema.ResourceData, user users.User) error { if err := d.Set(LoginNameKey, user.LoginName); err != nil { return err } - if err := d.Set(PrimaryAccountID, user.PrimaryAccountId); err != nil { + if err := d.Set(PrimaryAccountIdKey, user.PrimaryAccountId); err != nil { return err } @@ -178,7 +178,7 @@ func flattenScopeInfo(scope *scopes.ScopeInfo) []interface{} { m[DescriptionKey] = v } if v := scope.ParentScopeId; v != "" { - m[ParentScopeId] = v + m[ParentScopeIdKey] = v } if v := scope.Name; v != "" { m[NameKey] = v diff --git a/internal/provider/data_source_user_test.go b/internal/provider/data_source_user_test.go index 8ad1c8b1..41a704d7 100644 --- a/internal/provider/data_source_user_test.go +++ b/internal/provider/data_source_user_test.go @@ -82,7 +82,7 @@ func TestAccUserDataSource_globalAdminUser(t *testing.T) { resource.TestCheckResourceAttr(dataSourceName, DescriptionKey, "Initial admin user within the \"global\" scope"), resource.TestCheckResourceAttr(dataSourceName, LoginNameKey, "testuser"), resource.TestMatchResourceAttr(dataSourceName, IDKey, regexache.MustCompile(`^u_.+`)), - resource.TestMatchResourceAttr(dataSourceName, PrimaryAccountID, regexache.MustCompile(`^acctpw_.+`)), + resource.TestMatchResourceAttr(dataSourceName, PrimaryAccountIdKey, regexache.MustCompile(`^acctpw_.+`)), resource.TestCheckResourceAttr(dataSourceName, "authorized_actions.#", "7"), resource.TestCheckResourceAttr(dataSourceName, "scope.0.name", "global"), resource.TestCheckResourceAttr(dataSourceName, "scope.0.id", "global"),