Could not locate deployment bucket. Error: Access Denied
See original GitHub issueBug Report
Description
-
What did you do? I created a Serverless project and when I try to deploy it, I get the error: “Could not locate deployment bucket. Error: Access Denied”
-
What happened? I get the error “Could not locate deployment bucket. Error: Access Denied”
-
What should’ve happened? It should have deployed correctly and should have access to the bucket. I’m using the credentials of an account with Administrator access.
-
What’s the content of your
serverless.yml
file? `service: fel360-api
provider: name: aws runtime: nodejs12.x stage: v1 region: us-west-2 memorySize: 128 deploymentBucket: name: fel360-lambdas iamRoleStatements: - Effect: ‘Allow’ Action: - ‘lambda:InvokeFunction’ - ‘ses:SendTemplatedEmail’ - ‘ses:SendRawEmail’ - ‘s3:GetObject’ - ‘s3:GetObjectAcl’ - ‘s3:PutObject’ - ‘s3:PutObjectAcl’ - ‘s3:DeleteObject’ - ‘s3:ListBucket’ Resource: - ‘*’
package: excludeDevDependencies: false individually: true exclude: - ‘*/**’
functions: ${file(./serverless-config/functions.yml)}`
- What’s the output you get when you use the
SLS_DEBUG=*
environment variable (e.g.SLS_DEBUG=* serverless deploy
) `Serverless: Load command interactiveCli Serverless: Load command config Serverless: Load command config:credentials Serverless: Load command create Serverless: Load command install Serverless: Load command package Serverless: Load command deploy Serverless: Load command deploy:function Serverless: Load command deploy:list Serverless: Load command deploy:list:functions Serverless: Load command invoke Serverless: Load command invoke:local Serverless: Load command info Serverless: Load command logs Serverless: Load command metrics Serverless: Load command print Serverless: Load command remove Serverless: Load command rollback Serverless: Load command rollback:function Serverless: Load command slstats Serverless: Load command plugin Serverless: Load command plugin Serverless: Load command plugin:install Serverless: Load command plugin Serverless: Load command plugin:uninstall Serverless: Load command plugin Serverless: Load command plugin:list Serverless: Load command plugin Serverless: Load command plugin:search Serverless: Load command config Serverless: Load command config:credentials Serverless: Load command rollback Serverless: Load command rollback:function Serverless: Load command upgrade Serverless: Load command uninstall Serverless: Load command login Serverless: Load command logout Serverless: Load command generate-event Serverless: Load command test Serverless: Load command dashboard Serverless: Invoke deploy Serverless: Invoke package Serverless: Invoke aws:common:validate Serverless: Invoke aws:common:cleanupTempDir Serverless: Packaging service… Serverless: Invoke aws📦finalize Serverless: Invoke aws:common:moveArtifactsToPackage Serverless: Invoke aws:common:validate Serverless: [AWS s3 403 0.579s 0 retries] getBucketLocation({ Bucket: ‘fel360-lambdas’ })
Serverless Error ---------------------------------------
ServerlessError: Could not locate deployment bucket. Error: Access Denied at BbPromise.resolve.then.then.catch.err (C:\Users\bryan\AppData\Roaming\npm\node_modules\serverless\lib\plugins\aws\deploy\lib\existsDeploymentBucket.js:25:15) From previous event: at AwsDeploy.existsDeploymentBucket (C:\Users\bryan\AppData\Roaming\npm\node_modules\serverless\lib\plugins\aws\deploy\lib\existsDeploymentBucket.js:24:13) at AwsDeploy.BbPromise.bind.then.then (C:\Users\bryan\AppData\Roaming\npm\node_modules\serverless\lib\plugins\aws\deploy\index.js:73:27) From previous event: at Object.before:deploy:deploy [as hook] (C:\Users\bryan\AppData\Roaming\npm\node_modules\serverless\lib\plugins\aws\deploy\index.js:70:12) at BbPromise.reduce (C:\Users\bryan\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:490:55) From previous event: at PluginManager.invoke (C:\Users\bryan\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:490:22) at getHooks.reduce.then (C:\Users\bryan\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:525:24) From previous event: at PluginManager.run (C:\Users\bryan\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:525:8) at variables.populateService.then (C:\Users\bryan\AppData\Roaming\npm\node_modules\serverless\lib\Serverless.js:133:33) at runCallback (timers.js:810:20) at tryOnImmediate (timers.js:768:5) at processImmediate [as _immediateCallback] (timers.js:745:5) From previous event: at Serverless.run (C:\Users\bryan\AppData\Roaming\npm\node_modules\serverless\lib\Serverless.js:120:74) at serverless.init.then (C:\Users\bryan\AppData\Roaming\npm\node_modules\serverless\bin\serverless.js:75:30) at C:\Users\bryan\AppData\Roaming\npm\node_modules\serverless\node_modules\graceful-fs\graceful-fs.js:111:16 at C:\Users\bryan\AppData\Roaming\npm\node_modules\serverless\node_modules\graceful-fs\graceful-fs.js:45:10 at FSReqWrap.oncomplete (fs.js:135:15) From previous event: at initializeErrorReporter.then (C:\Users\bryan\AppData\Roaming\npm\node_modules\serverless\bin\serverless.js:75:8) at runCallback (timers.js:810:20) at tryOnImmediate (timers.js:768:5) at processImmediate [as _immediateCallback] (timers.js:745:5) From previous event: at Object.<anonymous> (C:\Users\bryan\AppData\Roaming\npm\node_modules\serverless\bin\serverless.js:64:4) at Module._compile (module.js:653:30) at Object.Module._extensions…js (module.js:664:10) at Module.load (module.js:566:32) at tryModuleLoad (module.js:506:12) at Function.Module._load (module.js:498:3) at Function.Module.runMain (module.js:694:10) at startup (bootstrap_node.js:204:16) at bootstrap_node.js:625:3
Get Support -------------------------------------------- Docs: docs.serverless.com Bugs: github.com/serverless/serverless/issues Issues: forum.serverless.com
Your Environment Information --------------------------- Operating System: win32 Node Version: 8.12.0 Framework Version: 1.60.5 Plugin Version: 3.2.7 SDK Version: 2.2.1 Components Core Version: 1.1.2 Components CLI Version: 1.4.0`
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (1 by maintainers)
@triluong21 My credentials were actually correct, but I forgot to specify the profile to use in the serverless.yml file, basically you have to add
profile: <profile name>
toprovider
in your serverless.yml@bryanowen7 Thanks