-
Notifications
You must be signed in to change notification settings - Fork 34
AWS AMI Snapshot Module for Persistent Workspace State #219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
mavrick@killmonger:~/Desktop/bounty/registry$ bun x prettier --check **/*.sh **/*.ts **/*.md *.md && terraform fmt -check -recursive -diff
Checking formatting...
cmd/readmevalidation/testSamples/sampleReadmeBody.md/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
CONTRIBUTING.md/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
examples/modules/README.md/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
README.md/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
registry/coder/modules/agentapi/README.md/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
registry/coder/modules/aider/README.md/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
registry/coder/modules/amazon-dcv-windows/README.md/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
registry/coder/modules/amazon-q/README.md/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
registry/coder/modules/aws-region/README.md/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
registry/coder/modules/azure-region/README.md/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
registry/coder/modules/claude-code/README.md/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
registry/coder/modules/code-server/README.md/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
registry/coder/modules/coder-login/README.md/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
registry/coder/modules/cursor/README.md/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
registry/coder/modules/devcontainers-cli/README.md/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
registry/coder/modules/dotfiles/README.md/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
registry/coder/modules/filebrowser/README.md/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
registry/coder/modules/fly-region/README.md/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
registry/coder/modules/gcp-region/README.md/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
registry/coder/modules/git-clone/README.md/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
registry/coder/modules/git-commit-signing/README.md/bin/sh: 1: terraform: not found
Unable to format Terraform file: /bin/sh: 1: terraform: not found
getting this error i got Terraform installed |
Are you sure that you followed the proper install instructions in the contribution docs for the terraform installation? If you have installed this and then run bun install in the root of the repo this should run with no issues. The only time I have seen this specific issue is when I myself had forgotten to install terraform properly. For formatting you would just want to call: |
![]() |
i will try uninstalling it , then reinstalling it hope that solves ths issue |
Description
This PR implements AMI-based snapshots for Coder workspaces on AWS, enabling persistent state across workspace stop/start cycles. Users can now create snapshots of their workspace state when stopping and restore from selected snapshots when starting workspaces.
Solves GitHub Issue #26 - AWS Snapshot functionality for persistent workspace state.
Type of Change
Module Information
Path:
registry/mavrickrishi/modules/aws-ami-snapshot
New version:
v1.0.0
Breaking change: [ ] Yes [x] No
Implementation Details
All Requirements from Issue #26 Implemented:
✅ Requirement 1: Create AMI snapshots on workspace stop
aws_ami_from_instance
resource triggered bycoder_workspace.me.transition == "stop"
✅ Requirement 2: Tag AMIs with workspace metadata
✅ Requirement 3: User parameters for snapshot control
enable_snapshots
- Toggle snapshot creation (default: true)snapshot_label
- Custom label for snapshots (optional)use_previous_snapshot
- Dropdown to select from available snapshots✅ Requirement 4: Retrieve available snapshots
aws_ami_ids
data source with Coder-specific tag filters✅ Requirement 5: Modify instance creation
local.ami_id
variable selects user snapshot or default AMIlifecycle { ignore_changes = [ami] }
prevents Terraform conflicts✅ Requirement 6: Optional cleanup
aws_dlm_lifecycle_policy
for snapshot retention management✅ Requirement 7: Key considerations
Testing & Validation
Comprehensive Test Suite
Created comprehensive test script that validates ALL requirements from issue #26:
🔧 Comprehensive Test Script (Click to expand)
Test Results Summary
bun test
- validates module structure)bun run fmt
- all files properly formatted)terraform validate
- configuration is valid)Module Structure
Namespace Structure
Key Features Implemented
🎯 Core Functionality:
🔧 Technical Implementation:
ignore_changes = [ami]
🎛️ User Experience:
💰 Cost Management:
Security & IAM
Required IAM Permissions:
Usage Example
Related Issues
Video Demonstration
Screencast.from.2025-07-12.15-57-09.mp4
Screencast.from.2025-07-12.15-59-23.mp4