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

Remove default_role from role #269

Merged
merged 1 commit into from
Sep 21, 2022
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
1 change: 0 additions & 1 deletion docs/resources/role.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ resource "boundary_role" "readonly" {

### Optional

- `default_role` (Boolean) Indicates that the role containing this value is the default role (that is, has the id 'r_default'), which triggers some specialized behavior to allow it to be imported and managed.
- `description` (String) The role description.
- `grant_scope_id` (String)
- `grant_strings` (Set of String) A list of stringified grants for the role.
Expand Down
15 changes: 0 additions & 15 deletions internal/provider/resource_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const (
roleGrantScopeIdKey = "grant_scope_id"
rolePrincipalIdsKey = "principal_ids"
roleGrantStringsKey = "grant_strings"
roleDefaultRoleKey = "default_role"
)

func resourceRole() *schema.Resource {
Expand Down Expand Up @@ -68,11 +67,6 @@ func resourceRole() *schema.Resource {
Optional: true,
Computed: true,
},
roleDefaultRoleKey: {
Type: schema.TypeBool,
Optional: true,
Description: "Indicates that the role containing this value is the default role (that is, has the id 'r_default'), which triggers some specialized behavior to allow it to be imported and managed.",
},
},
}
}
Expand Down Expand Up @@ -101,11 +95,6 @@ func setFromRoleResponseMap(d *schema.ResourceData, raw map[string]interface{})
}

func resourceRoleCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
if d.Get(roleDefaultRoleKey).(bool) {
d.SetId("r_default")
return resourceRoleRead(ctx, d, meta)
}

md := meta.(*metaData)

var scopeId string
Expand Down Expand Up @@ -323,10 +312,6 @@ func resourceRoleUpdate(ctx context.Context, d *schema.ResourceData, meta interf
}

func resourceRoleDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
if d.Get(roleDefaultRoleKey).(bool) {
return nil
}

md := meta.(*metaData)
rc := roles.NewClient(md.client)

Expand Down