@@ -186,6 +186,7 @@ func (r *customDomainResource) Create(ctx context.Context, req resource.CreateRe
186186 if resp .Diagnostics .HasError () {
187187 return
188188 }
189+ ctx = core .InitProviderContext (ctx )
189190 projectId := model .ProjectId .ValueString ()
190191 ctx = tflog .SetField (ctx , "project_id" , projectId )
191192 distributionId := model .DistributionId .ValueString ()
@@ -207,6 +208,8 @@ func (r *customDomainResource) Create(ctx context.Context, req resource.CreateRe
207208 core .LogAndAddError (ctx , & resp .Diagnostics , "Error creating CDN custom domain" , fmt .Sprintf ("Calling API: %v" , err ))
208209 return
209210 }
211+ ctx = core .LogResponse (ctx )
212+
210213 _ , err = wait .CreateCDNCustomDomainWaitHandler (ctx , r .client , projectId , distributionId , name ).SetTimeout (5 * time .Minute ).WaitWithContext (ctx )
211214 if err != nil {
212215 core .LogAndAddError (ctx , & resp .Diagnostics , "Error creating CDN custom domain" , fmt .Sprintf ("Waiting for create: %v" , err ))
@@ -240,6 +243,7 @@ func (r *customDomainResource) Read(ctx context.Context, req resource.ReadReques
240243 return
241244 }
242245
246+ ctx = core .InitProviderContext (ctx )
243247 projectId := model .ProjectId .ValueString ()
244248 ctx = tflog .SetField (ctx , "project_id" , projectId )
245249 distributionId := model .DistributionId .ValueString ()
@@ -248,7 +252,6 @@ func (r *customDomainResource) Read(ctx context.Context, req resource.ReadReques
248252 ctx = tflog .SetField (ctx , "name" , name )
249253
250254 customDomainResp , err := r .client .GetCustomDomain (ctx , projectId , distributionId , name ).Execute ()
251-
252255 if err != nil {
253256 var oapiErr * oapierror.GenericOpenAPIError
254257 // n.b. err is caught here if of type *oapierror.GenericOpenAPIError, which the stackit SDK client returns
@@ -261,6 +264,8 @@ func (r *customDomainResource) Read(ctx context.Context, req resource.ReadReques
261264 core .LogAndAddError (ctx , & resp .Diagnostics , "Error reading CDN custom domain" , fmt .Sprintf ("Calling API: %v" , err ))
262265 return
263266 }
267+ ctx = core .LogResponse (ctx )
268+
264269 err = mapCustomDomainResourceFields (customDomainResp , & model )
265270 if err != nil {
266271 core .LogAndAddError (ctx , & resp .Diagnostics , "Error reading CDN custom domain" , fmt .Sprintf ("Processing API payload: %v" , err ))
@@ -283,6 +288,7 @@ func (r *customDomainResource) Update(ctx context.Context, req resource.UpdateRe
283288 return
284289 }
285290
291+ ctx = core .InitProviderContext (ctx )
286292 projectId := model .ProjectId .ValueString ()
287293 ctx = tflog .SetField (ctx , "project_id" , projectId )
288294 distributionId := model .DistributionId .ValueString ()
@@ -305,6 +311,7 @@ func (r *customDomainResource) Update(ctx context.Context, req resource.UpdateRe
305311 core .LogAndAddError (ctx , & resp .Diagnostics , "Error updating CDN custom domain certificate" , fmt .Sprintf ("Calling API: %v" , err ))
306312 return
307313 }
314+ ctx = core .LogResponse (ctx )
308315
309316 _ , err = wait .CreateCDNCustomDomainWaitHandler (ctx , r .client , projectId , distributionId , name ).SetTimeout (5 * time .Minute ).WaitWithContext (ctx )
310317 if err != nil {
@@ -338,6 +345,7 @@ func (r *customDomainResource) Delete(ctx context.Context, req resource.DeleteRe
338345 return
339346 }
340347
348+ ctx = core .InitProviderContext (ctx )
341349 projectId := model .ProjectId .ValueString ()
342350 ctx = tflog .SetField (ctx , "project_id" , projectId )
343351 distributionId := model .DistributionId .ValueString ()
@@ -349,6 +357,7 @@ func (r *customDomainResource) Delete(ctx context.Context, req resource.DeleteRe
349357 if err != nil {
350358 core .LogAndAddError (ctx , & resp .Diagnostics , "Delete CDN custom domain" , fmt .Sprintf ("Delete custom domain: %v" , err ))
351359 }
360+ ctx = core .LogResponse (ctx )
352361 _ , err = wait .DeleteCDNCustomDomainWaitHandler (ctx , r .client , projectId , distributionId , name ).WaitWithContext (ctx )
353362 if err != nil {
354363 core .LogAndAddError (ctx , & resp .Diagnostics , "Delete CDN custom domain" , fmt .Sprintf ("Waiting for deletion: %v" , err ))
0 commit comments