@@ -301,6 +301,11 @@ def generate_s3_backend_config() -> str:
301301 "dynamodb" : get_service_endpoint ("dynamodb" ),
302302 },
303303 }
304+
305+ for arg in sys .argv [1 :]:
306+ if arg .startswith ('-backend-config=' ):
307+ configSplit = arg .split ('=' )[1 :]
308+ configs [configSplit [0 ]] = configSplit [1 ]
304309 # Merge in legacy endpoint configs if not existing already
305310 if is_tf_legacy and backend_config .get ("endpoints" ):
306311 print (
@@ -343,6 +348,8 @@ def generate_s3_backend_config() -> str:
343348 for key , value in sorted (configs .items ()):
344349 if isinstance (value , bool ):
345350 value = str (value ).lower ()
351+ elif value is None :
352+ value = 'null'
346353 elif isinstance (value , dict ):
347354 if key == "endpoints" and is_tf_legacy :
348355 for legacy_endpoint , endpoint in legacy_endpoint_mappings .items ():
@@ -497,6 +504,8 @@ def get_or_create_bucket(bucket_name: str):
497504
498505def get_or_create_ddb_table (table_name : str , region : str = None ):
499506 """Get or create a DynamoDB table with the given name."""
507+ if not table_name :
508+ return False
500509 ddb_client = connect_to_service ("dynamodb" , region = region )
501510 try :
502511 return ddb_client .describe_table (TableName = table_name )
0 commit comments