[6.x] Fix Cache store with a name other than 'dynamodb' #37145
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request partially reverts changes introduced in #36749 (ping @driesvints).
The problem particularly is located here: a20c9e5#diff-5c56e532b7bf21453188f98f7999ed558eff31a6374ebd83c9f811961fde02b1R37
It is forcing applications to reserve the
cache.stores.dynamodb
as the only way to configure an AWS DynamoDb Client instance. If, for instance, we renamedynamodb
in our application to anything else, then theregion
,key
andsecret
won't take effect because it will rely on the DynamoDb Client bound bycache.stores.dynamodb
. The consequences of relying on this binding are:dynamodb
on the cache configuration.dynamodb
cache configurations which are not in the same region / access key / secret key.dynamodb
will still use the region and access configured for thedynamodb
key.By reverting that, we bring control back to users so that they're free to change the skeleton configuration without invisible side effects.
For my particular use-case, I created a Cache Store configuration called
session
and then configured it as follows:This means that access is determined by IAM Role (assume role) instead of key and secret. I also configured
session.store
assession
so that Laravel's Session is managed by the Cache Store calledsession
. This is how I detected the problem.