Skip to content
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

Added support for CPU credits #35

Merged
merged 2 commits into from
Jun 4, 2018
Merged

Added support for CPU credits #35

merged 2 commits into from
Jun 4, 2018

Conversation

antonbabenko
Copy link
Member

Closes #31

@antonbabenko antonbabenko merged commit a49d57a into master Jun 4, 2018
@antonbabenko antonbabenko deleted the cpu-credits branch June 4, 2018 13:10
@suizman
Copy link

suizman commented Jun 8, 2018

Hi @antonbabenko it seams that this option breaks the compatibility with other instance types.

Error: Error applying plan:

1 error(s) occurred:

* module.ec2.aws_instance.this: 1 error(s) occurred:

* aws_instance.this: Error launching source instance: InstanceCreditSpecification.NotSupported: The m4.2xlarge instance type does not support T2 Unlimited.

Is there anyway to work around this without modifying the module?

@antonbabenko
Copy link
Member Author

cpu_credits should be set only for T2 types of instances.

@suizman
Copy link

suizman commented Jun 8, 2018

Of course but cpu_credit has a default value which is "standard".
This is my actual usage of the ec2 module

module "ec2" {
  source = "terraform-aws-modules/ec2-instance/aws"

  name                        = "qed-benchmark"
  ami                         = "${data.aws_ami.amazon_linux.id}"
  instance_type               = "${var.flavour}"
  subnet_id                   = "${element(data.aws_subnet_ids.all.ids, 0)}"
  vpc_security_group_ids      = ["${module.security_group.this_security_group_id}"]
  associate_public_ip_address = true
  key_name                    = "${aws_key_pair.qed-benchmark.key_name}" 

  root_block_device = [{
    volume_type = "gp2"
    volume_size = "${var.volume_size}"
    delete_on_termination = true
  }]
}

@antonbabenko
Copy link
Member Author

Hmm, this is a nasty surprise :-/ I will release a fix soon.

@suizman
Copy link

suizman commented Jun 8, 2018

Okis, thanks!
The current workaround I've found is to bring up some t2.$size instance and then choose another size and run terraform apply again. It's not a big deal..

antonbabenko added a commit that referenced this pull request Jun 8, 2018
@antonbabenko
Copy link
Member Author

v1.9.0 has been released.

@suizman
Copy link

suizman commented Jun 11, 2018

Perfect! I've just tested the changes and they work as expected. Thanks @antonbabenko

suizman added a commit to suizman/qed that referenced this pull request Jun 11, 2018
ec2-module was unable to create instances other than T2.
Issue: terraform-aws-modules/terraform-aws-ec2-instance#35
suizman added a commit to suizman/qed that referenced this pull request Jun 11, 2018
ec2-module was unable to create instances other than T2.
Issue: terraform-aws-modules/terraform-aws-ec2-instance#35
suizman added a commit to BBVA/qed that referenced this pull request Jun 13, 2018
ec2-module was unable to create instances other than T2.
Issue: terraform-aws-modules/terraform-aws-ec2-instance#35
suizman added a commit to jllucas/qed that referenced this pull request Jun 4, 2019
ec2-module was unable to create instances other than T2.
Issue: terraform-aws-modules/terraform-aws-ec2-instance#35

Former-commit-id: 03d48a3
Sebor pushed a commit to Sebor/terraform-aws-ec2-instance that referenced this pull request Aug 6, 2020
* Added support for CPU credits

* Updated formatting
Sebor pushed a commit to Sebor/terraform-aws-ec2-instance that referenced this pull request Aug 6, 2020
@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 10, 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.

Support credit_specification option for T2.Unlimited instance types
2 participants