How to deploy Lambda NET6 to AWS?

0

I have a Lambda NET6, deploy it from VS2022 and it deployed OK. Then I tried to deploy it via cmd:

dotnet lambda deploy-serverless -sn pm2dicts_stack -sb pm2dicts_bucket --region eu-west-2 -t serverless.template --profile default

it was built, zipped but then I have received the error Created publish archive (C:\Users\qwen\AppData\Local\Temp\AspNetCoreFunction-CodeUri-Or-ImageUri-638283878431414423.zip). Uploading to S3. (Bucket: pm2dicts_bucket Key: AspNetCoreFunction-CodeUri-Or-ImageUri-638283878431414423-638283878579128476.zip) Error uploading to AspNetCoreFunction-CodeUri-Or-ImageUri-638283878431414423-638283878579128476.zip in bucket pm2dicts_bucket: The specified bucket does not exist

How to fix it?

Oleg
asked 9 months ago212 views
2 Answers
0
Accepted Answer

Hi Oleg.

The error states that the command cannot find the S3 bucket. Ensure the deployment specifies the correct bucket name, also, the region where you are deploying should be the region where the bucket is.

Another approach is, if your project already has the deployment configuration, just use dotnet lambda deploy-serverless without any parameters and allow the command use the VS project configuration (since that already works from VS).

Finally, another approach is to capture what VS is doing. Try to look at commands it executes. If I remember correctly there is an option to log the deployment process so you can examine that.

I hope this helps.

profile pictureAWS
EXPERT
answered 9 months ago
profile pictureAWS
EXPERT
reviewed 9 months ago
0

Hello.
I am getting an error that there is no bucket specified, is the name of the S3 bucket specified in the command correct?
Also, make sure regions, etc. are correct.

profile picture
EXPERT
answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions