chore(terraform): use a util func to build internal terraform id (#869)
This commit is contained in:
parent
801ef6033d
commit
b313ef6a39
72 changed files with 205 additions and 538 deletions
|
|
@ -420,13 +420,8 @@ func mapFields(ctx context.Context, recordSetResp *dns.RecordSetResponse, model
|
|||
|
||||
model.Records = recordsTF
|
||||
}
|
||||
idParts := []string{
|
||||
model.ProjectId.ValueString(),
|
||||
model.ZoneId.ValueString(),
|
||||
recordSetId,
|
||||
}
|
||||
model.Id = types.StringValue(
|
||||
strings.Join(idParts, core.Separator),
|
||||
model.Id = utils.BuildInternalTerraformId(
|
||||
model.ProjectId.ValueString(), model.ZoneId.ValueString(), recordSetId,
|
||||
)
|
||||
model.RecordSetId = types.StringPointerValue(recordSet.Id)
|
||||
model.Active = types.BoolPointerValue(recordSet.Active)
|
||||
|
|
|
|||
|
|
@ -487,13 +487,7 @@ func mapFields(ctx context.Context, zoneResp *dns.ZoneResponse, model *Model) er
|
|||
return fmt.Errorf("zone id not present")
|
||||
}
|
||||
|
||||
idParts := []string{
|
||||
model.ProjectId.ValueString(),
|
||||
zoneId,
|
||||
}
|
||||
model.Id = types.StringValue(
|
||||
strings.Join(idParts, core.Separator),
|
||||
)
|
||||
model.Id = utils.BuildInternalTerraformId(model.ProjectId.ValueString(), zoneId)
|
||||
|
||||
if z.Primaries == nil {
|
||||
model.Primaries = types.ListNull(types.StringType)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue