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

AWS: Request cache should add region as key to prevent cross-region cache collision #5694

Merged
merged 3 commits into from Jan 15, 2019

Conversation

Projects
5 participants
@exoego
Copy link
Contributor

exoego commented Jan 13, 2019

What did you implement:

Closes #5685

How did you implement it:

Now AWS Provider's request cache consider region as a part of cache key.
So ${cf.REGION:stackA.key1} and ${cf.ANOTHER-REGION:stackA.key1} can request separately and does not affect each cache.

How can we verify it:

  1. npm install -g exoego/serverless#cross-region-same-stack-name

  2. Run sls deploy against below: dev-foo to eu-central-1

service: foo
provider:
  name: aws
  region: eu-central-1
  stage: dev
  runtime: nodejs8.10
functions:
  hello:
    handler: handler.hello
resources:
  Outputs:
    foo:
      Value: 123
      Export:
        Name: foo
  1. Run sls deploy against below: dev-foo to us-east-1 (same stack name but different region)
service: foo
provider:
  name: aws
  region: us-east-1
  stage: dev
  runtime: nodejs8.10
functions:
  hello:
    handler: handler.hello
resources:
  Outputs:
    foo:
      Value: 456
      Export:
        Name: foo
  1. Run sls deploy against below: uses ${cf.REGION}
service: bar
provider:
  name: aws
  region: us-east-1
  stage: dev
  runtime: nodejs8.10
functions:
  hello:
    handler: handler.hello
resources:
  Outputs:
    foo1:
      Value: ${cf.eu-central-1:foo-dev.foo}
      Export:
        Name: foo1
    foo2:
      Value: ${cf.us-east-1:foo-dev.foo}
      Export:
        Name: foo2

Todos:

  • Write tests
  • Write documentation
  • Fix linting errors
  • 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

@exoego exoego changed the title AWS: Request cache should consider region for cross-region request AWS: Request cache should add region as key to prevent cross-region cache collision Jan 13, 2019

@pmuens pmuens added the pr/in-review label Jan 15, 2019

@horike37
Copy link
Member

horike37 left a comment

Thank you for this fix @exoego 👍
Just confirmed to fix this bug. LGTM.

@horike37 horike37 merged commit 07154d7 into serverless:master Jan 15, 2019

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.001%) to 90.848%
Details

@exoego exoego deleted the exoego:cross-region-same-stack-name branch Jan 15, 2019

@eahefnawy eahefnawy added this to In progress in Serverless via automation Jan 17, 2019

@eahefnawy eahefnawy moved this from In progress to Reviewer approved in Serverless Jan 17, 2019

@eahefnawy eahefnawy moved this from Reviewer approved to Done in Serverless Jan 17, 2019

@eahefnawy eahefnawy added this to the v1.36.2 milestone Jan 17, 2019

@eahefnawy eahefnawy removed the pr/in-review label Jan 17, 2019

@shortjared shortjared added the bug label Jan 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment