Hello everyone,
When I change Authorization modes on Amplify to Lambda and run a command Amplify push. I have a message error below:
LambdaFunction (AWS::Lambda::Function), Event Type: create, Reason: Resource handler returned message: "Your access has been denied by S3, please make sure your request credentials have permission to GetObject for amplify-133225-deployment/amplify-builds/graphQlLambdaAuthorizerae88f8f4-75757055505342576976-build.zip. S3 Error Code: AccessDenied. S3 Error Message: Access Denied (Service: Lambda, Status Code: 403, Request ID: 71023c52-851c-4924-853a-50543924b183)" (RequestToken: 22087c9e-4eee-fe51-0342-9c32b902c10d, HandlerErrorCode: AccessDenied)
This is command I implemented on Amplify:
amplify api update
? Select from one of the below mentioned services: GraphQL
General information
- Name: xxxxxxx
- API endpoint: XXXXXXXXXXXXXXXXXXXXXXXXXX
Authorization modes
- Default: Lambda
Conflict detection (required for DataStore)
- Disabled
? Select a setting to edit Authorization modes
? Choose the default authorization type for the API Lambda
? Choose a Lambda authorization function Create a new Lambda function
? Do you want to edit the local lambda function now? Yes
Edit the file in your editor: XXXXXXXXXXXXXX\App\amplify\backend\function\graphQlLambdaAuthorizer418f5645\src\index.js
? Press enter to continue
Successfully added graphQlLambdaAuthorizer418f5645 function locally
? How long should the authorization response be cached in seconds? 300
? Configure additional auth types? No
✅ GraphQL schema compiled successfully.
Deployment failed.
Deploying root stack xxxx [ =============--------------------------- ] 1/3
amplify-xxxx-xxxxx… AWS::CloudFormation::Stack UPDATE_ROLLBACK_COMPLETE Sat Feb 11 2023 09:23:58…
apixxxx AWS::CloudFormation::Stack UPDATE_FAILED Sat Feb 11 2023 09:21:24…
functiongraphQlLambdaAuthoriz… AWS::CloudFormation::Stack CREATE_FAILED Sat Feb 11 2023 09:21:13…
Deploying api xxxx [ ===------------------------------------- ] 1/12
GraphQLAPI AWS::AppSync::GraphQLApi UPDATE_COMPLETE Sat Feb 11 2023 09:22:14…
GraphQLAPITransformerSchema3C… AWS::AppSync::GraphQLSchema UPDATE_FAILED Sat Feb 11 2023 09:21:14…
Deploying function graphQlLambdaAuthorizer418f5645 [ ==========------------------------------ ] 1/4
LambdaExecutionRole AWS::IAM::Role CREATE_COMPLETE Sat Feb 11 2023 09:21:05…
LambdaFunction AWS::Lambda::Function CREATE_FAILED Sat Feb 11 2023 09:21:11…
Can you support fixing issues above? Thank you so much.