Skip to content

How to Detach BFD Server Instances for Development or Debugging

Brandon Cruz edited this page Oct 14, 2023 · 2 revisions

How to Detach BFD Server Instances for Development or Debugging

Follow this runbook to safely detach a BFD server instance for development or debugging using the AWS Console. It is assumed you have already signed in to the AWS Console while following the runbook.

Scale Out to Avoid Potential Performance Degradation

  1. Navigate to the Auto Scaling Groups page, it is located under the EC2 service.
  2. Click on the listed group corresponding to the desired environment. 1. i.e. if TEST is the desired environment, click on bfd-test-fhir...
  3. On the Details tab, choose Group details, Edit.
  4. Increment the desired capacity by one. For example, if the current value is 6, enter 7.
    1. The desired capacity must be less than or equal to the maximum size of the group. If your new value for Desired capacity is greater than Maximum capacity, you must update Maximum capacity.
  5. When you are finished, choose Update.

Once you've verified that your Auto Scaling group has launched one additional instance, you are ready to detach the instance.

Detach the Instance

NOTE: Before detaching an instance, ensure you have already scaled out the Auto Scaling Group to avoid potential performance degradation.

  1. Navigate to the Auto Scaling Groups page, it is located under the EC2 service.
  2. Click on the listed group corresponding to the desired environment.
    1. i.e. if TEST is the desired environment, click on bfd-test-fhir...
  3. On the Instance management tab, in Instances, select the checkbox for the instance and choose Actions, Detach.
  4. In the Detach instance dialog box, leave the checkbox to launch a replacement instance unchecked. Choose Detach instance.

Once you've verified that your instance has successfully detached, you are ready to rename the instance.

  1. In the Auto Scaling Group list, the detached instance will still exist in the group; note the ID of the instance.
  2. Go to Services > EC2 and click Instances
  3. Find the detached instance by its ID in the list
  4. Click the Edit button near the ID of the detached instance and rename it "[ORIGINAL INSTANCE NAME]-[FIRST INITIAL][LAST NAME]". E.g., bfd-test-fhir-jsmith if the original name is bfd-test-fhir and the user's full name is John Smith.

Once you've verified that your instance has been renamed, you are ready to scale back in its Auto Scaling Group.

Scale In After Detaching an Instance

NOTE: This should almost never be done without having first recently scaled out the Auto Scaling Group.

  1. Navigate to the Auto Scaling Groups page, it is located under the EC2 service.
  2. Click on the listed group corresponding to the desired environment.
    1. i.e. if TEST is the desired environment, click on bfd-test-fhir...
  3. On the Details tab, choose Group details, Edit.
  4. Decrement the desired capacity by one. For example, if the current value is 7, enter 6.
  5. When you are finished, choose Update.

Patching Regularly When Instances Endure Beyond ~1 Day

Detached instances should be terminated as soon as possible, however, for those instances living beyond ~1 day, we should be mindful of any updates which may need to be applied.

Some examples:

  1. Performing yum update on the detached server instance.
  2. Noting any updates to the AMI the server instance is built from, and applying those updates to the instance as needed.

Terminating the Instance

  1. Navigate to the EC2 services page.
  2. Click on Instances (running) and select the instance.
  3. In the details page which opens, click the Instance state dropdown and select Terminate instance.
  4. Choose Terminate when prompted for confirmation.
Clone this wiki locally