-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pulumi.Asset support to lambda function
- Loading branch information
1 parent
7fd9e0d
commit 0d626a5
Showing
21 changed files
with
173 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
exports.handler = function(event, context, callback){ | ||
var response = event.response; | ||
const updated = { "response": response + "World!" }; | ||
callback(null, updated); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
var aws = require('aws-sdk') | ||
var response = require('cfn-response') | ||
exports.handler = function(event, context) { | ||
console.log("REQUEST RECEIVED:\\n" + JSON.stringify(event)) | ||
// For Delete requests, immediately send a SUCCESS response. | ||
if (event.RequestType == "Delete") { | ||
response.send(event, context, "SUCCESS") | ||
return | ||
} | ||
var responseStatus = "FAILED" | ||
var responseData = {} | ||
var functionName = event.ResourceProperties.FunctionName | ||
var lambda = new aws.Lambda() | ||
lambda.invoke({ FunctionName: functionName }, function(err, invokeResult) { | ||
if (err) { | ||
responseData = {Error: "Invoke call failed"} | ||
console.log(responseData.Error + ":\\n", err) | ||
} | ||
else responseStatus = "SUCCESS" | ||
response.send(event, context, responseStatus, responseData) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.