SFTP Gateway does not have an in-place upgrade process. Rather, you will need to spin up an additional CloudFormation stack for the new version, and migrate your users and settings as well as other resources you would like to keep.
If you want to attach the previous Elastic IP Address to your new instance, you would have to first take the IP from the old instance, and then associate it with the new one. This is the fastest and simplest way to perform a cutover. Also, you can quickly revert if something goes wrong.
This article goes over the process of taking the IP Address from your previous instance and associating it with the new instance, as well as how to retain the IP Address resource if you want to delete the previous CloudFormation stack.
Elastic IP Address cutover process
First, disconnect the Elastic IP from the original EC2 instance.
- Go to
Network & Security->
- Find the IP Address that is associated your original instance
- Under Actions, choose Dissociate Elastic IP Address
Second, attach the Elastic IP to the new EC2 instance.
- Select the disassociated Elastic IP
- Under Actions, choose Associate Elastic IP Address
- Select the new EC2 instance
Deleting your old stack without losing your original Elastic IP
After migrating to a new stack, you may not want to keep your previous one. Deleting the original CloudFormation stack can be a problem, because the original Elastic IP address also gets deleted.
To retain the original Elastic IP, you need to use a CloudFormation
For example, you will need to deploy the following change to the
IPAddress resource in the CloudFormation template:
The EIP resource (named
IPAddress) would look something like this:
IPAddress: DeletionPolicy: Retain Properties: Domain: vpc InstanceId: !Ref 'SFTPGatewayInstance' Type: AWS::EC2::EIP
DeletionPolicy: Retain has the effect of keeping the CloudFormation resource when the rest of the stack is deleted.
See this article for more details: