Skip to content

Support for Mixed Instances ASG in worker_groups_launch_template variable #468

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

Merged
merged 16 commits into from
Sep 13, 2019

Conversation

sppwf
Copy link
Contributor

@sppwf sppwf commented Aug 13, 2019

PR o'clock

Description

Added support for Mixed Instances ASG in worker_groups_launch_template variable.
Changed the local.asg_tags - tag generation using for utility from terraform 12
worker_groups_launch_template_mixed variable left for backward compatibility

Checklist

@max-rocket-internet
Copy link
Contributor

If I understand correctly, we could remove anything related to workers_launch_template_mixed, right? That would be super cool 🙌

@sppwf
Copy link
Contributor Author

sppwf commented Aug 19, 2019

Yes, we can remove, however i just left it for backward compatibily.
Either we just create some migration plan, not sure how you guys used to do here.

Thanks
Sergiu

@max-rocket-internet
Copy link
Contributor

Yes, we can remove, however i just left it for backward compatibily.

Great! Then please, if you can, do remove the launch template mixed related stuff. It was created as there was no other option in TF 0.11 but it would be much simpler and tidier if we just had workers_launch_template that covered all needs 🚀

@sppwf
Copy link
Contributor Author

sppwf commented Aug 23, 2019

@max-rocket-internet Should i do here something more, I am a little bit confuzed ?

@max-rocket-internet
Copy link
Contributor

Just give me more time to have a look, it's quite a big change 😅

@max-rocket-internet
Copy link
Contributor

I just tested this by running TF from examples/spot_instances but the ASG doesn't have any of the instance type overrides added:

Screen Shot 2019-09-03 at 15 15 09

@sppwf
Copy link
Contributor Author

sppwf commented Sep 3, 2019

I was looking for this variable to be configured on_demand_allocation_strategy, however, specifing override_instance_types with some values means user will want spot instances.

@max-rocket-internet
Copy link
Contributor

I tested again.

From examples/spot_instances:

module.eks.aws_autoscaling_group.workers_launch_template[0]: Creating...

Error: Error creating AutoScaling Group: ValidationError: Valid requests must contain either LaunchTemplate, LaunchConfigurationName, InstanceId or MixedInstancesPolicy parameter.
	status code: 400, request id: 33c4d651-d2f1-11e9-89e0-f7c70abdf77c

  on ../../workers_launch_template.tf line 3, in resource "aws_autoscaling_group" "workers_launch_template":
   3: resource "aws_autoscaling_group" "workers_launch_template" {

From examples/launch_templates:

module.eks.aws_autoscaling_group.workers_launch_template[1]: Creating...
module.eks.aws_autoscaling_group.workers_launch_template[0]: Creating...

Error: Error creating AutoScaling Group: ValidationError: Valid requests must contain either LaunchTemplate, LaunchConfigurationName, InstanceId or MixedInstancesPolicy parameter.
	status code: 400, request id: 35bb4f82-d2f1-11e9-ba6a-8da9e1bac398

  on ../../workers_launch_template.tf line 3, in resource "aws_autoscaling_group" "workers_launch_template":
   3: resource "aws_autoscaling_group" "workers_launch_template" {



Error: Error creating AutoScaling Group: ValidationError: Valid requests must contain either LaunchTemplate, LaunchConfigurationName, InstanceId or MixedInstancesPolicy parameter.
	status code: 400, request id: 35bb28fd-d2f1-11e9-ae7d-c78bc1196371

  on ../../workers_launch_template.tf line 3, in resource "aws_autoscaling_group" "workers_launch_template":
   3: resource "aws_autoscaling_group" "workers_launch_template" {

@max-rocket-internet
Copy link
Contributor

Could you run terraform apply & terraform destroy from all 3 examples to ensure it works?

Really keen to get this PR merged though as it removes a lot of duplication 😄

@sppwf
Copy link
Contributor Author

sppwf commented Sep 12, 2019

Mr @max-rocket-internet :)
Please check the flow now. it worked for me

@max-rocket-internet
Copy link
Contributor

OK! I tested it and it looks good. Can you resolve conflict and the we can merge?

@max-rocket-internet max-rocket-internet merged commit 461cf54 into terraform-aws-modules:master Sep 13, 2019
@max-rocket-internet
Copy link
Contributor

Thanks @sppwf !

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants