Created
February 8, 2019 08:02
-
-
Save mikhailshilkov/0d50f399ab6c7dbe04de98c8f11c3ad1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Create a Role giving our Lambda access. | |
let policy: aws.iam.PolicyDocument = { /* Redacted for brevity */ }; | |
let role = new aws.iam.Role("lambda-role", { | |
assumeRolePolicy: JSON.stringify(policy), | |
}); | |
let fullAccess = new aws.iam.RolePolicyAttachment("lambda-access", { | |
role: role, | |
policyArn: aws.iam.AWSLambdaFullAccess, | |
}); | |
// Create a Lambda function, using code from the `./app` folder. | |
let lambda = new aws.lambda.Function("lambda-get", { | |
runtime: aws.lambda.NodeJS8d10Runtime, | |
code: new pulumi.asset.AssetArchive({ | |
".": new pulumi.asset.FileArchive("./app"), | |
}), | |
timeout: 300, | |
handler: "read.handler", | |
role: role.arn, | |
environment: { | |
variables: { | |
"COUNTER_TABLE": counterTable.name | |
} | |
}, | |
}, { dependsOn: [fullAccess] }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment