# Upgrading

From time to time new versions of the On Premises AMI will be released. The upgrade operation requires far less steps than the initial installation. Basically there are 3 things we need to do:

* &#x20;Launch the new AMI reusing the same Security Group as in the old instance (which is already correctly configured)
* Assign the same IAM role we used on the previous instance so that the new one can access the parameter store.
* Update the Target Group used by the Load Balancer so that we remove the old instance and add the new one.

### Launch the new AMI

Since all state required by the service is stored in postgres and in AWS Param Store, we just need to launch the new AMI, but choosing manually the same Security group as we used on the previous version.

![](/files/Bx2RQgxxtm2cufsoflhF)

### Assign the IAM Role

Chose the newly created instance and click on the Modify IAM Role option:

![](/files/9cP8lWc3QCZyEYNZx71j)

Choose the same IAM Role we used for the old instance:

![](/files/0JvoClLXApCOOCse6CG1)

You will need to Reboot your instance so that the new IAM role gains effect.

### Update Target Groups

Next, when the instance is up and running we must also update the Target group used by our load balancer so that it points to the new instance.

![](/files/Q8dDYDvJ7wvNWL5YF1nj)

Register the new target and wait until it gets "healthy".

![](/files/uy6TnpaTr5rcy72wiE01)

You can now deregister the old target so that only the new one will get traffic.  You should be able to navigate to the domain that points to the load balancer and test the new instance.

Finally pause or terminate the old instance since it is not used anymore.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.taskforce.sh/on-premises/aws/upgrading.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
