Skip to content

Commit

Permalink
rename writeable + ACLs (#166)
Browse files Browse the repository at this point in the history
* rename writeable + ACLs

* Automated docs update

---------

Co-authored-by: Dean Oren <[email protected]>
Co-authored-by: do87 <[email protected]>
  • Loading branch information
3 people authored Jul 25, 2023
1 parent 7ad93c2 commit d00ef5f
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion docs/data-sources/secrets_manager_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ data "stackit_secrets_manager_instance" "example" {

### Read-Only

- `acl` (Set of String) Specifies the ACLs for the instance.
- `acl` (Set of String) Specifies the access list for the instance.
- `api_url` (String) Specifies the API URL for managing secrets.
- `frontend_url` (String) Specifies the frontend for managing secrets.
- `name` (String) Specifies the instance name.
Expand Down
10 changes: 5 additions & 5 deletions docs/data-sources/secrets_manager_user.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ resource "stackit_secrets_manager_instance" "example" {
}
resource "stackit_secrets_manager_user" "example" {
project_id = var.project_id
instance_id = stackit_secrets_manager_instance.example.id
description = "test"
writable = true
project_id = var.project_id
instance_id = stackit_secrets_manager_instance.example.id
description = "test"
write_enabled = true
}
data "stackit_secrets_manager_user" "example" {
Expand All @@ -49,7 +49,7 @@ data "stackit_secrets_manager_user" "example" {

### Optional

- `writable` (Boolean) Specifies if the user can write secrets. `false` by default.
- `write_enabled` (Boolean) Specifies if the user can write secrets. `false` by default.

### Read-Only

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/secrets_manager_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ resource "stackit_secrets_manager_instance" "example" {

### Optional

- `acl` (Set of String) Specifies the ACLs for the instance. Each item must be CIDR notation.
- `acl` (Set of String) Specifies the access list for the instance. Each item must be CIDR notation.

### Read-Only

Expand Down
10 changes: 5 additions & 5 deletions docs/resources/secrets_manager_user.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ resource "stackit_secrets_manager_instance" "example" {
}
resource "stackit_secrets_manager_user" "example" {
project_id = var.project_id
instance_id = stackit_secrets_manager_instance.example.id
description = "example"
writable = true
project_id = var.project_id
instance_id = stackit_secrets_manager_instance.example.id
description = "example"
write_enabled = true
}
```

Expand All @@ -43,7 +43,7 @@ resource "stackit_secrets_manager_user" "example" {
### Optional

- `description` (String) Specifies the description of the user. Changing this value requires the resource to be recreated.
- `writable` (Boolean) Specifies if the user can write secrets. `false` by default.
- `write_enabled` (Boolean) Specifies if the user can write secrets. `false` by default.

### Read-Only

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ resource "stackit_secrets_manager_instance" "example" {
}

resource "stackit_secrets_manager_user" "example" {
project_id = var.project_id
instance_id = stackit_secrets_manager_instance.example.id
description = "test"
writable = true
project_id = var.project_id
instance_id = stackit_secrets_manager_instance.example.id
description = "test"
write_enabled = true
}

data "stackit_secrets_manager_user" "example" {
Expand Down
8 changes: 4 additions & 4 deletions examples/resources/stackit_secrets_manager_user/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ resource "stackit_secrets_manager_instance" "example" {
}

resource "stackit_secrets_manager_user" "example" {
project_id = var.project_id
instance_id = stackit_secrets_manager_instance.example.id
description = "example"
writable = true
project_id = var.project_id
instance_id = stackit_secrets_manager_instance.example.id
description = "example"
write_enabled = true
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (d *DataSource) Schema(ctx context.Context, req datasource.SchemaRequest, r
Computed: true,
},
"acl": schema.SetAttribute{
Description: "Specifies the ACLs for the instance.",
Description: "Specifies the access list for the instance.",
Computed: true,
ElementType: types.StringType,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestAcc_SecretsManagerUser(t *testing.T) {
resource.TestCheckTypeSetElemAttrPair("stackit_secrets_manager_user.example", "username", "data.stackit_secrets_manager_user.example", "username"),
resource.TestCheckTypeSetElemAttrPair("stackit_secrets_manager_user.example", "id", "data.stackit_secrets_manager_user.example", "id"),
resource.TestCheckTypeSetElemAttrPair("stackit_secrets_manager_user.example", "instance_id", "data.stackit_secrets_manager_user.example", "instance_id"),
resource.TestCheckTypeSetElemAttrPair("stackit_secrets_manager_user.example", "writable", "data.stackit_secrets_manager_user.example", "writable"),
resource.TestCheckTypeSetElemAttrPair("stackit_secrets_manager_user.example", "write_enabled", "data.stackit_secrets_manager_user.example", "write_enabled"),
resource.TestCheckTypeSetElemAttrPair("stackit_secrets_manager_user.example", "description", "data.stackit_secrets_manager_user.example", "description"),
),
},
Expand All @@ -52,7 +52,7 @@ resource "stackit_secrets_manager_user" "example" {
project_id = stackit_secrets_manager_instance.example.project_id
instance_id = stackit_secrets_manager_instance.example.id
description = "test"
writable = true
write_enabled = true
}
data "stackit_secrets_manager_user" "example" {
Expand Down
4 changes: 2 additions & 2 deletions stackit/internal/data-sources/secrets-manager/user/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type User struct {
ProjectID types.String `tfsdk:"project_id"`
InstanceID types.String `tfsdk:"instance_id"`
Description types.String `tfsdk:"description"`
Write types.Bool `tfsdk:"writable"`
Write types.Bool `tfsdk:"write_enabled"`
Username types.String `tfsdk:"username"`
}

Expand Down Expand Up @@ -55,7 +55,7 @@ func (d *DataSource) Schema(ctx context.Context, req datasource.SchemaRequest, r
Description: "Specifies the description of the user. Changing this value requires the resource to be recreated.",
Computed: true,
},
"writable": schema.BoolAttribute{
"write_enabled": schema.BoolAttribute{
Description: "Specifies if the user can write secrets. `false` by default.",
Optional: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (r *Resource) Schema(ctx context.Context, req resource.SchemaRequest, resp
},
},
"acl": schema.SetAttribute{
Description: "Specifies the ACLs for the instance. Each item must be CIDR notation.",
Description: "Specifies the access list for the instance. Each item must be CIDR notation.",
Optional: true,
Computed: true,
ElementType: types.StringType,
Expand Down
2 changes: 1 addition & 1 deletion stackit/internal/resources/secrets-manager/user/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (r Resource) Update(ctx context.Context, req resource.UpdateRequest, resp *
return
}

resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("writable"), write)...)
resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("write_enabled"), write)...)
if resp.Diagnostics.HasError() {
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestAcc_SecretsManagerUser(t *testing.T) {
Config: config(name, true),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("stackit_secrets_manager_user.example", "description", "test"),
resource.TestCheckResourceAttr("stackit_secrets_manager_user.example", "writable", "true"),
resource.TestCheckResourceAttr("stackit_secrets_manager_user.example", "write_enabled", "true"),
resource.TestCheckResourceAttrSet("stackit_secrets_manager_user.example", "username"),
resource.TestCheckResourceAttrSet("stackit_secrets_manager_user.example", "password"),
resource.TestCheckResourceAttrSet("stackit_secrets_manager_user.example", "id"),
Expand All @@ -42,7 +42,7 @@ func TestAcc_SecretsManagerUser(t *testing.T) {
{
Config: config(name, false),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("stackit_secrets_manager_user.example", "writable", "false"),
resource.TestCheckResourceAttr("stackit_secrets_manager_user.example", "write_enabled", "false"),
),
},
// test import
Expand Down Expand Up @@ -83,7 +83,7 @@ func config(name string, writeable bool) string {
project_id = stackit_secrets_manager_instance.example.project_id
instance_id = stackit_secrets_manager_instance.example.id
description = "test"
writable = %v
write_enabled = %v
}
`,
common.GetAcceptanceTestsProjectID(),
Expand Down
4 changes: 2 additions & 2 deletions stackit/internal/resources/secrets-manager/user/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type User struct {
ProjectID types.String `tfsdk:"project_id"`
InstanceID types.String `tfsdk:"instance_id"`
Description types.String `tfsdk:"description"`
Write types.Bool `tfsdk:"writable"`
Write types.Bool `tfsdk:"write_enabled"`
Username types.String `tfsdk:"username"`
Password types.String `tfsdk:"password"`
}
Expand Down Expand Up @@ -70,7 +70,7 @@ func (r *Resource) Schema(ctx context.Context, req resource.SchemaRequest, resp
stringplanmodifier.RequiresReplace(),
},
},
"writable": schema.BoolAttribute{
"write_enabled": schema.BoolAttribute{
Description: "Specifies if the user can write secrets. `false` by default.",
Optional: true,
Computed: true,
Expand Down

0 comments on commit d00ef5f

Please sign in to comment.