@@ -23,6 +23,9 @@ func resourceScalewayVPCPublicGatewayPATRule() *schema.Resource {
2323 StateContext : schema .ImportStatePassthroughContext ,
2424 },
2525 SchemaVersion : 0 ,
26+ Timeouts : & schema.ResourceTimeout {
27+ Default : schema .DefaultTimeout (gatewayWaitForTimeout ),
28+ },
2629 Schema : map [string ]* schema.Schema {
2730 "gateway_id" : {
2831 Type : schema .TypeString ,
@@ -91,7 +94,7 @@ func resourceScalewayVPCPublicGatewayPATRuleCreate(ctx context.Context, d *schem
9194 _ , err = vpcgwAPI .WaitForGateway (& vpcgw.WaitForGatewayRequest {
9295 GatewayID : gatewayID ,
9396 Zone : zone ,
94- Timeout : scw .TimeDurationPtr (gatewayWaitForTimeout ),
97+ Timeout : scw .TimeDurationPtr (d . Timeout ( schema . TimeoutCreate ) ),
9598 RetryInterval : & retryInterval ,
9699 }, scw .WithContext (ctx ))
97100 if err != nil {
@@ -116,7 +119,7 @@ func resourceScalewayVPCPublicGatewayPATRuleCreate(ctx context.Context, d *schem
116119 _ , err = vpcgwAPI .WaitForGateway (& vpcgw.WaitForGatewayRequest {
117120 GatewayID : res .GatewayID ,
118121 Zone : zone ,
119- Timeout : scw .TimeDurationPtr (gatewayWaitForTimeout ),
122+ Timeout : scw .TimeDurationPtr (d . Timeout ( schema . TimeoutCreate ) ),
120123 RetryInterval : & retryInterval ,
121124 }, scw .WithContext (ctx ))
122125 if err != nil {
@@ -178,7 +181,7 @@ func resourceScalewayVPCPublicGatewayPATRuleUpdate(ctx context.Context, d *schem
178181 _ , err = vpcgwAPI .WaitForGateway (& vpcgw.WaitForGatewayRequest {
179182 GatewayID : patRules .GatewayID ,
180183 Zone : zone ,
181- Timeout : scw .TimeDurationPtr (gatewayWaitForTimeout ),
184+ Timeout : scw .TimeDurationPtr (d . Timeout ( schema . TimeoutUpdate ) ),
182185 RetryInterval : & retryInterval ,
183186 }, scw .WithContext (ctx ))
184187 if err != nil {
@@ -233,7 +236,7 @@ func resourceScalewayVPCPublicGatewayPATRuleDelete(ctx context.Context, d *schem
233236 _ , err = vpcgwAPI .WaitForGateway (& vpcgw.WaitForGatewayRequest {
234237 GatewayID : patRules .GatewayID ,
235238 Zone : zone ,
236- Timeout : scw .TimeDurationPtr (gatewayWaitForTimeout ),
239+ Timeout : scw .TimeDurationPtr (d . Timeout ( schema . TimeoutDelete ) ),
237240 RetryInterval : & retryInterval ,
238241 }, scw .WithContext (ctx ))
239242
@@ -253,7 +256,7 @@ func resourceScalewayVPCPublicGatewayPATRuleDelete(ctx context.Context, d *schem
253256 _ , err = vpcgwAPI .WaitForGateway (& vpcgw.WaitForGatewayRequest {
254257 GatewayID : patRules .GatewayID ,
255258 Zone : zone ,
256- Timeout : scw .TimeDurationPtr (gatewayWaitForTimeout ),
259+ Timeout : scw .TimeDurationPtr (d . Timeout ( schema . TimeoutDelete ) ),
257260 RetryInterval : & retryInterval ,
258261 }, scw .WithContext (ctx ))
259262
0 commit comments