-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
r/launch_template: only set credit specification if t2 instance type #5190
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @kl4w! 🚀
8 tests passed (all tests)
=== RUN TestAccAWSLaunchTemplate_nonBurstable
--- PASS: TestAccAWSLaunchTemplate_nonBurstable (7.11s)
=== RUN TestAccAWSLaunchTemplate_data
--- PASS: TestAccAWSLaunchTemplate_data (7.31s)
=== RUN TestAccAWSLaunchTemplate_basic
--- PASS: TestAccAWSLaunchTemplate_basic (7.38s)
=== RUN TestAccAWSLaunchTemplate_importData
--- PASS: TestAccAWSLaunchTemplate_importData (7.98s)
=== RUN TestAccAWSLaunchTemplate_importBasic
--- PASS: TestAccAWSLaunchTemplate_importBasic (8.12s)
=== RUN TestAccAWSLaunchTemplate_BlockDeviceMappings_EBS
--- PASS: TestAccAWSLaunchTemplate_BlockDeviceMappings_EBS (9.43s)
=== RUN TestAccAWSLaunchTemplate_tags
--- PASS: TestAccAWSLaunchTemplate_tags (12.41s)
=== RUN TestAccAWSLaunchTemplate_update
--- PASS: TestAccAWSLaunchTemplate_update (12.45s)
@@ -510,8 +511,10 @@ func resourceAwsLaunchTemplateRead(d *schema.ResourceData, meta interface{}) err | |||
return err | |||
} | |||
|
|||
if err := d.Set("credit_specification", getCreditSpecification(ltData.CreditSpecification)); err != nil { | |||
return err | |||
if strings.HasPrefix(aws.StringValue(ltData.InstanceType), "t2") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think we should perform this conditional on read as it can potentially break modules expecting credit_specification
for outputs (this will be less of a concern with Terraform 0.12). I'll try removing this on merge.
@kl4w thanks for addressing this - I can remove so much grimey code from my deploy tooling now. |
This has been released in version 1.28.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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! |
Fixes #5081
Changes proposed in this pull request:
Output from acceptance testing: