bring ec2 module into alignment with ecs-web and matching standards + fixes#67
Merged
Conversation
mabadir
approved these changes
Jul 20, 2026
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.
Greptile Summary
This PR brings the
ec2_servicemodule into alignment with theecs_servicenaming conventions and UI standards: it renames a batch of Terraform variables (associate_public_ip_address→public_ip_assignment_enabled,health_check_path→deploy_health_check_path,data_volume_enabled→data_volume_creation_enabled, etc.), restructures the Ravion module definition into cleaner logical sections, and adds several new capabilities.deployment_concurrency_max/deployment_errors_max), ALB target group slow-start duration, application-cookie stickiness (withcookie_name), ECR image scanning on push, and explicithealth_check_grace_periodexposure in the UI.private_subnet_placement_enabledextracted to a new partial reused by ECS;autoscaling-capacity-inputs.ymlshared template allows both EC2 and ECS to customize min/max capacity labels;alb-load-balancer-attachment.ymlnow mergesattachment_controlso EC2 (creation_enabled) and ECS (enabled) can coexist without diverging templates.LoadBalancer+TargetGroupkeys, and worker groups now omit load-balancer panels entirely instead of rendering empty charts.Confidence Score: 4/5
Safe to merge onto the feature branch; the variable renames are applied consistently across all Terraform files, templates, and the YAML definition, and the new features are backed by new validation rules and tests.
All the renamed Terraform variables are updated in every call site with no obvious missed references. The new stickiness and slow_start paths have matching Terraform validations and tftest assertions. Two small gaps hold the score below a clean pass: the direct_access_cidr_blocks test asserts nothing about the resulting security group rule despite naming the feature, and cookie_duration is forwarded to the AWS provider for app_cookie type targets where it has no effect.
compute/ec2_service/target_group.tf (cookie_duration handling for app_cookie stickiness) and compute/ec2_service/tests/deploy_process_and_logs.tftest.hcl (missing assertion for direct_access_cidr_blocks security group rule)
Important Files Changed
Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant UI as Ravion UI participant DefYML as rvn-ec2-service-definition.yml participant TF as Terraform Module participant ASG as Auto Scaling Group participant TG as Target Group (ALB) participant SSM as SSM Deploy Doc UI->>DefYML: http_traffic_enabled, deployment_concurrency_max, deployment_errors_max DefYML->>TF: creation_enabled, cpu_autoscaling_enabled, ecr_scan_on_push_enabled TF->>ASG: launch template (public_ip_assignment_enabled, data_volume_creation_enabled) TF->>TG: slow_start, stickiness(type, cookie_name), deregistration_delay DefYML->>SSM: "rolling strategy(concurrency_max, errors_max, timeout=86400s)" SSM->>ASG: deploy container (deploy_health_check_path gate) ASG-->>TG: re-register after health gate passes%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant UI as Ravion UI participant DefYML as rvn-ec2-service-definition.yml participant TF as Terraform Module participant ASG as Auto Scaling Group participant TG as Target Group (ALB) participant SSM as SSM Deploy Doc UI->>DefYML: http_traffic_enabled, deployment_concurrency_max, deployment_errors_max DefYML->>TF: creation_enabled, cpu_autoscaling_enabled, ecr_scan_on_push_enabled TF->>ASG: launch template (public_ip_assignment_enabled, data_volume_creation_enabled) TF->>TG: slow_start, stickiness(type, cookie_name), deregistration_delay DefYML->>SSM: "rolling strategy(concurrency_max, errors_max, timeout=86400s)" SSM->>ASG: deploy container (deploy_health_check_path gate) ASG-->>TG: re-register after health gate passesComments Outside Diff (2)
compute/ec2_service/tests/deploy_process_and_logs.tftest.hcl, line 1452-1488 (link)direct_access_cidr_blocksin testThe test is named
web_target_group_supports_slow_start_stickiness_and_direct_accessand setsdirect_access_cidr_blocks = ["10.0.0.0/8"], but there is noassertblock verifying that the security group rule for direct CIDR access is actually applied. The slow_start and stickiness assertions are present, but the "direct_access" portion of the test title is unverified — a misconfiguration insecurity_group.tfthat drops these CIDRs would still pass this test.Prompt To Fix With AI
compute/ec2_service/target_group.tf, line 32-40 (link)cookie_durationalways forwarded regardless of stickiness typeThe
stickinessblock unconditionally passescookie_durationtoaws_lb_target_groupeven whentype = "app_cookie". Forapp_cookiestickiness, AWS ignores theDurationSecondsconfig — it's only meaningful forlb_cookie. The Terraform provider may silently discard this field, but it makes the UI misleading: users who selectapp_cookiewill still see and fill in a duration that has no effect. Conditionally omittingcookie_durationforapp_cookie(or at least noting the limitation) would prevent user confusion.Prompt To Fix With AI
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "Merge branch 'ma/ec2-module' into bb-ec2" | Re-trigger Greptile