Comments (10)
Assuming I'm looking at the right code, it's not obvious why this happens:
The above code seems to add each resource to the same statement (although without any deduping based on the resource, from what I can see). I don't see how we end up getting multiple statements.
from serverless.
Could it be that CloudFormation (perhaps when doing an incremental deployment) appends rather than overwrites the policy?
from serverless.
The IAM policy editor shows "Suggestions: Redundant Statement", so it agrees these statements are redundant.
from serverless.
Manually deleting all sections containing dynamodb:GetRecords
except one, followed by a redeploy didn't recreate all those sections. This suggests that this perhaps has to do with either something that happened in an earlier serverless version or something that has to do with incremental updates of some sort.
from serverless.
My workaround from #12313 (comment) no longer works. I'm not sure why it ever did. Deploys are now completely blocked due to the number of dynamodb:GetRecords
statements in the lambdaRole
.
This is a rather serious problem. Our serverless stack is no longer deployable and we need to consider rather undesirable workarounds, like manually merging Lambdas to reduce the size of the IAM document.
from serverless.
I tried a workaround by using a custom role, however that doesn't help as the default lambdaRole
policy still contains a copy of dynamodb:GetRecords
and friends, even if the lambda doesn't use the default role.
from serverless.
I've updated to the latest version and confirmed the problem persists there:
Framework Core: 3.38.0 (local) 3.38.0 (global)
Plugin: 7.2.0
SDK: 4.5.1
from serverless.
Upon reading the code again it's clear what's going on. We're adding the same statement (in particular, the same list of allowed actions) for each event stream processing function. This is unnecessary and only the list of resources needs to be updated per function. Fix: #12320
from serverless.
We're currently running a patched version of serverless to be able to deploy to production due to this bug. Could someone please take a look at the provided PR with the fix?
from serverless.
This is a production blocking issue for larger scale users of serverless with a simple fix provided as a PR. Could someone please take a look?
from serverless.
Related Issues (20)
- Error: Internal Server Error at Authentication.getClientDataFromAccessKey HOT 4
- MFA is not working with sls offline HOT 4
- Failed to construct URL with https://ssm.${param:region}.amazonaws.com TypeError: Invalid URL HOT 4
- Feature Request: AWS DynamoDB Accelerator (DAX) Support in Serverless Framework
- Allow Serverless Dev to work with Apollo Server AWS_PROXY integration. HOT 1
- AWS Lambda Python 3.9 and above
- Local invoke tries to pull images that are no longer supported. Swap to pulling from aws images insteadof lambci.
- "EMFILE: too many open files" while running serverless deploy on Windows HOT 4
- Build override package Pattern V4 HOT 4
- Serverless V4 esbuild not including files that are not mentioned in the serverless config like utils and helper files HOT 3
- v4 opt:region var default value not resolved on deploy HOT 5
- Temporary artifact source name collision HOT 3
- [V4] Parameters defined in global stages property not loading when used in custom property HOT 3
- env files not loading based on the stage HOT 3
- Serverless V4 `npm i` is not working after following CONTRIBUTING.md HOT 4
- Serverless V4 fails to resolve default when parameter is not found HOT 9
- Cannot Deploy Lambda Functions as Containers in China AWS -- Image.uri does not match pattern regex
- serverless deploy hangs when using `--verbose` and `disableRollback: true`
- LIft: `Provider construct is not supported` error HOT 7
- V4 cannot deploy using --package option if working directory absolute path doesn't exactly match directory where package --package command is run HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serverless.