Skip to content

Commit 0c8623b

Browse files
[datadog_authn_mapping] Read team assignment when importing AuthN mappings (#2686)
* Attempt to read team mapping from AuthN response * Add import test with team * add cassette --------- Co-authored-by: Kevin Zou <[email protected]>
1 parent e547203 commit 0c8623b

File tree

4 files changed

+742
-219
lines changed

4 files changed

+742
-219
lines changed

datadog/resource_datadog_authn_mapping.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ func updateAuthNMappingState(d *schema.ResourceData, authNMapping *datadogV2.Aut
145145
authNMappingAttributes := authNMapping.GetAttributes()
146146
authNMappingRelations := authNMapping.GetRelationships()
147147
authNMappingRoleRelation := authNMappingRelations.GetRole()
148+
authNMappingTeamRelation := authNMappingRelations.GetTeam()
148149
authNRole := authNMappingRoleRelation.GetData()
150+
authNTeam := authNMappingTeamRelation.GetData()
149151

150152
if err := d.Set("key", authNMappingAttributes.GetAttributeKey()); err != nil {
151153
return diag.FromErr(err)
@@ -158,6 +160,11 @@ func updateAuthNMappingState(d *schema.ResourceData, authNMapping *datadogV2.Aut
158160
if err := d.Set("role", authNRole.GetId()); err != nil {
159161
return diag.FromErr(err)
160162
}
163+
164+
if err := d.Set("team", authNTeam.GetId()); err != nil {
165+
return diag.FromErr(err)
166+
}
167+
161168
return nil
162169
}
163170

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2023-03-09T14:35:24.516982-05:00
1+
2024-11-25T12:15:56.971915-05:00

0 commit comments

Comments
 (0)