AWS Supported Services
NightOps supports automated start/stop management for the following AWS services. These services can be safely turned off and restored without requiring manual reconfiguration.
Supported Services Overview
| Service | Stop Method | Start Method | Data Preserved | Config Preserved |
|---|---|---|---|---|
| EC2 | Stop Instance | Start Instance | ✅ | ✅ |
| RDS | Stop Instance | Start Instance | ✅ | ✅ |
| ECS | Scale to 0 | Restore Count | N/A | ✅ |
| EKS | Scale to 0 | Restore Size | ✅ (with PVC) | ✅ |
| Redshift | Pause | Resume | ✅ | ✅ |
| ASG | Scale to 0 | Restore Capacity | N/A | ✅ |
EC2 Instances
Amazon EC2 instances can be stopped and started without losing configuration or EBS data.
API Operations
| Operation | API Call | Description |
|---|---|---|
| List | DescribeInstances | List all EC2 instances with optional tag filters |
| Stop | StopInstances | Stop running instances (EBS-backed) |
| Start | StartInstances | Start stopped instances |
| Status | DescribeInstanceStatus | Check instance state |
What's Preserved
- ✅ EBS volumes and data
- ✅ Security groups
- ✅ IAM instance profile
- ✅ Private IP address
- ✅ Network interfaces
- ✅ Tags and metadata
Caveats
Public IP addresses change on restart unless an Elastic IP is assigned.
Instance store volumes lose data on stop. Only EBS-backed instances retain data.
Spot instances cannot be stopped, only terminated.
RDS Databases
RDS database instances can be stopped for up to 7 days, preserving all data and configuration.
API Operations
| Operation | API Call | Description |
|---|---|---|
| List | DescribeDBInstances | List all RDS instances |
| Stop | StopDBInstance | Stop a running database |
| Start | StartDBInstance | Start a stopped database |
| Status | DescribeDBInstances | Check instance status |
What's Preserved
- ✅ All data
- ✅ Parameter groups
- ✅ Security groups
- ✅ Endpoint DNS name
- ✅ Automated backups configuration
Caveats
AWS automatically restarts stopped RDS instances after 7 days. NightOps will re-stop instances if they're outside scheduled hours.
Cannot stop Multi-AZ deployments with SQL Server engine.
Read replicas cannot be stopped independently from their primary instance.
ECS Services
ECS services can be scaled to zero tasks and restored to their previous count.
API Operations
| Operation | API Call | Description |
|---|---|---|
| List | ListServices + DescribeServices | List all services in a cluster |
| Stop | UpdateService (desiredCount: 0) | Scale service to zero tasks |
| Start | UpdateService (desiredCount: N) | Restore to previous task count |
| Status | DescribeServices | Check running/desired count |
What's Preserved
- ✅ Task definition
- ✅ Service configuration
- ✅ Load balancer attachments
- ✅ Service discovery configuration
- ✅ Auto-scaling policies (paused at 0)
Caveats
Running tasks are terminated gracefully. New tasks are launched on scale-up with potentially different IPs.
NightOps stores the original desiredCount before scaling to zero for accurate restoration.
EKS Node Groups
EKS managed node groups can be scaled to zero nodes while preserving cluster configuration.
API Operations
| Operation | API Call | Description |
|---|---|---|
| List | ListNodegroups + DescribeNodegroup | List all node groups in a cluster |
| Stop | UpdateNodegroupConfig (desiredSize: 0) | Scale node group to zero |
| Start | UpdateNodegroupConfig (desiredSize: N) | Restore to previous size |
| Status | DescribeNodegroup | Check node group status |
What's Preserved
- ✅ Node group configuration
- ✅ Launch template
- ✅ IAM role
- ✅ Subnets and security groups
- ✅ Kubernetes labels and taints
Caveats
The EKS control plane still incurs cost (~$72/month) even with zero nodes.
Stateful workloads need PersistentVolumeClaims (EBS CSI or EFS) to retain data across scale events.
Scale-up takes 3-5 minutes for nodes to become ready and pods to be scheduled.
Redshift Clusters
Redshift clusters can be paused and resumed, preserving all data and configuration.
API Operations
| Operation | API Call | Description |
|---|---|---|
| List | DescribeClusters | List all Redshift clusters |
| Stop | PauseCluster | Pause a running cluster |
| Start | ResumeCluster | Resume a paused cluster |
| Status | DescribeClusters | Check cluster status |
What's Preserved
- ✅ All data
- ✅ Cluster configuration
- ✅ Endpoint DNS name
- ✅ Parameter groups
- ✅ IAM roles
Caveats
Resume typically takes 30-60 seconds.
Cannot pause a cluster with active queries. Ensure workloads are complete before scheduled stop time.
Auto Scaling Groups
Auto Scaling Groups can be scaled to zero capacity and restored to previous settings.
API Operations
| Operation | API Call | Description |
|---|---|---|
| List | DescribeAutoScalingGroups | List all ASGs |
| Stop | UpdateAutoScalingGroup (min/max/desired: 0) | Scale to zero instances |
| Start | UpdateAutoScalingGroup (restore values) | Restore to previous capacity |
| Status | DescribeAutoScalingGroups | Check current capacity |
What's Preserved
- ✅ Launch template/configuration
- ✅ Scaling policies
- ✅ Target groups
- ✅ Health check configuration
- ✅ Tags
Caveats
All instances are terminated on scale to zero. New instances are launched on scale-up with different IPs.
NightOps stores original minSize, maxSize, and desiredCapacity values for accurate restoration.
Unsupported Services
The following services cannot be safely automated without manual intervention:
| Service | Reason |
|---|---|
| ElastiCache | No stop functionality; delete loses endpoint |
| OpenSearch | No stop functionality; requires snapshot restore |
| NAT Gateway | Delete changes IP; breaks route tables |
| Load Balancers | Delete changes DNS; requires reconfiguration |
| SageMaker Endpoints | Delete requires manual endpoint config recreation |
Resource Tagging
For NightOps to manage resources, apply these tags:
nightops:managed = true
nightops:schedule = <schedule-id>
nightops:environment = staging | development | testing
Tag-Based Filtering Example
// List only NightOps-managed EC2 instances
const instances = await ec2Service.list({
managedOnly: true,
scheduleId: "schedule-123"
});
Multi-Account Support
NightOps supports managing resources across multiple AWS accounts using IAM role assumption.
Architecture
┌─────────────────┐ ┌─────────────────┐
│ Hub Account │ │ Spoke Account │
│ (NightOps) │────────▶│ (Customer) │
│ │ AssumeRole│ │
└─────────────────┘ └─────────────────┘
Setup Requirements
- Create
NightOpsRolein each spoke account - Configure trust policy to allow hub account to assume role
- Attach the NightOps IAM policy (see IAM Policy Reference)
// Cross-account access
const ec2 = new EC2Service({
region: "us-east-1",
roleArn: "arn:aws:iam::123456789012:role/NightOpsRole"
});
Next Steps
- IAM Policy Reference - Required permissions for NightOps