Closed aristidesneto-bnw closed 2 years ago
On AWS Lambda you shouldn't set an API key explicitly, because the lambda function already has one (with permissions attached to it).
You can read https://www.serverless.com/framework/docs/providers/aws/guide/iam to learn more.
The AWS API key I entered in the .env
file was for access to the bucket I have already created. The .env
file now looks like this, without the credentials:
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=my-bucket
Even though I don't enter the credentials, I get the error I reported above.
The only AWS key I have is the configuration keys in ~/.aws/credentials
.
As an attempt to solve it, I followed the documentation to create the bucket automatically by the lift plugin and I have the same error.
What I don't understand is the AWSAccessKeyId that is displayed in the log, I have no idea where it is.
My serverless.yml
file looks like this:
iam:
role:
statements:
- Effect: Allow
Action: s3:*
Resource:
- 'arn:aws:s3:::my-bucket'
- 'arn:aws:s3:::my-bucket/*'
I do not know what else to do. I'll take a closer look at the link you gave me in the documentation.
Hi, I'm using an S3 bucket to save files from Laravel application uploads. When trying to upload the file, I get the following error:
The problem in this case is that the second error says that the access key is invalid. I don't know where he gets this key from, it's not the key I inform in the
.env
file.What is this key that it displays in the error:
<AWSAccessKeyId>ASIAZ7N74ORBT6RJ5AAA</AWSAccessKeyId>
? (not the original key that displays on panel, omitted characters).Any idea what it could be? Thanks