@@ -28,6 +28,8 @@ func init() {
2828 "A private_key or a private_key_path must be provided." ,
2929 "private_key_password" : "(Optional) The password used to secure the private key." ,
3030 "region" : "(Optional) The region for API connections." ,
31+ "disable_auto_retries" : "(Optional) Disable Automatic retries for retriable errors.\n " +
32+ "Auto retries were introduced to solve some eventual consistency problems but it also introduced performance issues on destroy operations." ,
3133 }
3234}
3335
@@ -91,6 +93,13 @@ func schemaMap() map[string]*schema.Schema {
9193 Description : descriptions ["region" ],
9294 DefaultFunc : schema .EnvDefaultFunc ("OBMCS_REGION" , nil ),
9395 },
96+ "disable_auto_retries" : {
97+ Type : schema .TypeBool ,
98+ Optional : true ,
99+ Default : false ,
100+ Description : descriptions ["disable_auto_retries" ],
101+ DefaultFunc : schema .EnvDefaultFunc ("OBMCS_DISABLE_AUTO_RETRIES" , nil ),
102+ },
94103 }
95104}
96105
@@ -219,6 +228,7 @@ func providerConfig(d *schema.ResourceData) (client interface{}, err error) {
219228 privateKeyPath , hasKeyPath := d .Get ("private_key_path" ).(string )
220229 privateKeyPassword , hasKeyPass := d .Get ("private_key_password" ).(string )
221230 region , hasRegion := d .Get ("region" ).(string )
231+ disableAutoRetries , hasDisableRetries := d .Get ("disable_auto_retries" ).(bool )
222232
223233 // for internal use
224234 urlTemplate := getEnvSetting ("url_template" , "" )
@@ -258,6 +268,10 @@ func providerConfig(d *schema.ResourceData) (client interface{}, err error) {
258268 clientOpts = append (clientOpts , baremetal .Region (region ))
259269 }
260270
271+ if hasDisableRetries {
272+ clientOpts = append (clientOpts , baremetal .DisableAutoRetries (disableAutoRetries ))
273+ }
274+
261275 if urlTemplate != "" {
262276 clientOpts = append (clientOpts , baremetal .UrlTemplate (urlTemplate ))
263277 }
0 commit comments