Skip to content

Commit

Permalink
Change identity_ids type to Set
Browse files Browse the repository at this point in the history
  • Loading branch information
Miouge1 committed Dec 2, 2024
1 parent c95c788 commit ef53b15
Show file tree
Hide file tree
Showing 27 changed files with 1,606 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/data-sources/resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Optional:

Read-Only:

- `identity_ids` (List of String) A list of User Managed Identity ID's which should be assigned to the azure resource.
- `identity_ids` (Set of String) A set of User Managed Identity ID's which should be assigned to the azure resource.
- `principal_id` (String) The Principal ID for the Service Principal associated with the Managed Service Identity of this Azure resource.
- `tenant_id` (String) The Tenant ID for the Service Principal associated with the Managed Service Identity of this Azure resource.
- `type` (String) The Type of Identity which should be used for this azure resource. Possible values are `SystemAssigned`, `UserAssigned` and `SystemAssigned,UserAssigned`
2 changes: 1 addition & 1 deletion docs/resources/resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ Required:

Optional:

- `identity_ids` (List of String) A list of User Managed Identity ID's which should be assigned to the azure resource.
- `identity_ids` (Set of String) A set of User Managed Identity ID's which should be assigned to the azure resource.

Read-Only:

Expand Down
2 changes: 1 addition & 1 deletion internal/docstrings/identity_ids.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package docstrings

const (
identityIds = `A list of User Managed Identity ID's which should be assigned to the azure resource.`
identityIds = `A set of User Managed Identity ID's which should be assigned to the azure resource.`
)

// IdentityIds returns the docstring for the identity type attribute.
Expand Down
7 changes: 4 additions & 3 deletions internal/services/azapi_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"github.com/cenkalti/backoff/v4"
"github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts"
"github.com/hashicorp/terraform-plugin-framework-validators/listvalidator"
"github.com/hashicorp/terraform-plugin-framework-validators/setvalidator"
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
"github.com/hashicorp/terraform-plugin-framework/attr"
"github.com/hashicorp/terraform-plugin-framework/diag"
Expand Down Expand Up @@ -338,11 +339,11 @@ func (r *AzapiResource) Schema(ctx context.Context, _ resource.SchemaRequest, re
MarkdownDescription: docstrings.IdentityType(),
},

"identity_ids": schema.ListAttribute{
"identity_ids": schema.SetAttribute{
ElementType: types.StringType,
Optional: true,
Validators: []validator.List{
listvalidator.ValueStringsAre(myvalidator.StringIsUserAssignedIdentityID()),
Validators: []validator.Set{
setvalidator.ValueStringsAre(myvalidator.StringIsUserAssignedIdentityID()),
},
MarkdownDescription: docstrings.IdentityIds(),
},
Expand Down
2 changes: 1 addition & 1 deletion internal/services/azapi_resource_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (r *AzapiResourceDataSource) Schema(ctx context.Context, request datasource
MarkdownDescription: docstrings.IdentityTenantID(),
},

"identity_ids": schema.ListAttribute{
"identity_ids": schema.SetAttribute{
Computed: true,
ElementType: types.StringType,
MarkdownDescription: docstrings.IdentityIds(),
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ef53b15

Please sign in to comment.