Sign inSign up

kayako/drone-lambda

By kayako

Updated almost 9 years ago

Drone plugin to trigger lambda function

Image
0

286

kayako/drone-lambda repository overview

Drone Lambda

A Drone plugin to invoke lambda function. This plugin invokes lambda functions using cross account IAM roles.

Usage

pipeline:
  notify:
    image: kayako/drone-lambda
    account: 1234567890
    function: NotifyBuild
    payload:
      message: "something happened"
      reason: "Somebody pushed a commit to repository"

The configuration above will

  • assume IAM role arn:aws:iam::1234567890:role/ci in AWS account 1234567890
  • Invoke lambda function NotifyBuild in account 1234567890 with payload {"message": "something happened", "reason": "Somebody pushed a commit to repository"}

IAM Configuration

Create an IAM role in target AWS account and allow the CI account to assume the role. Make sure that the IAM role has adequate permissions to invoke the lambda function.

Plugin Configuration

  • account: The AWS account ID of the target environment.
  • use_ci_role: IAM role name to use. Defaults to ci.
  • region: AWS region where the Lambda function will be invoked.
  • function: Name of the lambda function to invoke.
  • payload: Key value pairs that will be encoded as JSON and passed to lambda function as payload.
  • fail_on_error: Set to false to continue the build even if there is an error with lambda invocation.

To rewriting pipeline steps for separate AWS accounts you can specify the account numbers as build secret and omit account parameter. Following is the order of lookup for account number:

  1. account parameter
  2. account_number_${DRONE_DEPLOY_TO} environment variable
  3. account_number_${DRONE_BRANCH} environment variable
  4. account_number environment variable

Tag summary

Content type

Image

Digest

Size

34.8 MB

Last updated

almost 9 years ago

docker pull kayako/drone-lambda