Skip to content

Commit

Permalink
Added a case when there is no Role associated with instanceProfile.
Browse files Browse the repository at this point in the history
  • Loading branch information
kuredev authored and YakDriver committed Mar 27, 2024
1 parent 9ec5e15 commit 846ca63
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/service/iam/instance_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ func resourceInstanceProfileRead(ctx context.Context, d *schema.ResourceData, me
d.Set("path", instanceProfile.Path)
if len(instanceProfile.Roles) > 0 {
d.Set("role", instanceProfile.Roles[0].RoleName) //there will only be 1 role returned
} else if d.Get("role") != "" {
d.Set("role", nil)
}
d.Set("unique_id", instanceProfile.InstanceProfileId)

Expand Down

0 comments on commit 846ca63

Please sign in to comment.