From 0efb53fb551488340af2508364651e1a582ddd41 Mon Sep 17 00:00:00 2001 From: Maurizio Pillitu Date: Tue, 11 Feb 2020 11:43:39 +0100 Subject: [PATCH] Avoid "GitlabClaBotLoggingBucket already exists" The `serverless deploy` command always fails (except the first time) with the error: ``` An error occurred: GitlabClaBotLoggingBucket - finos-gitlab-cla-bot-logs already exists. ``` Using https://www.npmjs.com/package/serverless-plugin-existing-s3 to work around the issue --- serverless.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/serverless.yml b/serverless.yml index 49727c8..49dccaa 100644 --- a/serverless.yml +++ b/serverless.yml @@ -22,11 +22,8 @@ functions: handler: handler: src/index.Handler events: + - existingS3: + bucket: ${self:custom.loggingBucketName} + events: + - s3:* - http: POST handler - -resources: - Resources: - GitlabClaBotLoggingBucket: - Type: AWS::S3::Bucket - Properties: - BucketName: ${self:custom.loggingBucketName} \ No newline at end of file