feat(validation): add numeric range guards to all three AWS tier modules#16
Open
dmchaledev wants to merge 1 commit into
Open
feat(validation): add numeric range guards to all three AWS tier modules#16dmchaledev wants to merge 1 commit into
dmchaledev wants to merge 1 commit into
Conversation
Terraform silently accepts out-of-range values (e.g. db_allocated_storage_gb = 5, redis_snapshot_retention_days = 40) until the AWS API rejects them at apply time. Adding validation blocks shifts that failure left to terraform validate / plan. Constraints applied: - EBS volumes: 1–16384 GB (gp3 physical limit) - RDS Postgres storage: 20–65536 GB (engine minimum / RDS maximum) - RDS backup retention: 0–35 days (RDS hard limit) - ElastiCache snapshot retention: 0–35 days (ElastiCache hard limit) - RDS Performance Insights retention: 7 or 731 (only two valid values) - ALB idle timeout: 1–4000 s (ALB documented range) - Rollback 5xx threshold: 0–100 % - ASG min/max/desired: ≥ 1 - ASG scaling targets: within documented AWS ranges - S3 Object Lock / lifecycle retention: ≥ 1 day Azure tier modules (ha-hot-hot/azure, unlimited-scale/azure, single-vm/azure) have equivalent gaps and should be addressed in a follow-up. https://claude.ai/code/session_01RNxQACZc1QFiPu1zWDreGe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
single-vm/aws,ha-hot-hot/aws,unlimited-scale/aws) had novalidationblocks. Out-of-range values (e.g.db_allocated_storage_gb = 5,redis_snapshot_retention_days = 40) were silently accepted by Terraform and only rejected by the AWS API at apply time — after IAM calls, resource creation, and state writes had already begun.validation { condition … error_message … }blocks to every numeric variable where AWS/ElastiCache/ALB enforces a documented hard limit. All defaults are within the new ranges, so no caller is broken.Variables covered
backup_object_lock_retention_daysbackup_noncurrent_version_expiration_daysredis_snapshot_retention_daysredis_endpoint_override_portdb_allocated_storage_gbdb_max_allocated_storage_gbrds_performance_insights_retention_daysrefresh_rollback_5xx_threshold_pctdata_volume_size_gbroot_volume_size_gbalb_idle_timeout_secondsalb_access_log_retention_daysdb_ec2_data_volume_size_gbrds_backup_retention_periodasg_min_size/asg_max_size/asg_desired_capacitytarget_cpu_utilizationtarget_request_count_per_targetdb_backup_retention_daysdb_read_replica_countaccess_log_retention_daysinstance_refresh_min_healthy_percentageinstance_refresh_instance_warmup_secondsTest plan
terraform validatepasses on all three modules (CI gate)tflintpasses (CI gate)db_allocated_storage_gb = 5) is rejected atterraform validatetime with the new error messageFollow-up
Azure tier modules (
single-vm/azure,ha-hot-hot/azure,unlimited-scale/azure) have the same gaps. A parallel PR should apply the equivalent Azure-API-constrained ranges (ARM storage, Azure Cache for Redis, Application Gateway, etc.).https://claude.ai/code/session_01RNxQACZc1QFiPu1zWDreGe
Generated by Claude Code