@@ -55,7 +55,8 @@ LOCALSTACK_HOSTNAME = (
5555 or os .environ .get ("LOCALSTACK_HOSTNAME" )
5656 or "localhost"
5757)
58- EDGE_PORT = int (urlparse (AWS_ENDPOINT_URL ).port or os .environ .get ("EDGE_PORT" ) or 4566 )
58+ EDGE_PORT = int (
59+ urlparse (AWS_ENDPOINT_URL ).port or os .environ .get ("EDGE_PORT" ) or 4566 )
5960TF_VERSION : Optional [version .Version ] = None
6061TF_PROVIDER_CONFIG = """
6162provider "aws" {
@@ -193,7 +194,8 @@ def create_provider_config_file(provider_file_path: str, provider_aliases=None)
193194 for provider in provider_aliases :
194195 provider_config = TF_PROVIDER_CONFIG .replace (
195196 "<access_key>" ,
196- get_access_key (provider ) if CUSTOMIZE_ACCESS_KEY else DEFAULT_ACCESS_KEY ,
197+ get_access_key (
198+ provider ) if CUSTOMIZE_ACCESS_KEY else DEFAULT_ACCESS_KEY ,
197199 )
198200 endpoints = "\n " .join (
199201 [f' { s } = "{ get_service_endpoint (s )} "' for s in services ]
@@ -341,13 +343,15 @@ def generate_s3_backend_config() -> str:
341343 for k , v in configs ["endpoints" ].items ()
342344 }
343345 backend_config ["access_key" ] = (
344- get_access_key (backend_config ) if CUSTOMIZE_ACCESS_KEY else DEFAULT_ACCESS_KEY
346+ get_access_key (
347+ backend_config ) if CUSTOMIZE_ACCESS_KEY else DEFAULT_ACCESS_KEY
345348 )
346349 configs .update (backend_config )
347350 if not DRY_RUN :
348351 get_or_create_bucket (configs ["bucket" ])
349352 if "dynamodb_table" in configs :
350- get_or_create_ddb_table (configs ["dynamodb_table" ], region = configs ["region" ])
353+ get_or_create_ddb_table (
354+ configs ["dynamodb_table" ], region = configs ["region" ])
351355 result = TF_S3_BACKEND_CONFIG
352356 config_options = ""
353357 for key , value in sorted (configs .items ()):
@@ -556,7 +560,8 @@ def get_or_create_bucket(bucket_name: str):
556560 region = s3_client .meta .region_name
557561 kwargs = {}
558562 if region != "us-east-1" :
559- kwargs = {"CreateBucketConfiguration" : {"LocationConstraint" : region }}
563+ kwargs = {"CreateBucketConfiguration" : {
564+ "LocationConstraint" : region }}
560565 return s3_client .create_bucket (Bucket = bucket_name , ** kwargs )
561566
562567
@@ -570,7 +575,8 @@ def get_or_create_ddb_table(table_name: str, region: str = None):
570575 TableName = table_name ,
571576 BillingMode = "PAY_PER_REQUEST" ,
572577 KeySchema = [{"AttributeName" : "LockID" , "KeyType" : "HASH" }],
573- AttributeDefinitions = [{"AttributeName" : "LockID" , "AttributeType" : "S" }],
578+ AttributeDefinitions = [
579+ {"AttributeName" : "LockID" , "AttributeType" : "S" }],
574580 )
575581
576582
@@ -680,7 +686,8 @@ def main():
680686 if not TF_VERSION :
681687 raise ValueError
682688 except (FileNotFoundError , ValueError ) as e :
683- print (f"Unable to determine version. See error message for details: { e } " )
689+ print (
690+ f"Unable to determine version. See error message for details: { e } " )
684691 exit (1 )
685692
686693 config_override_files = []
0 commit comments