aws-lambda

AWS Lambda Powershell to create mailbox in Hybrid(run powershell commands in both Office 365 and On-Prem)

我的未来我决定 提交于 2020-04-30 10:09:36
问题 Now that AWS Lambda supports PowerShell core according to this blog, has anybody tried running PowerShell commands to create Mailbox in Hybrid env(run PS cmdlets in both On-prem and office 365 env) using lambda? I couldn't find anything online which does that. Most of the Lambda Powershell usecases seems to be related to using PowerShell scripts to automate and manage AWS resources. I'm working on a POC for a REST service which does all of the mailbox creation operations and was planning to

Tracking execution of lambda

风流意气都作罢 提交于 2020-04-30 07:05:45
问题 I have a lambda that can be executed from various accounts. I wish to track how long the lambda executed for when executed by different accounts. AWS X-ray gives my the duration for which lambda executed by I can't corelate that information to the caller of the lambda function. Is there a way to link the duration of execution of lambda function to caller to the function? 回答1: If you have the parameter(s) to identify the accounts on your lambda function, you may use "Annotations and metadata"

Tracking execution of lambda

我只是一个虾纸丫 提交于 2020-04-30 07:05:18
问题 I have a lambda that can be executed from various accounts. I wish to track how long the lambda executed for when executed by different accounts. AWS X-ray gives my the duration for which lambda executed by I can't corelate that information to the caller of the lambda function. Is there a way to link the duration of execution of lambda function to caller to the function? 回答1: If you have the parameter(s) to identify the accounts on your lambda function, you may use "Annotations and metadata"

AWS Step Functions: Combine task input with *partial* task output

為{幸葍}努か 提交于 2020-04-30 05:12:25
问题 I'm working on AWS Step functions. I've read the documentation on InputPath, OutputPath, and ResultPath. My problem is that I want to combine values from the input to a Lambda Task with a partial output from the task. The input to the task is similar to below. I want to continue passing these values on to subsequent tasks. { "previous_task_result": 100, "next_task_input": "asdf" } What I would like, is to have the output of my Lambda Task look like this: { "previous_task_result": 100, "next

AWS Lambda and API Gateway response integration issue

生来就可爱ヽ(ⅴ<●) 提交于 2020-04-30 04:37:50
问题 I have deployed AWS stack with a Lambda function and an API gateway. After deployment I tested Lambda function independently and it works fine but when I invoke it using AWS API Gateway, it fails with ` Internal Error: 502 I looked at cloudwatch logs and it says Endpoint response body before transformations: null I am returning my response from Lambda (Python 3.6) in following way - body = { "message": "Success!!" } response = { "statusCode": 200, "headers": { "content-type": "application

Serverless I image upload to S3 broken after deploy, local worked only

风格不统一 提交于 2020-04-28 21:05:32
问题 I trying to upload an image to S3 uses serverless and NodeJS but something wrong after upload. In local uses serverless-offline everything worked like champ but after deploy I got this error. Then I tried to intercept and detect what's happened and see this result: Some strange character appeared in image body such as <0x0a> 0x01 0x04 I also tried to use serverless-apigw-binary but not luck. 回答1: Self Answer Very lucky I just found the solution at binary-media-types Add this to serverless.yml

CORS impossible on AWS Lambda HTTP API Gateway Integration

别等时光非礼了梦想. 提交于 2020-04-28 19:04:31
问题 An AWS Lamba function (NodeJS) returning 3 HTTP headers: aaa, Access-Control-Allow-Origin and bbb was created: exports.handler = async (event) => { const response = { statusCode: 200, headers: { "aaa":"aaa", "Access-Control-Allow-Origin":"*", "bbb":"bbb" }, body: JSON.stringify('Hello from Lambda!'), }; return response; }; The function is integrated into a HTTP API (not REST API). In the HTTP API Gateway Configuration, Section "Configure CORS", the HTTP header "Access-Control-Allow-Origin"

CORS impossible on AWS Lambda HTTP API Gateway Integration

China☆狼群 提交于 2020-04-28 19:04:20
问题 An AWS Lamba function (NodeJS) returning 3 HTTP headers: aaa, Access-Control-Allow-Origin and bbb was created: exports.handler = async (event) => { const response = { statusCode: 200, headers: { "aaa":"aaa", "Access-Control-Allow-Origin":"*", "bbb":"bbb" }, body: JSON.stringify('Hello from Lambda!'), }; return response; }; The function is integrated into a HTTP API (not REST API). In the HTTP API Gateway Configuration, Section "Configure CORS", the HTTP header "Access-Control-Allow-Origin"

Best way to convert excel file into a JSON file?

心已入冬 提交于 2020-04-18 12:35:04
问题 I have data saved in a Microsoft excel file. I need to turn that data into something that a Lambda function can parse. I think the best way to do this is to convert the excel file into a JSON file (and then my Lambda function can read and parse it). What's the best way to do this? To convert the excel data file into a JSON file, I have found some handy online converter tools, like this one. It seems to work. However, that converter and others add in \r wherever there are line breaks in the

Best way to convert excel file into a JSON file?

亡梦爱人 提交于 2020-04-18 12:33:43
问题 I have data saved in a Microsoft excel file. I need to turn that data into something that a Lambda function can parse. I think the best way to do this is to convert the excel file into a JSON file (and then my Lambda function can read and parse it). What's the best way to do this? To convert the excel data file into a JSON file, I have found some handy online converter tools, like this one. It seems to work. However, that converter and others add in \r wherever there are line breaks in the