@@ -193,21 +193,6 @@ func resourceScalewayLbCertificateRead(ctx context.Context, d *schema.ResourceDa
193
193
return diag .FromErr (err )
194
194
}
195
195
196
- // check if cert is on error state
197
- if certificate .Status == lbSDK .CertificateStatusError {
198
- return diag.Diagnostics {
199
- diag.Diagnostic {
200
- Severity : diag .Error ,
201
- Summary : fmt .Sprintf ("certificate %s with error state" , certificate .ID ),
202
- },
203
- }
204
- }
205
-
206
- _ , err = waitForLBCertificate (ctx , lbAPI , zone , certificate .ID , d .Timeout (schema .TimeoutRead ))
207
- if err != nil {
208
- return diag .FromErr (err )
209
- }
210
-
211
196
_ = d .Set ("lb_id" , newZonedIDString (zone , certificate .LB .ID ))
212
197
_ = d .Set ("name" , certificate .Name )
213
198
_ = d .Set ("common_name" , certificate .CommonName )
@@ -217,7 +202,20 @@ func resourceScalewayLbCertificateRead(ctx context.Context, d *schema.ResourceDa
217
202
_ = d .Set ("not_valid_after" , flattenTime (certificate .NotValidAfter ))
218
203
_ = d .Set ("status" , certificate .Status )
219
204
220
- return nil
205
+ diags := diag .Diagnostics (nil )
206
+
207
+ if certificate .Status == lbSDK .CertificateStatusError {
208
+ errDetails := ""
209
+ if certificate .StatusDetails != nil {
210
+ errDetails = * certificate .StatusDetails
211
+ }
212
+ diags = append (diags , diag.Diagnostic {
213
+ Severity : diag .Warning ,
214
+ Summary : fmt .Sprintf ("certificate %s with error state" , certificate .ID ),
215
+ Detail : errDetails ,
216
+ })
217
+ }
218
+ return diags
221
219
}
222
220
223
221
func resourceScalewayLbCertificateUpdate (ctx context.Context , d * schema.ResourceData , meta interface {}) diag.Diagnostics {
0 commit comments