Amazon EC2

You can use JAMS to help manage your Amazon EC2 instances. The AmazonEC2 Execution Method lets you create a Job to perform the following actions on an EC2 instance:

  • Reboot a running EC2 instance
  • Start an EC2 instance
  • Stop an EC2 instance
  • Terminate (delete) an EC2 instance

The Execution Method has a menu that lets you select one of the actions listed above.

Before You Begin

Ensure you have the following for the EC2 instance:

  • The Instance ID
  • The Region
  • Access Key ID and Secret Access Key from AWS Identity and Access Management (IAM) for the user associated with the EC2 instance.
NOTE: To use the AmazonEC2 Execution Method, ensure the JAMS Scheduler and JAMS Client are running 7.9.0 or higher.

Creating Credentials

You need two Credentials in JAMS to run an Amazon EC2 Job:

  • A Credential is used to store the Access Key ID and Secret Access Key from AWS Identity and Access Management (IAM) for the user associated with the EC2 instance.
  • A Credential is used to run the Job in JAMS.

See Working with Credential Definitions for more information on creating a Credential.

Creating a Connection Store Item for Amazon EC2

To connect to an EC2 instance, you need a Connection Store item in JAMS. See Connections for Integrations for the steps to configure the Connection.

Creating a Job for an EC2 Instance

  1. Click Definitions from the JAMS Shortcuts menu.
  2. Click a Folder where the Job will be saved.
  3. Click +.
  4. In the Name field, enter a name for the Job.
  5. In the Execution Method field, select AmazonEC2.
  6. Click Ok.
  7. In the Connection Type field, select the Connection Store item that you created.
  8. In the Operation field, select one of the following actions:
    • Reboot
    • Start
    • Stop
    • Terminate
  9. In the Change Timeout (In Seconds) field, enter the number of seconds to wait for the EC2 instance to enter the desired state.
    The default value is 300 seconds. The Job will fail if the EC2 instance does not enter the desired state within this wait time. Using zero will cause the Job to wait infinitely.
  10. Select the Fail on Invalid Action checkbox to set the JAMS Job to fail if the EC2 instance is already in the desired state. If the checkbox is cleared, the JAMS Job will continue even if the EC2 instance did not require any changes. By default, this option is not enabled.
  11. Click the Schedule tab to add schedule items to set when the Job will run.
  12. Click the Properties tab.
  13. In the Execute As field, select the JAMS Credential to run the Job.
  14. In the Agent field, select the Agent if the Job will not run on the Scheduler.
  15. Click Save and Close.

Canceling the Job

You can cancel a JAMS Job that is running an action on an EC2 instance. When the Job is canceled, it will fail and stop waiting for the state of the EC2 instance to change. The action being performed on the EC2 instance may not be canceled.

  1. Click Monitor from the JAMS Shortcuts menu.
  2. Right-click the Job that is running and select Cancel.
  3. Click Yes.