EC2 ASG component — Anything In-Flight? #111
-
|
Per the component development docs, checking if there's an EC2 ASG component in-flight before we build one. Context on what we're after: An EC2 ASG component supporting two workload types for Windows & Linux
Currently piecing things together from bits of these, so figured I'd check before reinventing the wheel:
Questions:
Appreciate any guidance ! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
Hey @jaguer0. If I understand correctly, you're looking to build a platform or application on EC2 with Auto Scaling Groups, similar to the ECS approach. When deciding how to structure your components, think about the lifecycle of the deployment. Will different parts ever be deployed independently, or are they always deployed together? Are different teams responsible for different pieces? If everything moves as a single unit, then a single component makes sense. Given how specific and tightly coupled this sounds, a custom component is the right call. That said, you don't need to start from scratch. You can reuse existing modules like terraform-aws-ec2-autoscale-group as the foundation. For the ALB, you have options. You could deploy it separately using the ALB component and wire it up to the ASG, or bundle it all into your single component. Either approach works, and neither is an anti-pattern. |
Beta Was this translation helpful? Give feedback.
You don't need a separate shared "DNS logic" component. The domain auto-construction in the ECS components isn't magic built into the ECS cluster. It comes from two things that are already available to any component:
context.tf(viamodule.thisfromterraform-null-label) which gives you a formatted name from your namespace, tenant, environment, stage, name, and attributes.dns-delegatedcomponent, which outputsdefault_domain_name(e.g.use2.dev.plat.example.com).You combine them with a simple
format()call. Here's how you can do it in your custom EC2 ASG component: