On first run, terraform provisioning of Amazon Linux 2 results in credit_specification.0.cpu_credits: "unlimited" and then fails to edit instance #5769
Labels
bug
Addresses a defect in current functionality.
service/ec2
Issues and PRs that pertain to the ec2 service.
Milestone
Issue
I am very new to Terraform, but on my first attempt to provision (which succeeded) and then edit (which failed) a t3.micro instance, I ran into the following error. It appears as though the default cpu_credits "standard" setting was not set the first time the instance was created. For some reason, aws provisioned with this value set to "unlimited." Then, AWS refused to let me interact further with that instance via Terraform. I was able to reproduce with both Amazon Linux 2 AMI and Ubuntu 18.04 AMI. The correct value of "standard" seems to stick if I do not run
terraform init
, and seems to get lost (and gets set to "unlimited") when I do runterraform init
.Community Note
Terraform Version
$ terraform -v
Terraform v0.11.8
Affected Resource(s)
Terraform Configuration Files
provider "aws" {
access_key = "${var.access_key}"
secret_key = "${var.secret_key}"
region = "${var.region}"
}
resource "aws_instance" "terraform-test" {
ami = "${var.ami-amazon2-ohio}"
instance_type = "t3.micro"
}
Debug Output
https://gist.github.com/jdelaporte/4a1f31eb7a0f33b45aeddbaa1e8c79ba
Panic Output
Expected Behavior
credit_specification.0.cpu_credits: "standard" after first run.
Actual Behavior
Steps to Reproduce
terraform init
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: