in src/lambda/ecr/lambda.py [0:0]
def create(repo, props, event, context):
# use existing repository if available, otherwise create
try:
ecr.create_repository(repositoryName=repo)
wait(repo, "exists")
put_lifecycle_policy(repo, props)
except ecr.exceptions.RepositoryAlreadyExistsException:
print(f"Repository '{repo}' already exists - CREATE ECR repository ignored")
put_lifecycle_policy(repo, props)
except Exception as e:
send(event, context, FAILED, None)
raise(e)