Created
March 11, 2018 21:14
-
-
Save miensol/d88ff385bf31beb71d1998e2bb74424e to your computer and use it in GitHub Desktop.
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
import cloudform, { Lambda, IAM, Fn } from 'cloudform'; | |
const LambdaExecutionRole = 'LambdaExecutionRole'; | |
cloudform({ | |
Resources: { | |
HelloWorld: new Lambda.Function({ | |
Code: { | |
ZipFile: "exports.wrtiteToConsole = function (event, context, callback){ console.log('Hello'); callback(null); }" | |
}, | |
Handler: "index.wrtiteToConsole", | |
Role: Fn.GetAtt(LambdaExecutionRole, "Arn"), | |
Runtime: "nodejs6.10" | |
}), | |
[LambdaExecutionRole]: new IAM.Role({ | |
AssumeRolePolicyDocument: { | |
Statement: [{ | |
Effect: "Allow", | |
Principal: { Service: ["lambda.amazonaws.com"] }, | |
Action: ["sts:AssumeRole"] | |
}] | |
}, | |
Path: "/", | |
ManagedPolicyArns: ["arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"] | |
}) | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment