2

I added a new aws-ec2 source at rundeck and also inserted a rundeck-ec2 plugin at the libext folder. Everything is working but this new aws-ec2 node is not showing show at nodes.

Any idea what is happening and how to solve it?

Kelvin Lawrence
  • 14,674
  • 2
  • 16
  • 38
Kyaw Yea
  • 21
  • 2

1 Answers1

2

I leave the steps to use the ec2-plugin with Rundeck, in this guide I used Amazon Linux 2 as EC2 instance.

  1. Download the plugin from here, and put the .jar file on Rundeck libext directory.

  2. Check that the plugin is ready, go to the Gear icon (up to right) > Plugins > Installed Plugins, if you use the textbox to find "ec2" you can see that the plugin is well installed on your Rundeck instance.

  3. Now it's time to add your nodes, go to Project Settings (Rundeck sidebar) > Edit Nodes and click on "Add a new Node Source +" button. Then select "AWS EC2 Resources" from list.

    So, you need to pass some parameters to connect to your EC2 nodes. Focus on the "Access Key", "Secret Key" and "Endpoint" textboxes.

    You can get the first and second one going to your AWS profile link (Up to right on AWS) > "My Security Credentials" > and click on "Create access key" button, that generates the Access Key ID and Secret Key (also, you can use some Access Key ID/Secret access key created before).

    The third one ("Endpoint"), it's an HTTPS URL with your instance Endpoint, for example, if your EC2 nodes are in US East (N. Virginia) Zone, you need to put https://ec2.us-east-2.amazonaws.com, you can see all endpoint codes here.

  4. If you click on "Nodes" (Rundeck sidebar) you can see your EC2 nodes listed.

  5. Now, you need to access them, for that you have two methods.

    5a. Using the AWS .pem file: Click on the Gear Icon (up to right) > Key Storage and add a new Private key with the .pem file content, give it a name, and save it. Now go to Edit Configuration (Rundeck Sidebar) > Default Node Executor tab and reference your Key Storage entry on "SSH key Storage Path" textbox, save it.

    5b. Like any SSH remote node: Just add the rundeck user (or the user that launches Rundeck) public key (id_rsa.pub file) content on the autorized_keys (/home/ec2-user/.ssh/autorized_keys), and now the EC2 node trusts the Rundeck instance.

  6. Run any command against your nodes on the Rundeck's Commands page.

You can see the full documentation here and here a video about Rundeck and EC2 usage.

MegaDrive68k
  • 3,768
  • 2
  • 9
  • 51