Serverless

AWS lambda basic-authentication without custom authorizer

此生再无相见时 提交于 2019-12-11 04:49:55
问题 I have a problem with setting up the basic authentication for my AWS lambda function written in Node.js. The problem: AWS lambda function which is a proxy for an additional service. This function only forwards the whole request and give the user the whole response. That's why I need to force the usage of the Authentication header and I would like to have the prompt window for passing the credentials: https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication Apart from the proxy part of

How to locally run my cloudflare worker serverless function, during development?

有些话、适合烂在心里 提交于 2019-12-11 04:37:47
问题 I managed to deploy my first cloudflare worker using serverless framework according to https://serverless.com/framework/docs/providers/cloudflare/guide/ and it is working when I hit the cloud. During development, would like to be able to test on http://localhost:8080/* What is the simplest way to bring up a local http server and handle my requests using function specified in serverless.yml? I looked into https://github.com/serverless/examples/tree/master/google-node-simple-http-endpoint but

IAM role inside SAM template

有些话、适合烂在心里 提交于 2019-12-10 21:37:54
问题 How to create an IAM role inside a SAM template likewise I did in SAM package. I tried this as following: "lambdaFunctionRole": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": [ "lambda.amazonaws.com", "apigateway.amazonaws.com" ] }, "Action": "sts:AssumeRole" } ] }, "ManagedPolicyArns": [ { "Ref": "lambdaBasePolicy" } ], "Policies": [ { "PolicyName": "root", "PolicyDocument": {

Badge count option in amazon SNS

烂漫一生 提交于 2019-12-10 16:26:38
问题 I need to get badge count in my application. I am using amazon SNS service. Here is my code AWS.config.update({ accessKeyId: 'XXXXXXX', secretAccessKey: 'XXXXXXX' }) AWS.config.update({ region: 'XXXXXXX' }) const sns = new AWS.SNS() const params = { PlatformApplicationArn: 'XXXXXXX', Token: deviceToken } sns.createPlatformEndpoint(params, (err, EndPointResult) => { const client_arn = EndPointResult["EndpointArn"]; sns.publish({ TargetArn: client_arn, Message: message, Subject: title, // badge

AWS Lambda - Building serverless API using .NET Core

删除回忆录丶 提交于 2019-12-10 15:13:15
问题 Recently I have been looking into AWS Lambdas and how to build Serverless API using .Net Core. From what I understand, you can do it in 2 different ways. 1) Write multiple separate Lambdas in C# and deploy them to AWS. Requests come in via API gateway and each lambda acts as an endpoint. 2) Build a Serverless Web API using .Net core. When you create the serverless Web API project a Lambda is automatically created which becomes the entry point to the Web API. Are there any limitations of 1 vs

Flask redirect function redirects to raw API Gateway url instead of custom domain

 ̄綄美尐妖づ 提交于 2019-12-10 12:13:14
问题 I am using the redirect function in my flask app, but whenever the function triggers it redirects the autogenerated API Gateway domain instead of my own domain, which in turn gives me a message forbidden because it is and was internal url. It works when I run in localhost but as soon as it's AWS it doesn't work. I am using a cloudfront distro to redirect users from http to https. zappa version: 0.48.2, python: 3.6, zappa_settings.json: { "dev": { "app_function": "application.application",

Cloud functions timeout on page.goto()

陌路散爱 提交于 2019-12-10 11:19:09
问题 I run tests with puppeteer in cloud functions. If I run test on local machine all is fine. If I run tests in cloud functions emulator it's fine as well. But when I deploy my function to the cloud all tests stuck on page.goto('https://...') and function fails by timeout, which in my case is 3 minutes. 回答1: The problem was in puppeteer. I downgraded from the version 1.13.0 to 1.11.0 and now everything works fine. See the discussion here 来源: https://stackoverflow.com/questions/55274130/cloud

Key Vault Settings in Azure App Settings with no code

冷暖自知 提交于 2019-12-08 01:36:46
问题 I created a simple Azure function with a HTTPTrigger that returns the secret value for a key set through the portal in Azure. The value is stored as @Microsoft.KeyVault(SecretUri=https://myvault.vault.azure.net/secrets/mysecret/ec96f02080254f109c51a1f14cdb1931) The Function has system assigned managed identity enabled in Platform Features>Identity. The Key Vault has the secret added with the value. The Key Vault also has an Access Policy defined with full access for keys, secrets and

Should I run mysql on google cloud run? (or any database)

北慕城南 提交于 2019-12-07 18:39:28
I've been researching the new options to run Docker containers in Google Cloud Run, however, there seems to be no advice on whether or not one should run MySQL on Cloud run, apparently, I know it isn't a web service, and I understand in the Official Google Documentation for GCP, Google would probably just tell people to kindly use Cloud SQL (their SQL Offering), I haven't found any advice online about "running mysql on cloud run", so I thought I'd ask here. Will startup times from cold starts decrease performance of the solution? (assuming one uses a Bucket for storing the stuff) Running a SQL

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

拥有回忆 提交于 2019-12-07 07:30:46
问题 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? 回答1: If you are using windows, update the vscode launch.json and package.json as below : //