I am trying to implement lambda waiter to upload my my lambda code. Here is the piece of code that uses waiter:
def update_function_code(config, publish = True):
print('Updating function code')
code_config = {**config['Code'],**{'FunctionName': config['function']['FunctionName'], 'Publish': publish}}
boolean = wait_lambda_active()
print(boolean)
if boolean == True:
response = lambda_client.update_function_code(**code_config)
print('Failure waiting for lambda')
return
response = lambda_client.update_function_code(**code_config)
return True
def wait_lambda_active():
try:
print('Getting waiter for lambda')
print(config['function']['FunctionName'])
waiter = lambda_client.get_waiter('function_active')
waiter.wait(FunctionName =config['function']['FunctionName'],
WaiterConfig={'Delay':delay, 'MaxAttempts':max_attempts})
except Exception as e:
print('Lambda is not in desired state')
print(e)
return False
else:
return True
I still get the error: botocore.errorfactory.ResourceConflictException: An error occurred (ResourceConflictException) when calling the UpdateFunctionCode operation: The operation cannot be performed at this time. An update is in progress for resource: arn:aws:lambda:us-east-1:xxxxxxxxx:function:xxxxxxxxxx
TIA