def remote_update_alias(self, **kwargs):
conf = kwargs
try:
logger.info("Update alias {} for function {}"
" with version {}".format(conf["Name"],
conf["FunctionName"],
conf["FunctionVersion"]))
response = self.awslambda.update_alias(**conf)
except ClientError as e:
if e.response['Error']['Code'] == "ResourceNotFoundException":
logger.info("Alias {} not exist for function {}. "
"Creating new one with version {}".format(conf["Name"],
conf["FunctionName"],
conf["FunctionVersion"]))
response = self.awslambda.create_alias(**conf)
else:
# TODO: handle other errors there
pass
return response
评论列表
文章目录