Skip to content

Commit a7170a1

Browse files
Deploy template bulk (#323)
* bulk templates * bulk templates 2 * bulk templates 3 * add definition changes * change to set implement redeploy logic * docs fix * read always as never to bump apply * Update resource_catalystcenter_deploy_template.go * Update resource_catalystcenter_deploy_template.go
1 parent 58053c3 commit a7170a1

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

internal/provider/resource_catalystcenter_deploy_template.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,20 @@ func (r *DeployTemplateResource) Read(ctx context.Context, req resource.ReadRequ
313313
return
314314
}
315315

316+
// read always as on_change to create drift and push template every apply
317+
for i, s := range state.TargetInfo {
318+
if s.Redeploy.ValueString() == "ALWAYS" {
319+
state.TargetInfo[i].Redeploy = types.StringValue("NEVER")
320+
}
321+
}
322+
for i, s := range state.MemberTemplateDeploymentInfo {
323+
for k, d := range s.TargetInfo {
324+
if d.Redeploy.ValueString() == "ALWAYS" {
325+
state.MemberTemplateDeploymentInfo[i].TargetInfo[k].Redeploy = types.StringValue("NEVER")
326+
}
327+
}
328+
}
329+
316330
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Id.String()))
317331

318332
tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Id.ValueString()))

0 commit comments

Comments
 (0)