- Newest
- Most votes
- Most comments
Yes, it is possible to change your EC2 instance type from t3.medium to t3.small without terminating and creating a new instance, as long as your instance is EBS-backed (which yours is). This process is called "resizing" an instance.
Here's how to change your instance type:
- First, back up your data as a precautionary measure.
- Stop your EC2 instance (this is required as you cannot change the instance type while it's running).
- Once the instance is stopped, select it in the EC2 console.
- Go to "Actions" > "Instance Settings" > "Change Instance Type".
- In the "Change Instance Type" dialog, select "t3.small" as the new instance type.
- Click "Apply" to confirm the change.
- Start your instance again.
Alternatively, you can use the AWS CLI to modify the instance type with the following command (while the instance is stopped):
aws ec2 modify-instance-attribute --instance-id your-instance-id --instance-type "{\"Value\": \"t3.small\"}"
Regarding your EBS volume size concern: Downgrading from t3.medium to t3.small will not affect your EBS volume size. The 20 GiB EBS volume will remain the same size regardless of the instance type change. Instance type changes only affect compute resources (vCPUs and memory), not storage. Your Docker images and data stored on the EBS volume will be preserved.
The main differences between t3.medium and t3.small are:
- t3.medium: 2 vCPUs, 4 GiB memory
- t3.small: 2 vCPUs, 2 GiB memory
Before proceeding with the change, verify that your workload can run with less memory. If your Docker containers and applications require more than 2 GiB of memory, you might experience performance issues after downgrading.
The instance will retain all its configuration, data, and settings after the change. Your IP address might change unless you're using an Elastic IP address.
Sources
Change EC2 instance type | AWS re:Post
Amazon EC2 instance type changes - Amazon Elastic Compute Cloud
Use ModifyInstanceAttribute with a CLI - Amazon Elastic Compute Cloud
How I can change my server? | AWS re:Post
answered a year ago
Instance size and EBS volume size are separate. You can modify both without impacting the other. To modify EC2:
- Stop the instance
- From console or CLI, change instance type / size (higher or lower size doesn't matter)
- Start the instance.
To increase EBS volume size:
- No need to stop instance
- Open volume in console
- State new size (has to be higher than current)
To decrease EBS volume size is not directly possible and requires more effort. If you need help with that, let me know.
Relevant content
asked a year ago
