Extra/Unnecessary API Call on creating ec2 instance for cpu_credits #4897
Labels
bug
Addresses a defect in current functionality.
service/ec2
Issues and PRs that pertain to the ec2 service.
Milestone
Terraform Version
Community Note
Unnecessary modify instance of cpu_credits after launch a ec2 instance
I will provide a pull request.
Description
Our setup is that we do not have modify-instance privilege in aws. Looks like when we launching ec2-instance with cpu_credits = unlimited terraform do a unnecessary modify to set cpu_credits = unlimited againt after just launch it.
We get status code: 403 from AWS as we do not have modify instance priviliges.
Code change to not make the modify of instance after launch of instance
After getting status code: 403 we run terraform plan again and then we get
No changes. Infrastructure is up-to-date.
and that is correct as ec2-instance got the correct configuration of cpu_credit when we launch the instance.From debug logging we see this
Affected Resource(s)
Potential Terraform Configuration
The text was updated successfully, but these errors were encountered: