Bastion CLI Session Port Forwarding & ARM64 Support
With the latest release of Bastion we’ve introduced some new functionality and improved some existing as as well as added documentation to the readme.
What’s New
- Bastion now dynamically supports instance types with ARM64 architectures
- Bastion now provides the ablility to create a remote port forwarded session to a provided instance.
ARM64 Support
Bastion now detects the user specified instance type and dynamically selects the appropriate AMI based on the supported architecture of the instance type.
ARM64 Example
- The user launches a Bastion instance where the instance type specified is ‘c6g.large’ which only supports the ARM64 architecture.
- We observe the instance is launched successfully with the AMI used being dynamically selected as the appropriate ARM64 image.
Remote Port Forwarding
Bastion now provides the user the capabality to remote port forward to an instance via a configurable bastion instance. The feature provides inbuilt support to connect to RDS instances, however the ability to connect to other instance types such as EC2 exist via the ‘–remote host’ flag.
Port forwarding to an RDS instance example
- The user calls the function ‘port-forward’ with ‘remote-host’ set to the port we wish to forward from & ‘local-host’ set to the port to forward.to, furthermore the ‘remote-host’ flag can be used to specify an IP address of an instance to connect to. The user is then prompted to setup the bastion instance that will be used to tunnel to the instance. Note that all flags used for normally setting up a bastion instance can be used to configure this instance as needed.
- Once the bastion is launched the user is asked to select which RDS instance they wish to connect to. This only occurs if the user did not specify a remote host to connect to in the previous step.
- Bastion will then make the update the security groups to ensure connection between the bastion instance and remote host. The session is started once the connection is established.
- We are now able to connect to the RDS instance via our localhost on the selected local port which in our case is 5432 as specified in step 1. Note that if the local port is not specified it will default to the remote host value.
- Lastly, we terminate our session which in turn tears down our bastion instance and reverts any changes made to enable connections.