-
-
Notifications
You must be signed in to change notification settings - Fork 558
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
fix(spot): Prevent both instance_requirements and instance_type #274
Conversation
…_type is not null
why do you need to use this in a |
@bryantbiggs yes it could be done with both ASG module declarations (150 lines for me right now for one ASG). In this example, I have two ASG, but you can go for example to 5 in your ECS cluster (small, medium, spot, on-demand instances) The difference is not a huge change from the module perspective. And it fix an AWS limitation that when you declare I hope you will find it helpful as it unlocks a new possibility. |
For what?
There isn't anything broken so there isn't anything to fix in terms of limitations - its just that you are trying to force two very different configurations into one |
To place your ECS services depending on the application requirements in small, medium or large node. And if you are allowed to use spot, you can either run your workload 100% on spot or balance it between on-demand and spot. All these considerations are base on finOps. So it's a common thing to have multiple ASG in an ECS cluster.
Maybe, but I prefer using Your comments are not based on the contribution, as it's just a small thing unlocking a huge possibility. It's more based on your HCL writing vision. Any third opinion would be helpful @antonbabenko |
This PR has been automatically marked as stale because it has been open 30 days |
This PR was automatically closed because of stale in 10 days |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Description
I'm using this module to create ASG and resources associated to be used in my ECS cluster.
Motivation and Context
I searched to use
for_each
on this module to createon-demand
andspot
ASG/LaunchTemplate. I faced a problem because you can't declareinstance_requirements
ifinstance_type
is set too.To avoid this problem, I added a check that
var.instance_type == null
when you declare yourinstance_requirements.
Personal code example
if my asg is
spot == false
I keep the defaultinstance_requirements
as{}
and setinstance_type
if my asg is
spot == true
I set theinstance_requirements
,use_mixed_instances_policy
and set theinstance_type
tonull
locals.tf
asg.tf
Breaking Changes
No breaking changes.
How Has This Been Tested?
examples/*
to demonstrate and validate my change(s)examples/*
projectspre-commit run -a
on my pull request