Skip to main content

Introduction

The AWS Elastic Beanstalk integration lets you record deployment activity as Rootly pulses every time your Elastic Beanstalk application deploys. It works by embedding the Rootly CLI into your .ebextensions deploy hooks — no separate service or OAuth connection required. With this integration, you can:
  • Automatically log a deployment pulse to Rootly every time a new version is deployed to an Elastic Beanstalk environment
  • Tag pulses with the environment, service, and custom labels that matter to your team
  • Surface deployment context on the incident timeline when an outage coincides with a recent deploy
  • Use Rootly’s API key and the CLI to fit naturally into your existing .ebextensions configuration
This integration is CLI-based and does not require an OAuth connection in Rootly. You configure it entirely through your application’s .ebextensions directory, using your Rootly API key to authenticate the CLI.

Before You Begin

Before setting up the Elastic Beanstalk integration, make sure you have:
  • A Rootly account and a Rootly API key (found under your account settings)
  • An AWS Elastic Beanstalk application with access to modify .ebextensions configuration files
  • The ability to set environment configuration variables in Elastic Beanstalk for your API key and environment name
Store your Rootly API key as an Elastic Beanstalk environment variable rather than hardcoding it in your .ebextensions config file. This keeps secrets out of your repository.

Installation

Add environment variables to your Elastic Beanstalk environment

In the AWS Console (or via the EB CLI), add the following environment configuration variables to your Elastic Beanstalk environment:
VariableValue
rootly_api_keyYour Rootly API key
environmentThe environment name (e.g. production, staging)
serviceThe service name as it appears in Rootly
These values will be read by the deploy hook script at runtime using get-config container.

Create the .ebextensions config file

In your application repository, create a file at .ebextensions/rootly.config (the filename does not have to be rootly).Add the following content to the file, adapting the labels value for your use case:
files:
  "/opt/elasticbeanstalk/hooks/appdeploy/pre/01rootly.sh":
    mode: "000775"
    owner: root
    group: users
    content: |
      #!/bin/bash

      rootly_api_key="$(/opt/elasticbeanstalk/bin/get-config container -k rootly_api_key)";
      environment="$(/opt/elasticbeanstalk/bin/get-config container -k environment)";
      service="$(/opt/elasticbeanstalk/bin/get-config container -k service)";
      labels="key=value,key2=value2"

      # install rootly cli
      curl -fsSL https://raw.githubusercontent.com/rootly-io/cli/main/install.sh | sh

      # log a pulse
      rootly pulse --api-key "${rootly_api_key}" --quiet --environments "${environment}" --services "${service}" --labels "${labels}" Deploy in progress...
The script is placed in appdeploy/pre/ so it runs before the new application version is deployed. This means the pulse fires at the start of each deployment. You can duplicate the hook into appdeploy/post/ to also log a pulse when the deployment completes.

Customize labels for your team

Update the labels variable in the script to include any metadata your team finds useful. Labels are comma-separated key-value pairs:
labels="team=platform,region=us-east-1,app=api"
Labels appear on the pulse in Rootly and make it easier to filter deployment activity across services and environments.

Deploy your application

Commit the .ebextensions/rootly.config file and deploy your application. On the next deployment, the hook script will run, install the Rootly CLI, and log a pulse to your Rootly workspace.
Verify the integration is working by navigating to Pulses in Rootly after your next deployment. You should see a pulse with the summary “Deploy in progress…” tagged with the environment and service you configured.

How Pulses Work

Each time the deploy hook runs, the Rootly CLI sends a pulse to your workspace with:
  • Summary: The message passed to the rootly pulse command (e.g. “Deploy in progress…”)
  • Environment: The environment name from the environment variable
  • Service: The service name from the service variable
  • Labels: Any key-value labels you configured
Pulses are visible on the Rootly pulse feed and will appear on the timeline of any incident linked to the affected service or environment during the deployment window.
If an incident is declared around the same time as a deployment, the deployment pulse will surface automatically on the incident timeline — giving responders immediate context about whether a recent deploy may have contributed to the issue.

Customizing the Hook

Log a pulse on deployment completion

To also record when a deployment finishes, create a second hook file at appdeploy/post/:
files:
  "/opt/elasticbeanstalk/hooks/appdeploy/post/01rootly.sh":
    mode: "000775"
    owner: root
    group: users
    content: |
      #!/bin/bash

      rootly_api_key="$(/opt/elasticbeanstalk/bin/get-config container -k rootly_api_key)";
      environment="$(/opt/elasticbeanstalk/bin/get-config container -k environment)";
      service="$(/opt/elasticbeanstalk/bin/get-config container -k service)";

      curl -fsSL https://raw.githubusercontent.com/rootly-io/cli/main/install.sh | sh

      rootly pulse --api-key "${rootly_api_key}" --quiet --environments "${environment}" --services "${service}" Deploy complete

Use the Rootly CLI for more than pulses

The Rootly CLI supports additional commands beyond pulse. You can also use it to declare incidents, update incident status, or trigger workflows from your deploy hooks. See the Rootly CLI documentation for the full command reference.

Troubleshooting

Check the Elastic Beanstalk environment logs for the deploy hook output. Look for errors from the curl install command or the rootly pulse command. Common causes include network access restrictions that prevent the EC2 instance from reaching raw.githubusercontent.com or the Rootly API endpoint.
Confirm that the environment configuration variable rootly_api_key is set in your Elastic Beanstalk environment settings. Variables must be set in the environment itself (not just in the .ebextensions config) to be accessible via get-config container. Redeploy after adding variables.
The install script requires curl and internet access from the EC2 instance. If your Elastic Beanstalk environment runs in a private subnet without internet access, the CLI install will fail. In this case, pre-install the Rootly CLI in a custom AMI or bundle it directly in your application artifact rather than downloading it at deploy time.
The --services and --environments flags in the CLI command must match the exact names of the service and environment as they appear in Rootly. Names are case-sensitive. Check your Rootly services and environments configuration and update the service and environment variables in your Elastic Beanstalk environment settings accordingly.

Rootly CLI

Full reference for the Rootly CLI, including all available commands and flags.

Pulses

Learn how deployment pulses appear in Rootly and how they surface during incidents.

Services

Configure services in Rootly to link deployment pulses to the right team and context.