aws-lambda

Custom authorizer data with Amazon.Lambda.AspNetCoreServer

时光毁灭记忆、已成空白 提交于 2019-12-21 02:21:27
问题 Having worked extensively with Node.js in the past, we are currently investigating ASP.NET Core as an alternative Lambda platform. In the past, our API Gateway-fronted services relied on a custom authorizer, which authenticated the user and retrieved a list of resource-based permission policies from our company's IAM service. The authorizer attaches that list to the authContext key. Our services would integrate with API Gateway via Lambda Proxy and extract the principal object from the raw

Custom authorizer data with Amazon.Lambda.AspNetCoreServer

二次信任 提交于 2019-12-21 02:21:12
问题 Having worked extensively with Node.js in the past, we are currently investigating ASP.NET Core as an alternative Lambda platform. In the past, our API Gateway-fronted services relied on a custom authorizer, which authenticated the user and retrieved a list of resource-based permission policies from our company's IAM service. The authorizer attaches that list to the authContext key. Our services would integrate with API Gateway via Lambda Proxy and extract the principal object from the raw

How can I access a local API using Amazon Alexa

时间秒杀一切 提交于 2019-12-20 14:43:12
问题 I intend to build a set of skills for Amazon Alexa that will integrate with a custom software suite that runs on a RaspberryPi in my home. I am struggling to figure out how I can make the Echo / Dot itself make an API call to the raspberry pi directly - without going through the internet, as the target device will have nothing more then an intranet connection - it will be able to receive commands from devices on the local network, but is not accessible via the world. From what I have read,

S3 Policy to Allow Lambda

久未见 提交于 2019-12-20 12:21:56
问题 I have the following policy on an S3 bucket created with the AWS policy generator to allow a lambda, running with a specific role, access to the files in the bucket. However, when I execute the Lambda, I get 403 permission denied: "errorMessage": "Access Denied (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: <requestId>)", "errorType": "com.amazonaws.services.s3.model.AmazonS3Exception", The Policy on the S3 bucket: { "Version": "2012-10-17", "Id": "Policy<number>

Invoke AWS Lambda function only once, at a single specified future time

好久不见. 提交于 2019-12-20 12:20:36
问题 I want to be able to set a time to invoke an AWS Lambda function, then have that function be invoked then and only then. For example, I want my Lambda function to run at 9:00pm on December 19th, 2017. I don't want it to repeat, I don't want it to invoke now, just at 9:00pm on the 19th. I understand that CloudWatch provides Scheduled Events, and I was thinking that when a time to schedule this reminder for is inputted, a CloudWatch Scheduled Events is created to fire in that amount of time

AWS API Gateway: How to pass IAM identity to Lambda function?

老子叫甜甜 提交于 2019-12-20 10:29:52
问题 I've successfully configured IAM-authenticated access to my Lambda function with AWS API Gateway front-end, but unable to find how to pass IAM user identity to my Lambda function. I need exactly IAM user identity and can not run Lambda function under calling IAM-user credentials. All I need - is to get calling IAM-user identity in my Lambda function. Is there option for that? 回答1: Support for accessing identity and other information from the Amazon API Gateway request context hadn't been

Elegant way to create thumbnails of images stored on s3 with ec2 and communicate with rails on finish?

别来无恙 提交于 2019-12-20 10:06:09
问题 OK, so a quick summary of my setup and what i want to accomplish: I have a rails 2.3.5 server that runs my website. I have a flash application on my site where users can upload images directly to s3. When an upload is completed, rails is notified. At the point where the image is finished uploading to s3 and rails is notified, i want rails to send some post to something located on ec2 to create two thumbnails (110x110 and 600x600). When the thumbnails are created and transferred to s3, i want

AWS: Publish SNS message for Lambda function via boto3 (Python2)

女生的网名这么多〃 提交于 2019-12-20 10:02:47
问题 I am trying to publish to an SNS topic which will then notify a Lambda function, as well as an SQS queue. My Lambda function does get called, but the CloudWatch logs state that my "event" object is None. The boto3 docs states to use the kwarg MessageStructure='json' but that throws a ClientError. Hopefully I've supplied enough information. Example Code: import json import boto3 message = {"foo": "bar"} client = boto3.client('sns') response = client.publish( TargetArn=arn, Message=json.dumps

How do you structure sequential AWS service calls within lambda given all the calls are asynchronous?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-20 09:55:54
问题 I'm coming from a java background so a bit of a newbie on Javascript conventions needed for Lambda. I've got a lambda function which is meant to do several AWS tasks in a particular order, depending on the result of the previous task. Given that each task reports its results asynchronously, I'm wondering if the right way make sure they all happen in the right sequence, and the results of one operation are available to the invocation of the next function. It seems like I have to invoike each

Using python Logging with AWS Lambda

旧时模样 提交于 2019-12-20 09:47:44
问题 As the AWS documentation suggests: import logging logger = logging.getLogger() logger.setLevel(logging.INFO) def my_logging_handler(event, context): logger.info('got event{}'.format(event)) logger.error('something went wrong') Now I made: import logging logging.basicConfig(level = logging.INFO) logging.info("Hello World!") The first snippet of code prints in the Cloud Watch console, but the second one no. I didn't see any difference as the two snippets are using the root logger. 回答1: Copied