serverless / examples

Serverless Examples – A collection of boilerplates and examples of serverless architectures built with the Serverless Framework on AWS Lambda, Microsoft Azure, Google Cloud Functions, and more.
https://www.serverless.com/examples/
Other
11.45k stars 4.47k forks source link

getting 403 error during deployment (not able to create lamba function) while using stripe example #638

Closed kirthiss closed 3 years ago

kirthiss commented 3 years ago

example: aws-node-stripe-integration error: `Serverless: Packaging service... Serverless: Excluding development dependencies... Serverless: Creating Stack... Serverless: Checking Stack create progress... ........ Serverless: Stack create finished... Serverless: Uploading CloudFormation file to S3... Serverless: Uploading artifacts... Serverless: Uploading service aws-node-stripe-integration.zip file to S3 (567.36 KB)... Serverless: Validating template... Serverless: Updating Stack... Serverless: Checking Stack update progress... .................... Serverless: Operation failed! Serverless: View the full error output: https://ap-south-1.console.aws.amazon.com/cloudformation/home?region=ap-south-1#/stack/detail?stackId=arn%3Aaws%3Acloudformation%3Aap-south-1%3A263089580701%3Astack%2Faws-node-stripe-integration-dev2%2F312d4770-f2dc-11eb-86dd-06777a0f3b80

Serverless Error ----------------------------------------

An error occurred: IncomingLambdaFunction - Resource handler returned message: "null (Service: Lambda, Status Code: 403, Request ID: 5cd73a06-d0ac-4bc2-b23b-1e96decc9755, Extended Request ID: null)" (RequestToken: 6a65bb5c-f366-2463-f6a3-7f5e0487f25c, HandlerErrorCode: AccessDenied).

Get Support -------------------------------------------- Docs: docs.serverless.com Bugs: github.com/serverless/serverless/issues Issues: forum.serverless.com

Your Environment Information --------------------------- Operating System: linux Node Version: 14.17.3 Framework Version: 2.52.1 Plugin Version: 5.4.3 SDK Version: 4.2.6 Components Version: 3.14.2

Serverless: Deprecation warnings:

Support for "package.include" and "package.exclude" will be removed with next major release. Please use "package.patterns" instead More Info: https://www.serverless.com/framework/docs/deprecations/#NEW_PACKAGE_PATTERNS

Resolution of lambda version hashes was improved with better algorithm, which will be used in next major release. Switch to it now by setting "provider.lambdaHashingVersion" to "20201221" More Info: https://www.serverless.com/framework/docs/deprecations/#LAMBDA_HASHING_VERSION_V2`

any thoughts? I'm not able to deploy the function at all...

pgrzesik commented 3 years ago

Hello @kirthiss - I've tested it and I was able to deploy it without any issues. Are you sure that AWS credentials that you're using don't have limited capabilities that doesn't allow you to deploy?

kirthiss commented 3 years ago

Hello @kirthiss - I've tested it and I was able to deploy it without any issues. Are you sure that AWS credentials that you're using don't have limited capabilities that doesn't allow you to deploy?

I checked that. The deployment fails while creating lamba function. I was able to create one manually. I also gave admin permission to the serverless role.

pgrzesik commented 3 years ago

Are you able to share what permissions does your role/user has?

kirthiss commented 3 years ago

I removed all prior resources and started afresh - and it worked. Thanks, @pgrzesik for helping out. Sorry for the trouble...

pgrzesik commented 3 years ago

No worries, happy to hear that you managed to make it work :raised_hands: I'm going to close this issue