3.0.0 • Published 2 years ago

@sjmeverett/cloudformation-lambda v3.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
2 years ago

@sjmeverett/cloudformation-lambda

Functions to generate CloudFormation for common Lambda setups.

For use in conjunction with @sjmeverett/cloudformation-types.

createLogPolicy(name: string): IAMRolePolicy

Convenience function to create a IAM policy document which allows logging in CloudWatch. Returns:

{
  PolicyName: name,
  PolicyDocument: {
    Version: "2012-10-17",
    Statement: [
      {
        Action: [
          "logs:CreateLogGroup",
          "logs:CreateLogStream",
          "logs:PutLogEvents",
        ],
        Resource: "arn:aws:logs:*:*:*",
        Effect: "Allow",
      },
    ],
  },
}

createLambdaRole(name: string, options: CreateLambdaRoleOptions)

Convenience function to assemble an IAM Role for Lambda.

createLambdaFnWithRole(name: string, options: CreateLambdaFnWithRoleOptions)

Creates a lambda function with the specified role options.