Terraform-provider-aws: credit_specification should be updateable on new resources (T3 version)

Created on 22 Aug 2018  ·  10Comments  ·  Source: hashicorp/terraform-provider-aws

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

All

Affected Resource(s)

  • aws_launch_configuration
  • aws_instance

Terraform Configuration Files

n/a

Debug Output

n/a

Panic Output

n/a

Expected Behavior

Able to disable unlimited feature for t3 instances

Actual Behavior

T3 instances have unlimited enabled

Steps to Reproduce

  1. terraform apply

Important Factoids

References

bug servicec2

Most helpful comment

@bflad what about launch configurations?

All 10 comments

Hi @myoung34 👋

Can you please provide more details about this issue? According to the T3 instance product documentation:

T3 instances start in Unlimited mode by default

Related? https://github.com/terraform-providers/terraform-provider-aws/issues/5654 If so, we should consolidate tracking to that issue since it details the problem.

I think mine is more to do with the fact that if you configure an autoscaling group with t3 types there's no way to disable Unlimited. Is there a better ticket to apply this to?

@bflad I updated the description better
Basically for an ASG of type t3 its impossible currently to disable Unlimited credit specification

I think I'm getting something very, very similar to the behaviour described here, if not identical; I've not had it with an ASG though. It's not quite the same as #5654 although it could well be a common cause between the two.

What is happening is that when you perform an initial terraform apply, it doesn't respect the credit_specification and sets the server to the unlimited specification; it is however successfully applied on a second apply.
The initial plan itself clearly shows the specification, it just doesn't actually apply it.

Apologies if I'm stepping on any toes; I'm happy to open this as a separate issue but that feels like more noise when this is basically the same problem.

Here's a demonstration of it below;

Terraform Version

$ terraform --version
Terraform v0.11.8
+ provider.aws v1.33.0

Terraform Configuration Files

In ec2_instance.tf:

provider "aws" {
  region = "eu-west-2"
}

resource "aws_instance" "test" {
  ami           = "ami-e1768386"
  instance_type = "t3.micro"

  credit_specification {
    cpu_credits = "standard"
  }
}

Execution/Debug Output

https://gist.github.com/garethsaxby/14903fb6912de57291aed4faeed1161a

Related #5654
@garethsaxby yes, looks like credit_specification will be applied only for t2 instances(during creation) as other type will not support this(now t3 included). I will work on it.

The fix for this has been merged into master for the aws_instance resource and will release with version 1.37.0 of the AWS provider, likely tomorrow.

This has been released in version 1.37.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@bflad what about launch configurations?

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

Was this page helpful?
0 / 5 - 0 ratings