AWS Lambda deployment: Unable to determine region for bucket

0

I am working on Lambda (NET6) project When I run the command in Github Actions I receive the error: `Run dotnet lambda deploy-serverless Amazon Lambda Tools for .NET Core applications (5.7.0) Project Home: https://github.com/aws/aws-extensions-for-dotnet-cli, https://github.com/aws/aws-lambda-dotnet

Enter CloudFormation Stack Name: (CloudFormation stack name for an AWS Serverless application) Enter CloudFormation Template: (Path to the CloudFormation template) Enter S3 Bucket: (S3 bucket to upload the build output) Warning: Unable to determine region for bucket , assuming bucket is in correct region: BucketName is a required property and must be set before making this call. (Parameter 'GetBucketLocationRequest.BucketName') Unknown error executing command: Value cannot be null. (Parameter 'path2') at System.IO.Path.Combine(String path1, String path2) at Amazon.Lambda.Tools.Commands.DeployServerlessCommand.PerformActionAsync() in C:\build\src\Amazon.Lambda.Tools\Commands\DeployServerlessCommand.cs:line 145 at Amazon.Common.DotNetCli.Tools.Commands.BaseCommand1.ExecuteAsync() in C:\build\src\Amazon.Common.DotNetCli.Tools\Commands\BaseCommand.cs:line 47 Error: Process completed with exit code 255.

What should I fix?

Oleg
asked a year ago531 views
2 Answers
0

Hi, based on https://github.com/aws/aws-lambda-dotnet/issues/262 s3:GetBucketLocation may be missing in the auths that you've currently defined

profile pictureAWS
EXPERT
answered a year ago
  • Ok, where can I check the s3:GetBucketLocation?

  • I have checked via CMD:

    aws s3api get-bucket-location --bucket my-bucket

    An error occurred (AllAccessDisabled) when calling the GetBucketLocation operation: All access to this object has been disabled

0

I have added new Policy for my account { "Version": "2012-10-17", "Statement": [ { "Sid": "statement1", "Effect": "Allow", "Action": [ "s3:CreateBucket", "s3:ListAllMyBuckets", "s3:GetBucketLocation" ], "Resource": [ "arn:aws:s3:::*" ] } ] }

then run deployment again but the same error occured

Oleg
answered a year 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