Skip to content

Commit

Permalink
Attempt to read team mapping from AuthN response
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-pinola-rf committed Nov 20, 2024
1 parent 1b6c3dd commit 3d637e3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions datadog/resource_datadog_authn_mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ func updateAuthNMappingState(d *schema.ResourceData, authNMapping *datadogV2.Aut
authNMappingAttributes := authNMapping.GetAttributes()
authNMappingRelations := authNMapping.GetRelationships()
authNMappingRoleRelation := authNMappingRelations.GetRole()
authNMappingTeamRelation := authNMappingRelations.GetTeam()
authNRole := authNMappingRoleRelation.GetData()
authNTeam := authNMappingTeamRelation.GetData()

if err := d.Set("key", authNMappingAttributes.GetAttributeKey()); err != nil {
return diag.FromErr(err)
Expand All @@ -158,6 +160,11 @@ func updateAuthNMappingState(d *schema.ResourceData, authNMapping *datadogV2.Aut
if err := d.Set("role", authNRole.GetId()); err != nil {
return diag.FromErr(err)
}

if err := d.Set("team", authNTeam.GetId()); err != nil {
return diag.FromErr(err)
}

return nil
}

Expand Down

0 comments on commit 3d637e3

Please sign in to comment.