> ## Documentation Index
> Fetch the complete documentation index at: https://ona.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Updating infrastructure directly using template URLs

<Warning>
  This guide is outdated. Please use the [Gitpod Enterprise Update](/classic/admin/update-gitpod/overview) guide instead.
</Warning>

Occasionally, it is necessary to update your Gitpod Dedicated infrastructure components to improve performance,
reliability, and security. This guide explains how to apply these updates using CloudFormation templates. Most
application updates can be applied directly and do not require infrastructure changes.

## Gitpod Dedicated Infrastructure Update Process

1. Receive the updated CloudFormation templates from your Gitpod Account Manager in the form of S3 URLs. Note that you will receive
   two templates.
2. Apply the two separate CloudFormation templates in this order:
   * **First**, update the stack for the infrastructure creation role (`gitpod-role`).
     * Important: When updating this stack, **do not select any role** under permissions.
   * **Then**, update the stack for the Gitpod Infrastructure (`gitpod-instance`).
     * Important: When updating this stack, **select the `GitpodSetupAndInitialEKSUserAdmin` role** under
       permissions. This role is created by the infrastructure creation role template.

Consult the [Infrastructure Update Changelog](/classic/admin/update-gitpod/infrastructure-update-changelog) or your
Gitpod Account Manager to determine which stacks need updates and the impact of the update in terms of downtime.

## Detailed Steps

### 1. Update Infrastructure Creation Role

1. Go to the AWS CloudFormation page and select the stack for the infrastructure creation role.
2. Choose "Create change set for current stack" in the stack actions.
3. Select "Replace current template", select Amazon S3 URL as the template source then paste the S3 url for the `gitpod-role` template into the field.
4. Follow the prompts in the AWS console UI.

<Warning>
  Under permissions **do not select any role**:

  <Frame caption="Update Permissions">
    <img src="https://mintcdn.com/gitpod-13c83c2b/1T56zcBWQ3jfH-V2/images/enterprise/permission-update-role-template.webp?fit=max&auto=format&n=1T56zcBWQ3jfH-V2&q=85&s=0a90e0a9d7edd531bd2017571952b00d" width="2438" height="1948" data-path="images/enterprise/permission-update-role-template.webp" />
  </Frame>
</Warning>

5. Acknowledge that IAM resources may be created and press "Submit".
6. Once a change set is published, verify the changes.
7. Execute the change set. Choose "Roll back all stack resources" for behavior on provisioning failure. Wait for the
   update to complete, and the status will change to `UPDATE_COMPLETE`.

### 2. Update Gitpod Infrastructure

1. Return to the AWS CloudFormation page and select the stack for the Gitpod Infrastructure.

   <Accordion title="Screenshot">
     <Frame caption="Configure AWS Environment Variables">
       <img src="https://mintcdn.com/gitpod-13c83c2b/1T56zcBWQ3jfH-V2/images/enterprise/navigate-aws-console.webp?fit=max&auto=format&n=1T56zcBWQ3jfH-V2&q=85&s=1eea6baa9807b483218734ea865eb3da" width="2856" height="2208" data-path="images/enterprise/navigate-aws-console.webp" />
     </Frame>
   </Accordion>

2. Select stack action, create change set for current stack

   <Accordion title="Screenshot">
     <Frame caption="Select stack from AWS console">
       <img src="https://mintcdn.com/gitpod-13c83c2b/VNRB7EABm4xr9DQd/images/enterprise/select-stack.webp?fit=max&auto=format&n=VNRB7EABm4xr9DQd&q=85&s=2d76a599da9c3dfd3a3469d57cf792ae" width="2900" height="2196" data-path="images/enterprise/select-stack.webp" />
     </Frame>
   </Accordion>

3. Select "Replace current template", select Amazon S3 URL as the template source then paste the S3 url for the `gitpod-instance` template into the field.

   <Accordion title="Screenshot">
     <Frame caption="Replace current template">
       <img src="https://mintcdn.com/gitpod-13c83c2b/1T56zcBWQ3jfH-V2/images/enterprise/replace-template.webp?fit=max&auto=format&n=1T56zcBWQ3jfH-V2&q=85&s=5c742c6db3fda636c59b11e1e7580ea0" width="2440" height="1552" data-path="images/enterprise/replace-template.webp" />
     </Frame>
   </Accordion>

4. Follow along in the process as described in the AWS console UI

<Warning>
  Under permissions ensure you select: **`GitpodSetupAndInitialEKSUserAdmin`** as the stack execution role. This role was created by applying a CloudFormation template supplied by Gitpod in the initial installation process.
  See [Getting started](/classic/admin/getting-started/overview) for more information.
</Warning>

<Frame caption="Update Permissions">
  <img src="https://mintcdn.com/gitpod-13c83c2b/1T56zcBWQ3jfH-V2/images/enterprise/permissions-update-gitpod-template.webp?fit=max&auto=format&n=1T56zcBWQ3jfH-V2&q=85&s=ac78d6bf2e908b5ce8598f5372140cf0" width="3214" height="1236" data-path="images/enterprise/permissions-update-gitpod-template.webp" />
</Frame>

6. Acknowledge that IAM resources may be created and press "Submit".

   <Accordion title="Screenshot">
     <Frame caption="ACK IAM Resources">
       <img src="https://mintcdn.com/gitpod-13c83c2b/1T56zcBWQ3jfH-V2/images/enterprise/ack-IAM-resources.webp?fit=max&auto=format&n=1T56zcBWQ3jfH-V2&q=85&s=a14dff89244f70b16a39c26a2eadf7b2" width="1872" height="706" data-path="images/enterprise/ack-IAM-resources.webp" />
     </Frame>
   </Accordion>

7. Once a change set is published, verify the changes.

   <Accordion title="Screenshot">
     <Frame caption="Set changes published">
       <img src="https://mintcdn.com/gitpod-13c83c2b/1T56zcBWQ3jfH-V2/images/enterprise/changes-published.webp?fit=max&auto=format&n=1T56zcBWQ3jfH-V2&q=85&s=724fef316863bfe927da816ca6852773" width="1369" height="877" data-path="images/enterprise/changes-published.webp" />
     </Frame>
   </Accordion>

8. Execute the change set. Choose "Roll back all stack resources" for behavior on provisioning failure. Wait for the update to complete. Execution will take a few minutes

   <Accordion title="Screenshot">
     <Frame caption="Execute set changes">
       <img src="https://mintcdn.com/gitpod-13c83c2b/1T56zcBWQ3jfH-V2/images/enterprise/execute-change-set.webp?fit=max&auto=format&n=1T56zcBWQ3jfH-V2&q=85&s=39c5f416eff95da5f99766c3c58c3637" width="873" height="526" data-path="images/enterprise/execute-change-set.webp" />
     </Frame>
   </Accordion>

   <Accordion title="Once done, the status will change to 'UPDATE_COMPLETE'">
     <Frame caption="Update completed">
       <img src="https://mintcdn.com/gitpod-13c83c2b/VNRB7EABm4xr9DQd/images/enterprise/update-complete.webp?fit=max&auto=format&n=VNRB7EABm4xr9DQd&q=85&s=9e5b27c499caa5e8dbe1170fe25addf8" width="2458" height="1784" data-path="images/enterprise/update-complete.webp" />
     </Frame>
   </Accordion>

Your Gitpod Dedicated infrastructure should now be updated successfully.
