-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Description
There are several issues related to the handling of terminated EC2 instances in the up command. The current implementation has the following problems:
-
Existing Configuration Data:
- If an EC2 instance is manually terminated, the previous configuration data remains in the Treehouses config. This obsolete data can interfere with the proper functioning of the
upcommand.
- If an EC2 instance is manually terminated, the previous configuration data remains in the Treehouses config. This obsolete data can interfere with the proper functioning of the
-
Old SSH Tunnel Configuration:
- The old SSH tunnel configuration file and the obsolete SSH tunnel process may still exist. These remnants prevent the
upcommand from storing new configuration data into the Treehouses config and from controlling the new instance.
- The old SSH tunnel configuration file and the obsolete SSH tunnel process may still exist. These remnants prevent the
-
Obsolete SSH Tunnel Process:
- The presence of an obsolete SSH tunnel process can block the command from opening a new SSH tunnel.
Tasks
-
Clean Up Old Configuration Data:
- Add logic to the script to clean up any existing configuration data in the Treehouses config related to the terminated instance before storing new configuration data.
-
Remove Old SSH Tunnel Configuration:
- Ensure the script removes any old SSH tunnel configuration files and stops any obsolete SSH tunnel processes before opening a new SSH tunnel.
-
Update Script Logic:
- Enhance the script to handle these clean-up tasks automatically, ensuring that the
upcommand can store new configuration data, control the new instance, and open a new SSH tunnel without conflicts.
- Enhance the script to handle these clean-up tasks automatically, ensuring that the
Proposed Solution
Modify the up function in the script to include the following steps:
-
Check and Remove Old Configuration Data:
- Before creating a new EC2 instance, check if the instance state is
terminated. - If the instance state is
terminated, remove any existing configuration data in the Treehouses config related to the old instance.
- Before creating a new EC2 instance, check if the instance state is
-
Clean Up Old SSH Tunnel Configurations:
- Remove any old SSH tunnel configuration files.
- Stop any obsolete SSH tunnel processes.
-
Proceed with New Instance Creation:
- Create the new EC2 instance.
- Store the new configuration data into the Treehouses config.
- Open the new SSH tunnel.
This solution will ensure that the up command can handle terminated EC2 instances effectively and avoid conflicts with old configuration data and processes.
Metadata
Metadata
Assignees
Labels
No labels