-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resource/aws_instance: Add check for empty credit_specification block (…
…#9003) Fixes: #6532 When given an empty credit_specification block (i.e cpu_credits is missing) the Terraform provider will crash upon trying to type assert on the empty (nil) block. This check introduces a guard clause around the type assertion to protect around the empty (nil) block. A warning is logged to indicated that a default value will be used in place of the missing value. Acceptance tests after changes ``` --- PASS: TestAccAWSInstance_creditSpecification_unknownCpuCredits_t2 --- PASS: TestAccAWSInstance_creditSpecification_unknownCpuCredits_t3 ```
- Loading branch information
Showing
2 changed files
with
78 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters