Amazon CloudWatch Events to BuildKite trigger function for AWS Lambda.
Add the function code to AWS Lambda with the following configuration options:
Key | Value |
---|---|
Runtime | Node.js 6.10 |
Handler | index.handler |
Role | AWSLambdaBasicExecutionRole |
Memory | 128 (MB) |
Timeout | 3 sec |
KMS key | aws/lambda |
Set the following required environment variables for the Lambda function:
Key | Value |
---|---|
token | AWS KMS encrypted access token. |
organization | BuildKite organization slug. |
Set the following optional environment variables for the Lambda function:
Key | Value |
---|---|
pipeline | BuildKite pipeline slug (used if event.pipeline is empty). |
branch | Git branch to build (default: master ). |
message | Build message (default: :robot_face: scheduled build ). |
- In the Amazon CloudWatch
Events => Rules
section, click onCreate rule
. - Choose
Schedule
as event source. - Select the created Lambda function as target.
- Click on
Configure input
and selectConstant (JSON text)
. - Enter the desired event data as
JSON
object, e.g.{"pipeline":"example"}
. - Click on
Configure details
and enter a name and description. - Save the rule via
Create rule
.
The event data is sent as POST data to the
BuildKite API.
In addition, the event data supports a pipeline
property that overrides a
configured environment variable.
The required request body properties are set to the following default values if not provided via event data:
Key | Value |
---|---|
commit | HEAD |
branch | master |
message | :robot_face: scheduled build |
Released under the MIT license.