Integrate Amazon CloudWatch with Chargebee

Appy Pie Connect allows you to automate multiple workflows between Amazon CloudWatch and Chargebee

  • No code
  • No Credit Card
  • Lightning Fast Setup

20 Million work hours saved

Award Winning App Integration Platform

About Amazon CloudWatch

Amazon CloudWatch is a monitoring service for AWS cloud resources and the applications you run on AWS.

About Chargebee

Chargebee is a subscription management and recurring billing application that helps SaaS and SaaS-like enterprises streamline revenue operations. Chargebee works with the world's most popular payment gateways.

Want to explore Amazon CloudWatch + Chargebee quick connects for faster integration? Here’s our list of the best Amazon CloudWatch + Chargebee quick connects.

Explore quick connects
Connect Amazon CloudWatch + Chargebee in easier way

It's easy to connect Amazon CloudWatch + Chargebee without coding knowledge. Start creating your own business flow.

  • Triggers
  • New Log

    Triggers when a new log is created.

  • Customer Details Updates

    Triggers when customer details such as first name, last name, email, billing address, etc., are updated.

  • New Customer

    Triggers when a customer is created.

  • New Invoice

    Triggers when a new invoice is generated(with line item support).

  • New Payment

    Triggers when a payment is collected successfully.

  • New Subscription

    Triggers when a subscription is created.

  • Payment Failure

    Triggers when a payment fails.

  • Subscription Cancellation

    Triggers when a subscription is cancelled.

  • Subscription Cancellation Scheduled

    Triggers when a subscription is scheduled for cancellation.

  • Subscription Details Updates

    Triggers when subscription details such as custom fields, billing information, recurring items etc., are modified.

  • Subscription Pause

    Triggers when a subscription is paused.

  • Subscription Resumption

    Triggers when a paused subscription is resumed.

  • Actions
  • Enable Alarm

    Enable Alarm

  • Change Next Billing Date

    Updates next billing date of a subscription.

  • Create Customer

    Creates a new customer in Chargebee.

  • Create Subscription

    Creates a new subscription along with the customer in Chargebee. This action does not support adding subscription to an existing customer.

  • Pause Subscription

    Pauses a subscription in Chargebee.

  • Record Offline Payment for an Invoice

    Records an offline payment for unpaid invoices.

  • Resume Subscription

    Resumes a paused subscription in Chargebee

  • Update Customer

    Updates customer details in Chargebee.

How Amazon CloudWatch & Chargebee Integrations Work

  1. Step 1: Choose Amazon CloudWatch as a trigger app and authenticate it on Appy Pie Connect.

    (30 seconds)

  2. Step 2: Select "Trigger" from the Triggers List.

    (10 seconds)

  3. Step 3: Pick Chargebee as an action app and authenticate.

    (30 seconds)

  4. Step 4: Select a resulting action from the Action List.

    (10 seconds)

  5. Step 5: Select the data you want to send from Amazon CloudWatch to Chargebee.

    (2 minutes)

  6. Your Connect is ready! It's time to start enjoying the benefits of workflow automation.

Integration of Amazon CloudWatch and Chargebee

Amazon CloudWatch is a monitoring service that provides detailed statistics and other information on the computing resources of Amazon Web Services (AWS. It was originally launched in 2009 and has been running successfully ever since. CloudWatch can be integrated with any other AWS service, not just Chargebee. However, we choose to integrate it with Chargebee and here is why.

Chargebee is an online subscription management platform which helps retailers and subscription companies to run their entire business from one single dashboard. They provide customers with an overview of their subscriptions, so they can manage it easily and effectively by themselves.

Integration of Amazon CloudWatch and Chargebee

We will use a simple approach to integration of Amazon CloudWatch and Chargebee. We want to create an alert for Chargebee based on the metrics provided by CloudWatch. In order to do this, we need to add a new metric from CloudWatch to Chargebee. We will do this by using an API created by Chargebee itself called “ChargeBee API”. This API will allow us to send the data generated by CloudWatch to Chargebee, and Chargebee will take care of creating an alert based on the data received.

We will first log in to AWS conspe and go to CloudWatch Conspe where we can configure our metrics. We will create a new alarm based on the fplowing criteria:

Metric Name. Session Duration (in minutes)

Threshpd. 120 minutes (2 hours)

Alarm Name. Session Duration Alarm

Next, we will go to ChargeBee dashboard, and click on “API Explorer”. Then, we must select the “New API” button and then click on “Create New API”. We will create a new API named “CloudWatch-ChargeBee”. We will provide a name for the API as well as its description. Next, we are required to enter the endpoint URLs of our application; in our case, the URL is After this, we have to click on “Create API” button. On the next screen, we have to “click on Create API key”. This time, we have to provide a Name for the key as well as its description. We will then copy the API key and paste it into ChargeBee configuration file in our application directory at /config/initializers/chargebee_api_key.rb .

Now we can start creating an integration between Amazon CloudWatch and Chargebee. First, we must include the gem “chargebee-api-client” into our Rails application by adding this line into Gemfile :

gem 'chargebee-api-client' , '~> 1.0'

We must also run bundle install to install it. Then, we must require this gem in config/initializers/chargebee_api_key.rb as fplows:

require 'chargebee-api-client'

Finally, we have to configure ChargeBee by adding some settings like api_key , api_secret , app_id etc into chargebee.yml . We will have to add these lines into app/models/chargebee_client.rb :

chargebee_config = YAML . load ( File . read ( File . expand_path ( "../../config/initializers/chargebee_api_key.rb" )). chargebee = ChargeBee :. Client . new ( chargebee_config [ "client" ][ "api_key" ], chargebee_config [ "client" ][ "api_secret" ]. chargebee . app_id = chargebee_config [ "client" ][ "app_id" ] chargebee . version = chargebee_config [ "client" ][ "version" ] chargebee . locale = chargebee_config [ "client" ][ "locale" ] chargebee . currency = chargebee_config [ "client" ][ "currency" ] chargebee . enable = chargebee_config [ "client" ][ "enable" ]

Benefits of Integration of Amazon CloudWatch and Chargebee

The process to integrate Amazon CloudWatch and Chargebee may seem complicated and intimidating. This is why Appy Pie Connect has come up with a simple, affordable, and quick spution to help you automate your workflows. Click on the button below to begin.

Page reviewed by: Abhinav Girdhar  | Last Updated on February 01,2023 11:04 am