|
1 | | -# rundeck-plugin-aws-ec2-ice-node-execution |
| 1 | +# AWS EC2 Instance Connect Endpoint Node Execution Plugin for Rundeck |
| 2 | + |
| 3 | +This plugin provides node executor and file-copier support to AWS EC2 via the Instance Connect Endpoint. |
| 4 | +Use this plugin if you must access servers via AWS EC2 Instance Connect Endpoint. |
| 5 | + |
| 6 | +It is based upon the openssh Bastion Node Execution Plugin, and shares similar characteristics. This should make it easier to extend/tweak for more AWS parameters in the future if required. |
| 7 | + |
| 8 | +The AWS CLI v2 must be installed and available to Rundeck. |
| 9 | + |
| 10 | +## Dry run mode |
| 11 | +You can configure the plugin to just print the invocation string to the console. |
| 12 | +This can be useful when defining the configuration properties. |
| 13 | + |
| 14 | +## Plugin Configuration Properties |
| 15 | +* AWS Access Key |
| 16 | +* AWS Secret Key - set to storage path location in Rundeck Keystore |
| 17 | +* AWS Default Region |
| 18 | +* Node SSH Key - set to storage path location in Rundeck Keystore |
| 19 | +* SSH Options: Extra options to pass to the ssh command invocation. |
| 20 | +* Template ssh_config: Customize ProxyCommand and other flags. Consult the reference for [ssh_config(5)](https://linux.die.net/man/5/ssh_config) to learn about posible settings. |
| 21 | +* Dry run? If set true, just print the command invocation that would be used but do not execute the command. This is useful to preview. |
| 22 | + |
| 23 | +## Node Specific Configuration Attributes |
| 24 | + |
| 25 | +* `ssh-key-storage-path` SSH key override - from the Rundeck Keystore. |
| 26 | +* `ssh-ssh-config` - SSH extra options override |
| 27 | +* `ssh-scp-config` - File Copier extra options override |
| 28 | + |
| 29 | +## Configuration |
| 30 | + |
| 31 | +The plugin can be configured as a default node executor and file copier for a Project. Use the Simple Conguration tab to see the configuration properties. The page has a form with inputs to configure the connection |
| 32 | + |
| 33 | +You can also modify the project.properties or use the API/CLI to define the plugin configuration. |
| 34 | + |
| 35 | +The Plugin List page will describe the key names to set. |
| 36 | + |
| 37 | +#### Customize the ssh_config |
| 38 | + |
| 39 | +You can define multiple lines using a trailing backslash and an indent on the following line. |
| 40 | + |
| 41 | +Here is an example that defines ssh_config file. |
| 42 | + |
| 43 | + project.plugin.NodeExecutor.openssh-bastion-host.node-executor.ssh_config=Host i-* \ |
| 44 | + StrictHostKeyChecking no |
| 45 | + Port 22 |
| 46 | + ProxyCommand aws ec2-instance-connect open-tunnel --instance-id @instance_id@ |
| 47 | + IdentityFile @plugin.config.identity_file@ |
| 48 | + |
| 49 | +Here ssh_options are set. |
| 50 | + |
| 51 | + project.plugin.NodeExecutor.openssh-bastion-host.node-executor.ssh_options="-q -oCiphers=arcfour -oClearAllForwardings=yes" |
| 52 | + |
| 53 | +Using Dry run, you might see output similar to this: |
| 54 | + |
| 55 | + [dry-run] +------------------------------------------+ |
| 56 | + [dry-run] | ssh_config | |
| 57 | + [dry-run] +------------------------------------------+ |
| 58 | + [dry-run] | Host i- * |
| 59 | + [dry-run] | StrictHostKeyChecking no |
| 60 | + [dry-run] | Port 22 |
| 61 | + [dry-run] | ProxyCommand aws ec2-instance-connect open-tunnel --instance-id i-123455678a01bcdefa |
| 62 | + [dry-run] | IdentityFile /tmp/bastion.ssh-keyfile.prWLUyFU |
| 63 | + [dry-run] +------------------------------------------+ |
| 64 | + [dry-run] ssh -q -oCiphers=arcfour -oClearAllForwardings=yes -F /tmp/ssh_config.zTr9j5KK -i /tmp/host1234.ssh-keyfile.4cjnI2qL ec2user@i-123455678a01bcdefa whoami |
| 65 | + Begin copy 18 bytes to node host1234: /etc/motd -> /tmp/motd |
| 66 | + [dry-run] +------------------------------------------+ |
| 67 | + [dry-run] | ssh_config | |
| 68 | + [dry-run] +------------------------------------------+ |
| 69 | + [dry-run] | Host * |
| 70 | + [dry-run] | StrictHostKeyChecking no |
| 71 | + [dry-run] | Port 22 |
| 72 | + [dry-run] | ProxyCommand aws ec2-instance-connect open-tunnel --instance-id i-123455678a01bcdefa |
| 73 | + [dry-run] | IdentityFile /tmp/bastion.ssh-keyfile.XXXXX.WAlpZLNb |
| 74 | + [dry-run] | |
| 75 | + [dry-run] +------------------------------------------+ |
| 76 | + [dry-run] scp -q -oCiphers=arcfour -oClearAllForwardings=yes -F /tmp/ssh_config.XXXX.cosJ7xQ2 -i /tmp/host1234.ssh-keyfile.XXXXX.BOqYAKRu /etc/motd ec2-user@i-123455678a01bcdefa:/tmp/motd |
| 77 | + /tmp/motd |
| 78 | + Copied: /tmp/motd |
| 79 | + |
| 80 | +## Docker |
| 81 | + |
| 82 | +An example Dockerfile is provided to install the AWS CLI v2 on the latest base Rundeck container from Dockerhub. |
| 83 | + |
0 commit comments