-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New CF Logical IDs #1951
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
New CF Logical IDs #1951
Conversation
|
Wow @eahefnawy great job! 🎉 👍 Also love the guideline on how to test it! 💥 ❤️ it. I had some problems with the outputs of the Edit: Looked through the source code and added some minor comments. |
| normalizedAuthorizerName}LambdaPermissionApiGateway`; | ||
|
|
||
| const newAuthPermissionObject = { | ||
| const newAuthrizerPermissionObject = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
authOrizer
|
@pmuens that error is intended and is because you can't add ObjectCreated twice through S3 in Cloudformation. If you want two functions to react to the same S3 event you need to push the event into SNS and then read it from SNS (I had the same issue and looked it up :D ) |
|
@eahefnawy Can you check out the CORS stuff as well, the naming there isn't correct yet:
Here's a link to the issue with the bug: #1960 |
|
Damn! Good catch @flomotlik! functions:
hello:
handler: handler.hello
events:
- s3: serverless-logical-id-test
- schedule: rate(10 minutes)
- http:
path: users
method: get
- http:
path: users
method: post
- sns: topic-name
world:
handler: handler.world
events:
- http:
path: users/{number}
method: post
- sns: topic-name
- s3:
bucket: serverless-logical-id-test
event: s3:ObjectRemoved:* |
|
|
|
|
|
When doing that could we also update the corresponding template file names (e.g. here: https://github.com/serverless/serverless/tree/master/lib/plugins/aws/deploy/compile/functions). So e.g.
|
|
@pmuens Really good catch! I was worried I'd miss something like that :) I just made all the updates mentioned above, and I'm now looking into the CORS bug. Will keep you posted. |
| const unzippedFileData = unzippedData.files; | ||
|
|
||
| // binary file is set with chmod of 777 | ||
| console.log(unzippedFileData['bin/some-binary']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is probably on accident still here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Faced the same today while reviewing it. Should be resolved with 8464954 as otherwise the linter will bark loud 🐶 .
|
Will the base names be documented as part of this PR? I can see them in #1931 but it would be helpful to have them in the docs so that they can be referenced in custom resources. |
|
@rowanu yup definitely! |
a8a3a4d to
e037724
Compare
|
Used the following configuration and the deployment and update failed on it. Please test with it and make sure it works before going further. |
|
There is also a problem with updating an existing service as the the Code is only looking for the new deployment bucket and ignoring the old one. Adding the following to lib/plugins/aws/index.js makes it possible to detect the correct bucket, but still fails in other places. Please take a look so its possible to deploy on top of an existing service/bucket as well. |
|
how can create an event to already exist Bucket with CF ? |

This PR redesigns all of our CF logical IDs as described here. It also fixes lots of bugs related to logical IDs.
This PR resolves the following Issues:
Progress:
Generated Logical IDs
For this
serverless.yml:These logical IDs are generated:

Validating S3/SNS Deployment
serverless invoke -f hello-> invoke the function to make sure it's deployedserverless logs -f hello-> you'll see that the function was invokedserverless logs -f hello-> you'll see that the function was invoked againserverless logs -f hello-> you'll see that the function was invoked again@serverless/core Feel free to review