Serverless

How to debug Serverless Offline in Visual Studio Code using another port?

南笙酒味 提交于 2019-12-05 14:22:52
I have two Serverless Offline "servers" which I need to run locally at same time. So I need to change the port of one of the servers. I run a server using Visual Studio Code debugger. The configs of the servers are in launch.json files. How can I change the port of a Serverless Offline application so that I can run it in parallel with another Serverless Offline application using VS Code debugger? If you are using windows, update the vscode launch.json and package.json as below : // launch.json { "version": "0.2.0", "configurations": [ { "type": "node", "request": "launch", "name": "Debug

How do you look at console.log output of the amazon lambda function

别等时光非礼了梦想. 提交于 2019-12-05 00:17:04
When you do a console.log('Loading function'); in an amazon lambda function, where does that go? My setup api gateway lambda function nodejs6.10 curl https://n2tredacted.execute-api.us-east-1.amazonaws.com/prod/redactedFunc AWS Lambda logs are written to CloudWatch Logs . Here's how to access them : select your Lambda function in the AWS console click the Monitoring tab choose View logs in CloudWatch If you prefer to retrieve CloudWatch Logs outside of the AWS Console, then there are numerous CLI options: awscli: aws logs get-log-events github: jorgebastida/awslogs github: TylerBrock/saw

Write to Google Cloud Storage from Cloud Function (python)

末鹿安然 提交于 2019-12-04 18:03:46
问题 I am trying to upload a file to google cloud storage from within a cloud function. I can't import the cloud storage library into my function, though. Can cloud storage be used from within cloud functions in this manner? Cloud Function from google.cloud import storage def upload_blob(bucket_name, blob_text, destination_blob_name): """Uploads a file to the bucket.""" storage_client = storage.Client() bucket = storage_client.get_bucket(bucket_name) blob = bucket.blob(destination_blob_name) blob

Connect to Aurora Serverless using EC2 as Proxy

一世执手 提交于 2019-12-04 18:01:52
Not a duplicate of AWS Aurora MySQL serverless: how to connect from MySQL Workbench . Aurora Serverless doesn't support public connections yet. I used Cloud9 to create an EC2 instance on the same VPN as the database. I then connected to the database from the Cloud9 terminal. My (GraphQL Prisma) service that I'm attempting to host (on Zeit Now) only takes a HOST and a PASSWORD for configuration. How can I make the EC2 instance act as a proxy that I can treat exactly as a database endpoint. Can tunneling fully do that and I'm just bad at it? I think this blog may help you. The idea, is make a

How to fix CloudRun error 'The request was aborted because there was no available instance'

随声附和 提交于 2019-12-04 14:36:44
I'm using managed CloudRun to deploy a container with concurrency=1 . Once deployed, I'm firing four long-running requests in parallel. Most of the time, all works fine -- But occasionally, I'm facing 500's from one of the nodes within a few seconds; logs only provide the error message provided in the subject. Using retry with exponential back-off did not improve the situation; the retries also end up with 500s. StackDriver logs also do not provide further information. Potentially relevant gcloud beta run deploy arguments: --memory 2Gi --concurrency 1 --timeout 8m --platform managed What does

authentication in mobile app with azure functions

╄→尐↘猪︶ㄣ 提交于 2019-12-04 11:59:41
I am trying to develop a serverless backend for my xamarin app. and for that I chose azure functions . Now I already know that Azure Mobile Apps provide an SDK for this purpose with which we can easily enable Authentication with multiple ways which are following 1. Azure Active Directiry 2. Facebook 3. Google 4. Microsoft 5. Twitter Now I want to allow login with atleast 2 of these in my app, but I am not using azure mobile app as backend, instead I am using azure functions. So how can I achieve the same result with serverless? Thanks in advance. AFAIK, when using Easy Auth (Authentication

Allow lambda to access particular s3 bucket in serverless config

时光总嘲笑我的痴心妄想 提交于 2019-12-04 11:43:24
How can I allow specific lambda to access to a particular s3 bucket in the serverless.yml? For example, I am porting file upload functionality to lambda by using serverless. To upload a file to a particular s3 bucket, I need to allow lambda to access to that s3 bucket. How can I do this in the serverless.yml? From Serverless Framework - AWS Lambda Guide - IAM : To add specific rights to this service-wide Role, define statements in provider.iamRoleStatements which will be merged into the generated policy. service: new-service provider: name: aws iamRoleStatements: - Effect: "Allow" Action: -

Write to Google Cloud Storage from Cloud Function (python)

▼魔方 西西 提交于 2019-12-03 11:29:27
I am trying to upload a file to google cloud storage from within a cloud function. I can't import the cloud storage library into my function, though. Can cloud storage be used from within cloud functions in this manner? Cloud Function from google.cloud import storage def upload_blob(bucket_name, blob_text, destination_blob_name): """Uploads a file to the bucket.""" storage_client = storage.Client() bucket = storage_client.get_bucket(bucket_name) blob = bucket.blob(destination_blob_name) blob.upload_from_string(blob_text) print('File {} uploaded to {}.'.format( source_file_name, destination

AWS Lambda TooManyRequestsException: Rate Exceeded

☆樱花仙子☆ 提交于 2019-12-03 11:21:49
问题 When attempting to execute an Amazon Web Services (AWS) Lambda function ( many times ) we were seeing the error: AWS Lambda TooManyRequestsException: Rate Exceeded How do we resolve this? 回答1: As noted by Michael , this is the error message you will see when you reach the documented default "safety" limit of 100 concurrent invocations: " AWS Lambda has a default safety throttle of 100 concurrent executions per account per region. If you wish to submit a request to increase the throttle of 100

What is the difference between a Serverless Function, and a Lambda Function

半腔热情 提交于 2019-12-03 04:08:33
问题 I am playing around with the Cloudformation Serverless Transformation, and am trying to figure out how and when to use AWS::Serverless::Function or AWS::Lambda::Function . For some reason the Lambda version is used for SAM examples in AWS. This is very confusing. SAM github. And then there is also the servlerless framework itself which is really a nodejs framework. All this stuff is getting me extremely confused. 回答1: First of all, let me explain each of these. AWS Serverless Stack - A