App Connect

 View Only

Using IBM® App Connect to interact with Amazon EC2

By Shahmini Arumugam posted Fri October 07, 2022 02:56 AM

  

Co-author – Srihari Ananda Kumar 

The Amazon Elastic Compute Cloud (Amazon EC2) is a web-based service that provides scalable computing capacity that allows businesses to run application programs in the Amazon Web Services (AWS) Cloud.

Building a flow in IBM App Connect with Amazon EC2

 

Use App Connect to build flows that integrate with Amazon EC2 and other applications. The connector is displayed as Amazon EC2 on the App Connect User Interface (UI).

To allow App Connect to connect to your Amazon EC2 account, you need to fill in the connection fields that you see in the App Connect Designer Catalog page or flow editor. For more information on connection fields, see How to use IBM App Connect with Amazon EC2.

Amazon EC2 objects

The following are Amazon EC2 action objects that can be run in App Connect.

Objects

Description

Amazon Machine Images

 

 

An Amazon Machine Image (AMI) is the basic unit of deployment in Amazon EC2 and is one of the types of images you can create with Image Builder.

 

Availability zones

Availability zones are a collection of distinct areas in each region.

Instance types

Instance types include various combinations of CPU, memory, storage, and networking capacity.

 Instances

An Amazon EC2 instance is a virtual server on Amazon Web Services.

 Key pairs

A key pair, consisting of a public key and a private key, is a set of security credentials used to connect to an Amazon EC2 instance.

Launch templates

A launch template specifies instance configuration information.

Security groups

A security group acts as a virtual firewall for EC2 instances to control incoming and outgoing traffic.

Scenario 1: Stop, start or reboot the Amazon EC2 instance whenever a Zendesk Service ticket gets created

Consider this scenario; you are an IT personnel with permission to manage Amazon EC2 instances. You can start, stop, or reboot the instances whenever a Zendesk Service ticket gets created.

In this example, the flow checks the Zendesk Service ticket’s subject to whether to start, stop, or reboot the Amazon EC2 instance based on the instance ID from the Zendesk Service ticket. A slack message gets sent to notify the intended channel that the instance has been started, stopped, or rebooted.


In this flow:

    1. The event-driven flow is triggered whenever a new ticket gets created in Zendesk Service.
    2. If the Zendesk Service ticket Subject is equals to Stop Instance Request, Amazon EC2 stops the instance based on the Zendesk Service instance ID.
    3. If the Zendesk Service ticket Subject is equals to Start Instance Request, Amazon EC2 starts the instance based on the Zendesk Service instance ID.
    4. If the Zendesk Service ticket Subject is equals to Reboot Instance Request, Amazon EC2 reboots the instance based on the Zendesk Service instance ID.
    5. For each request, a Slack message gets sent to the intended channel. This message is sent to notify you whether the instance has started, stopped, or rebooted.

      For  example:
 
       6. Else, if the Zendesk Service ticket Subject doesn’t fit the above conditions, it exits the flow.



Scenario 2: Launch an Amazon EC2 instance whenever a new row is appended in Google Sheets requesting to launch the instance

Consider this scenario where you can launch an Amazon EC2 instance whenever a new row is appended in the Google Sheets worksheet. The worksheet has AMI (Availability Machine Images) related parameters. It checks for the column value that indicates whether to launch the instance. An email is then sent from your Gmail account to the intended recipient to notify them that the instance has been launched.

 

In this example, we have a Google Sheets worksheet saved with the AMI (Availability Machine Images) parameters such as Min count, Max count, AMI ID, and Launch Immediately columns.


In this flow:

  1. The action-driven flow is triggered whenever a new row is appended to the Google Sheets worksheet.
  2. If the newly appended row has a Y value in the Launch Immediately column, a Slack message gets sent to the intended channel with the launch configuration details.

    For example:


    • The launch configuration details the Max count, Min count, AMI ID, and Launch Immediately values.
    • The Y value in the Launch Immediately column indicates that the instance needs to be launched.
  3. Based on the launch configuration values, Amazon EC2 launches the instance.
  4. An email gets sent from your Gmail account to the intended recipients to notify them that the instance has been created.
  5. Else, if the above condition is not met, it exits the flow.


Resources

Try out our templates

You can view the following use cases in the Templates gallery in your App Connect Designer instance.

  • Stop, start or reboot the Amazon EC2 instance whenever a Zendesk Service ticket gets created

    Template URL: https://<your-instance-id>/templates/Stop%20or%20start%20or%20reboot%20the%20Amazon%20EC2%20instance%20whenever%20a%20Zendesk%20Service%20ticket%20gets%20created

  • Launch an Amazon EC2 instance whenever a new row is appended in Google Sheets requesting to launch the instance

    Template URL: https://<your-instance-id>/templates/Launch%20an%20Amazon%20EC2%20instance%20whenever%20a%20new%20row%20is%20appended%20in%20Google%20Sheets%20requesting%20to%20launch%20the%20instance

You must enable the Designer AI features in your containerized environment in order to access the App Connect templates. For more information, see The preloaded IBM App Connect templates.

You can also import these use cases directly into your App Connect Designer. These templates are added to a public GitHub repository at https://github.com/ot4i/app-connect-templates/tree/cp4i-templates/resources.

0 comments
157 views

Permalink