You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Coder workspaces on AWS currently lack persistent state across workspace stop/start cycles beyond basic EC2 stop functionality. Users need the ability to snapshot their workspace state and resume from selected snapshots.
Proposed Solution
Create a Terraform module that enables AMI-based snapshots of EC2 instances when workspaces are stopped, with user-specified labels and selection options for workspace start.
Implementation Steps
Create AMI snapshots on workspace stop
Use aws_ami_from_instance resource triggered by coder_workspace.me.transition == "stop"
Tag AMIs with workspace owner, name, label, and creation timestamp
Add user parameters for snapshot control
Implement coder_parameter resources for:
Enable/disable snapshot functionality
Custom snapshot labels
Option to start from previous snapshots
Retrieve available snapshots
Use aws_ami data source with filters on Coder-specific tags
Format snapshot metadata for selection dropdown
Modify instance creation
Create a local.ami_id variable that selects user snapshot or default AMI
Update aws_instance resource to use this dynamic AMI ID
Problem
Coder workspaces on AWS currently lack persistent state across workspace stop/start cycles beyond basic EC2 stop functionality. Users need the ability to snapshot their workspace state and resume from selected snapshots.
Proposed Solution
Create a Terraform module that enables AMI-based snapshots of EC2 instances when workspaces are stopped, with user-specified labels and selection options for workspace start.
Implementation Steps
Create AMI snapshots on workspace stop
aws_ami_from_instance
resource triggered bycoder_workspace.me.transition == "stop"
Add user parameters for snapshot control
coder_parameter
resources for:Retrieve available snapshots
aws_ami
data source with filters on Coder-specific tagsModify instance creation
local.ami_id
variable that selects user snapshot or default AMIaws_instance
resource to use this dynamic AMI IDlifecycle { ignore_changes = [ami] }
to prevent Terraform conflictsImplement optional cleanup
aws_dlm_lifecycle_policy
for snapshot retention managementKey Considerations
The text was updated successfully, but these errors were encountered: