S3 create bucket fails


I’m trying to create a serverless project which deploys a CloudFormation and as a part of that it tries to create an S3 bucket. But this fails due to following error:

I’ve tried to create an S3 bucket with command aws s3api create-bucket --bucket my-bucket --region us-west-2 which successfully creates the bucket. I’m not sure why I’m getting access denied while creating the S3 bucket via serverless. What could be the issue here?

Here’s my serverless.yml file

I deploy the service using $serverless deploy
Also, content of ~/.aws/credentials

Which I got by running

$ aws sts get-session-token --serial-number arn:aws:iam::<number>:mfa/<username> --token-code 123456


Your process role will need IAM permission, either at the role or at the user level, depending on your implementation.

Assuming you want the process to create and have all permisions to the bucket, you would need something like this:

Leave a Reply