Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if more than 1 existing bucket is configured #6506

Merged
merged 1 commit into from Aug 6, 2019

Conversation

pmuens
Copy link
Contributor

@pmuens pmuens commented Aug 6, 2019

What did you implement:

Adds a check if more than 1 S3 bucket is being configured.

Related to changes made in #6491

How did you implement it:

Track S3 bucket names while compiling CloudFormation resources.

How can we verify it:

service: test-${self:custom.idx}

provider:
  name: aws
  runtime: nodejs10.x
  versionFunctions: false

custom:
  idx: 0
  bucket: serverless-existing-s3-bucket

functions:
  created:
    handler: handler.hello
    events:
      - s3:
          bucket: ${self:custom.bucket}
          existing: true
      - s3:
          bucket: ${self:custom.bucket}-2
          existing: true

should throw, while the following doesn't:

service: test-${self:custom.idx}

provider:
  name: aws
  runtime: nodejs10.x
  versionFunctions: false

custom:
  idx: 0
  bucket: serverless-existing-s3-bucket

functions:
  created:
    handler: handler.hello
    events:
      - s3:
          bucket: ${self:custom.bucket}
          existing: true
      - s3:
          bucket: ${self:custom.bucket}
          existing: true

You might also look into the added test case.

Todos:

Note: Run npm run test-ci to run all validation checks on proposed changes

  • Write tests and confirm existing functionality is not broken.
    Validate via npm test
  • Ensure there are no lint errors.
    Validate via npm run lint-updated
    Note: Some reported issues can be automatically fixed by running npm run lint:fix
  • Ensure introduced changes match Prettier formatting.
    Validate via npm run prettier-check-updated
    Note: All reported issues can be automatically fixed by running npm run prettify-updated
  • Make sure code coverage hasn't dropped
  • Provide verification config / commands / resources
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES
Is it a breaking change?: NO

@pmuens pmuens added this to the 1.50.0 milestone Aug 6, 2019
@pmuens pmuens requested a review from medikoo August 6, 2019 11:19
@pmuens pmuens self-assigned this Aug 6, 2019
Copy link
Contributor

@medikoo medikoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@pmuens pmuens merged commit e26d200 into master Aug 6, 2019
@pmuens pmuens deleted the different-s3-buckets branch August 6, 2019 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants