aws-serverless

Async Lambda Function: Returning promise or sending responseURL does not terminate CloudFormation custom resource invocation

十年热恋 提交于 2021-01-27 07:12:52
问题 I have a lambda function invoked as a custom resource via a CloudFormation template. It Creates/Deletes AWS Connect instances. The API calls work fine but I cannot seem to terminate the custom resource invocation, so the last CF block remains CREATE_IN_PROGRESS. No matter what I return from the async function it just won't terminate the CF execution with a success. I'm able to use a non-async handler successfully as in https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/walkthrough

AWS Lambda Create Function - Request failed with status code 403

巧了我就是萌 提交于 2020-12-12 06:48:45
问题 Trying to create a new AWS Lambda Function with the root account for the first time using management console. I am receiving the error "Request failed with status code 403" no matter how many different options I tried. I've already tried changing my region, creating the function with default role(basic lambda permissions), new role, existing role and with the options "Author from Scratch", "Use a blueprint", "Serverless app repository" but still getting the same error. How can i troubleshoot

Fix CORS “Response to preflight…” header not present with AWS API gateway and amplify

∥☆過路亽.° 提交于 2020-08-27 08:24:29
问题 I've been struggling so long with the error below. I've tried so many tutorials and stackoverflow answers and none of the solutions fixes my problem. Access to XMLHttpRequest at 'https://xxx' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. I'm using SAM serverless to create my api. template.yaml: Globals: Function: Timeout: 10 Api:

How to pass parameters to serverless invoke local

六眼飞鱼酱① 提交于 2020-06-24 10:54:57
问题 I'm working on a aws serverless project and need to test the lambda functions locally. I am using serverless invoke local -f {function_name} command to test the API calls that does not request any path or query parameters. My question is how can I use this command to pass any path or query parameter to the function? Example serverless description getFoodDetails: handler: handler.getFoodDetails events: - http: method: get path: /foods/{food_id} cors: true request: parameters: paths: food_id:

AWS SAM Nested Application in Python with Dynamorm

邮差的信 提交于 2020-06-16 11:09:45
问题 I am using AWS SAM to build a Serverless application. I followed the instruction to build a nested application. My application structure is basically the following: . ├── MAKEFILE ├── README.md ├── __init__.py ├── apps │ ├── __init__.py │ ├── account │ │ ├── __init__.py │ │ ├── endpoints.py │ │ ├── models.py │ │ ├── requirements.txt │ │ └── template.yaml ├── samconfig.toml └── template.yaml The requirements.txt in the folder apps/account/ has the following python packages: boto3 marshmallow

AWS SAM Nested Application in Python with Dynamorm

余生颓废 提交于 2020-06-16 11:04:03
问题 I am using AWS SAM to build a Serverless application. I followed the instruction to build a nested application. My application structure is basically the following: . ├── MAKEFILE ├── README.md ├── __init__.py ├── apps │ ├── __init__.py │ ├── account │ │ ├── __init__.py │ │ ├── endpoints.py │ │ ├── models.py │ │ ├── requirements.txt │ │ └── template.yaml ├── samconfig.toml └── template.yaml The requirements.txt in the folder apps/account/ has the following python packages: boto3 marshmallow

AWS SAM local and environment parameters

守給你的承諾、 提交于 2020-02-03 10:24:28
问题 I want to get rid off hardcoded passwords in my lambda that is deployed to AWS. I found I shall modify packaged.yaml : Parameters: DATABASE_URI: Description: 'Required. MongoDB connection URL' Type: 'String' Resources: BUDAuthorizeUserHandler: Type: AWS::Serverless::Function Properties: FunctionName: BUDAuthorizeUserHandler Handler: src/handlers/users/authorizeUser.handler Runtime: nodejs10.x Environment: Variables: MONGODB_URI: !Ref DATABASE_URI This is the usage: const MONGODB_URI = process

Create an API Gateway Proxy Resource using SAM

谁说我不能喝 提交于 2020-01-13 05:12:07
问题 I have an apparently-simple requirement to create a proxy resource in SAM (Amazon's Serverless Application Model). So simple in fact that Amazon's documentation appears to leave this as an exercise to the reader! I want to create an AWS API Gateway catch-all endpoint to proxy everything to another HTTP service. In the AWS Console, the configuration I am trying to build looks as follows: I have seen this excellent post by Christian Johansen and his related Stack Overflow question here for how