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

data.azurerm_role_definition - fix the issue where the value of properties role_definition_id and scope are set to empty #24211

Merged
merged 1 commit into from
Dec 13, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonids"
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/authorization/parse"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation"
)
Expand Down Expand Up @@ -156,7 +155,6 @@ func (a RoleDefinitionDataSource) Read() sdk.ResourceFunc {
defId := config.RoleDefinitionId

// search by name
var id parse.RoleDefinitionID
var role authorization.RoleDefinition
if config.Name != "" {
// Accounting for eventual consistency
Expand Down Expand Up @@ -195,8 +193,8 @@ func (a RoleDefinitionDataSource) Read() sdk.ResourceFunc {
}

state := RoleDefinitionDataSourceModel{
Scope: id.Scope,
RoleDefinitionId: id.RoleID,
Scope: config.Scope,
RoleDefinitionId: pointer.From(role.ID),
}

state.Name = pointer.From(role.RoleName)
Expand Down
Loading