Skip to content

Commit

Permalink
Fix custom_role naming for GCP staged resources (#28)
Browse files Browse the repository at this point in the history
The Terraform attribute name for custom roles is custom_role, not role.

This commit fixes the naming and data structure to correct this
misassignment for iam_assessment_staged resources.
  • Loading branch information
nbrahms authored Jun 4, 2024
1 parent 1687708 commit fc52cca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/provider/resources/install/gcp/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type gcpRoleMetadata struct {

type gcpPermissionsMetadata struct {
Permissions []string `json:"requiredPermissions" tfsdk:"permissions"`
Role gcpRoleMetadata `json:"customRole" tfsdk:"custom_role"`
CustomRole gcpRoleMetadata `json:"customRole" tfsdk:"custom_role"`
}

type gcpPermissionsMetadataWithPredefinedRole struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type gcpIamAssessmentStagedApi struct {
Item struct {
State string `json:"state"`
} `json:"item"`
Metadata gcpPermissionsMetadataWithPredefinedRole `json:"metadata"`
Metadata gcpPermissionsMetadata `json:"metadata"`
}

func (r *GcpIamAssessmentStaged) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
Expand Down

0 comments on commit fc52cca

Please sign in to comment.