aws-lambda

Chrome is ignoring Access-Control-Allow-Origin header and fails CORS with preflight error when calling AWS Lambda

折月煮酒 提交于 2021-01-05 07:34:48
问题 I'm building a ReactJS frontend that has to gather some data from AWS Lambdas using a JS fetch. I cannot make it work, no mater what CORS technique I apply. I've looked into other answers here to no avail. I am definitely adding Access-Control-Allow-Origin with "*" value in my response (verified this using postman to call the endpoint). Also, Chrome complains about the preflight with Response to preflight request doesn't pass access control check , but no preflight request ( OPTIONS method)

python subprocess function can't find path: php file

百般思念 提交于 2021-01-05 07:22:25
问题 Embarked on aws lambda platform, attempted running python sub process function for invoking php url, which did not yield the desired outcome. Here given below the code for your ready reference: import json import subprocess # if the script don't need output. subprocess.call('php https://mbracecloud.com/post_form.php', stdin=None, stdout=None, stderr=None, shell=False) On running this code, we encounter this error: "errorMessage": "[Errno 2] No such file or directory: 'php https://mbracecloud

How to reference Arn and name of AWS lambda function created with Serverless Framework

青春壹個敷衍的年華 提交于 2021-01-05 07:22:08
问题 I am using the Serverless Framework to create a lambda function and would like to be able to cross-reference its Arn and name in other parts of serverless.yml. I'm surprised how difficult I'm finding this as !GetAtt and !Ref do not seem to work as I would expect if the lambda was created via vanilla CloudFormation. (AWS::Lambda::Function returns Ref and Fn::GetAtt which would make this easy!) I have found a few posts, that allude to solutions, but nothing that states in plain English how to

How to reference Arn and name of AWS lambda function created with Serverless Framework

别说谁变了你拦得住时间么 提交于 2021-01-05 07:21:04
问题 I am using the Serverless Framework to create a lambda function and would like to be able to cross-reference its Arn and name in other parts of serverless.yml. I'm surprised how difficult I'm finding this as !GetAtt and !Ref do not seem to work as I would expect if the lambda was created via vanilla CloudFormation. (AWS::Lambda::Function returns Ref and Fn::GetAtt which would make this easy!) I have found a few posts, that allude to solutions, but nothing that states in plain English how to

Cannot create lambda function on AWS with Administrator permission

岁酱吖の 提交于 2021-01-05 06:04:49
问题 I am trying to create a simple lambda function using Hello World example. No matter what I try, I always get "Request failed with status code 403". My account has AdministratorAccess. I tried policy simulator and it says I do have permission to create a function. the screenshot of the error from AWS Console 回答1: Based on the comments. Checking out Event Logs in AWS Personal Health Dashboard shows that the permissions on the account could be temporary limited due to Risk IAM quarantine and

Cannot create lambda function on AWS with Administrator permission

浪尽此生 提交于 2021-01-05 06:04:38
问题 I am trying to create a simple lambda function using Hello World example. No matter what I try, I always get "Request failed with status code 403". My account has AdministratorAccess. I tried policy simulator and it says I do have permission to create a function. the screenshot of the error from AWS Console 回答1: Based on the comments. Checking out Event Logs in AWS Personal Health Dashboard shows that the permissions on the account could be temporary limited due to Risk IAM quarantine and

Should I be using Express.js in a Serverless app?

倾然丶 夕夏残阳落幕 提交于 2021-01-04 06:43:08
问题 I wanted to know if using Express.js as middleware in a Serverless app (AWS Lambdas) a good idea? My concern comes from the fact that in Express.js there is a mono-function setup and in future if lots of request come in it'll start throttling. Are my concerns valid or I am wavering about nothing. 回答1: The decision between building a mono-lambda and one-function-per-endpoint does not have a crystal-clear answer. On one hand, if you're using cloud formation - you're limited to 200 resources per

Should I be using Express.js in a Serverless app?

南笙酒味 提交于 2021-01-04 06:42:58
问题 I wanted to know if using Express.js as middleware in a Serverless app (AWS Lambdas) a good idea? My concern comes from the fact that in Express.js there is a mono-function setup and in future if lots of request come in it'll start throttling. Are my concerns valid or I am wavering about nothing. 回答1: The decision between building a mono-lambda and one-function-per-endpoint does not have a crystal-clear answer. On one hand, if you're using cloud formation - you're limited to 200 resources per

In near real time analytics, why is Lambda-->Firehose-->S3 preferred over Lambda -->S3?

家住魔仙堡 提交于 2021-01-04 06:38:30
问题 Many AWS reference architectures for serverless real-time analytics, suggest pushing processed data from Lambda to S3 through Kinesis Firehose. e.g. https://aws.amazon.com/blogs/big-data/create-real-time-clickstream-sessions-and-run-analytics-with-amazon-kinesis-data-analytics-aws-glue-and-amazon-athena/ Why can’t we push data from Lambda to S3 directly? Isn't it better to avoid complexity and additional cost by skipping the mediator Kinesis Firehose component? Is there any problem with

In near real time analytics, why is Lambda-->Firehose-->S3 preferred over Lambda -->S3?

眉间皱痕 提交于 2021-01-04 06:38:18
问题 Many AWS reference architectures for serverless real-time analytics, suggest pushing processed data from Lambda to S3 through Kinesis Firehose. e.g. https://aws.amazon.com/blogs/big-data/create-real-time-clickstream-sessions-and-run-analytics-with-amazon-kinesis-data-analytics-aws-glue-and-amazon-athena/ Why can’t we push data from Lambda to S3 directly? Isn't it better to avoid complexity and additional cost by skipping the mediator Kinesis Firehose component? Is there any problem with