# AWS Elastic Beanstalk via CloudWatch

[<mark style="color:blue;">AWS Elastic Beanstalk</mark>](https://aws.amazon.com/elasticbeanstalk/) is an easy-to-use service for deploying and scaling web applications and services developed with Java, .NET, PHP, Node.js, Python, Ruby, Go, and Docker on familiar servers such as Apache, Nginx, Passenger, and IIS.

Route detailed monitoring alerts from AWS Elastic Beanstalk via CloudWatch to the right users in Squadcast.

### How to integrate AWS Elastic Beanstalk with Squadcast using Amazon CloudWatch

1. Navigate to **Services** -> **Service Overview** -> select or search for your Service. Expand the accordion -> In the Alert Sources section, click **Add**.

<figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-4fbd74e7ca0b30173c47a1d58ed6a0804a0465aa%2FAlert_Sources.png?alt=media&#x26;token=aaca6610-9d18-4dd4-9cf5-320042f326f1" alt="How to configure AWS Elastic Beanstalk integration in Squadcast" width="563"><figcaption></figcaption></figure>

2\. Select **AWS Elastic Beanstalk via CloudWatch.** Copy the displayed **Webhook URL** to [configure](#create-a-squadcast-webhook-in-amazon-sns) it within **AWS Elastic Beanstalk via CloudWatch**. Finish by clicking **Add Alert Source** -> **Done**.

<figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-94489c3d7f510020f995a075be31122b44364431%2Fbeanstalk_00.png?alt=media&#x26;token=2c7e36e2-5308-45d1-8c7a-1bce6757ae5c" alt="Steps to add AWS Elastic Beanstalk integration to a service in Squadcast" width="563"><figcaption></figcaption></figure>

{% hint style="warning" %} <mark style="color:orange;">**Important**</mark>**:**

When an alert source turns <mark style="color:green;">Active</mark>, it’ll show up under Configured Alert Sources. You can either generate a test alert from the integration or wait for a real-time alert to be generated by the Alert Source.\
\
An Alert Source is <mark style="color:green;">active</mark> if there is a recorded incident via that Alert Source for the Service.
{% endhint %}

### Create a Squadcast Webhook in Amazon SNS

Log in to your AWS account and proceed to **Simple Notification Service - SNS**

**(1)** From the sidebar on the left, select **Topics**

<figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-ad63bbcb2b60ec917d314e2b529f267c260b5e31%2Faws_2_a.png?alt=media&#x26;token=267cad23-049e-4b2c-a218-fe63803130a0" alt="Create a Squadcast Webhook in Amazon SNS" width="563"><figcaption></figcaption></figure>

**(2)** Click on **Create Topic**

<figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-505d0a9363d40c2160417384fe132bc4e2b9c5d8%2Faws_2_b.png?alt=media&#x26;token=b8509596-fa5d-462d-a052-27254a8e240e" alt="Create a topic in Amazon SNS" width="563"><figcaption></figcaption></figure>

Fill in the details as per your requirements and then click on **Create Topic**

<figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-0a8924ab5c34f5bc19c35952cd7e64dbc3919b51%2Faws_2_c.png?alt=media&#x26;token=94a001aa-a1f1-453d-b787-463f0d8a03bd" alt="Filling the topic details in Amazon SNS" width="563"><figcaption></figcaption></figure>

**(3)** Now, click on **Create Subscription**

<figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-2710029e2b739b6d40cb108a9b7746ba25920c22%2Faws_3_a.png?alt=media&#x26;token=70bcafc2-acf8-4281-bcdd-e63db89af3b4" alt="Create a Subscription in Amazon SNS" width="563"><figcaption></figcaption></figure>

**(4)** Here, select the **Protocol** as **HTTPS** and under **Endpoint**, paste the previously copied Webhook URL from Squadcast

**Note**: Ensure that the **Raw Message Delivery** checkbox is **disabled**.

Finally, click on **Create Subscription** to create the subscription.

<figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-2d71a4b48f6433c6c5097c5d0ae28c1e4ddedce6%2Faws_3_b.png?alt=media&#x26;token=b607a3c7-7e4a-457f-9fb2-f99957ef59c9" alt="Configuring Amazon SNS Subscription: HTTPS protocol and Squadcast Webhook URL in create subscription" width="563"><figcaption></figcaption></figure>

**(5)** The **Subscription ID** for this Subscription should immediately change from **PendingConfirmation** to **Confirmed**. Click on the *refresh button* to verify the same

<figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-405c73dc22d0a560fa0c266e7b8971907d778e38%2Faws_4_a.png?alt=media&#x26;token=9d839e05-c3f1-4500-8e58-a431dd940907" alt="Confirmation of Subscription: Verify immediate change from PendingConfirmation to Confirmed by refreshing the page" width="563"><figcaption></figcaption></figure>

### Configure Amazon CloudWatch within AWS Elastic Beanstalk

**(1)** In AWS Elastic Beanstalk, within your **Environment**, navigate to **Monitoring**

<figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-dde44d7c1393eea3451b3a21fbaa9962f52a93f3%2Faws_elastic_1.png?alt=media&#x26;token=96d941cc-5d94-450c-baa6-4df047f26961" alt="Configure Amazon CloudWatch within AWS Elastic Beanstalk - within your Environment, navigate to Monitoring" width="563"><figcaption></figcaption></figure>

**(2)** Click on the **bell icon** on the graphs for which you want to create an Alarm and route alerts to Squadcast

<figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-f33930e7f42c3aff8be5a304d0d98563fc466fae%2Faws_elastic_2.png?alt=media&#x26;token=46cd5591-c06b-45b6-9654-d6ce5c9fff16" alt="Configure Amazon CloudWatch within AWS Elastic Beanstalk - create an Alarm and route alerts to Squadcast" width="563"><figcaption></figcaption></figure>

**(3)** Configure the required parameters in the **Add Alarm** dialog box. In the **Notify** drop-down, select the **Subscription** that was previously created. Under **Notify when state changes to**, enable **OK** and **Alarm** checkboxes. Finally, click on **Add** to create the Alarm

<figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-3d3a66aaa88285a34c50248daf892147b0aff19b%2Faws_elastic_3.png?alt=media&#x26;token=e320b87c-5e3c-43c4-b3ca-bef862723c57" alt="Add Alarm and Notify when state changes to, enable OK and Alarm checkboxes" width="563"><figcaption></figcaption></figure>

That is it, you are now good to go!

Whenever an Alarm is triggered in AWS Elastic Beanstalk, an incident will be automatically created in Squadcast. Whenever, an Alarm is resolved in AWS Elastic Beanstalk, the corresponding incident is **auto-resolved in Squadcast** as well.

*Have any questions?* [*Ask the community*](https://community.squadcast.com/view/home)*.*
