SAM Deploy failed to create a lambda function

0

Steps to Reproduce this issue:

Visual Studio Code & AWS ToolKit to deploy a Lambda function ( Python based ) to us-east-1. I was using a IAM user ( not an admin ) that has following the managed policies attached to my IAM user

  • IAMFullAccess
  • AmazonSNSFullAccess
  • AmazonSQSFullAccess
  • AmazonS3FullAccess
  • AWSCloudFormationFullAccess
  • AWSLambda_FullAccess

Observed:

Observed the following error and the CFN deployment was rolledback

2022-11-04 18:42:26 UTC-0700 ServerlessRestApi CREATE_FAILED User: arn:aws:iam::XXXXXXXXXXXXXXXXX:user/demo-test is not authorized to perform: apigateway:POST on resource: arn:aws:apigateway:us-east-1::/restapis because no identity-based policy allows the apigateway:POST action (Service: AmazonApiGateway; Status Code: 403; Error Code: AccessDeniedException; Request ID: 6f0eef1d-14c4-4e53-a972-4ca3d21cf256; Proxy: null)

Ask:

  1. Can you please help me on how I should interpret this error and what specific permission / policy change that I need to do to get myself unblocked.
  2. Any AWS Console tools in IAM like Access Advisor that could help me review the access logs / audit trials and suggest me what specific managed policy that I need to attach or which inline policy fragment that I need to attach to this user?.

Any references and guidance on how to fix this issue would be very helpful

Thanks!

1개 답변
1

You need permissions to create all the elements in the SAM template, the permisions that out need depends on the elements that you are trying to create.

Right now It's failing due lack of permissions to create de apigateway. Consider add AmazonAPIGatewayAdministrator permissions. As workaround maybe you can try to use the Lambda without API Garteway, using Lambda function URLs https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html

답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠