Skip to content
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

ebs_optimized in resource_aws_launch_template doesn't accept string true/false #5994

Closed
kinghuang opened this issue Sep 26, 2018 · 5 comments · Fixed by #5995
Closed

ebs_optimized in resource_aws_launch_template doesn't accept string true/false #5994

kinghuang opened this issue Sep 26, 2018 · 5 comments · Fixed by #5995
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/ec2 Issues and PRs that pertain to the ec2 service.
Milestone

Comments

@kinghuang
Copy link

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

Terraform v0.11.8

  • provider.aws v1.37.0

Affected Resource(s)

  • aws_launch_template

Terraform Configuration Files

resource "aws_launch_template" "managers" {
  name = "${var.name}-managers"
  image_id      = "${data.aws_ami_ids.moby.ids[0]}"
  instance_type = "${var.manager_instance_type}"block_device_mappings {
    device_name = "/dev/xvdb"
    ebs {
      volume_type = "${var.manager_disk_type}"
      volume_size = "${var.manager_disk_size}"
    }
  }
  ebs_optimized = "true"
}

Debug Output

Error: module.swarm.aws_launch_template.managers: expected ebs_optimized to be
one of ["", false, true], got true

Panic Output

N/A

Expected Behavior

ebs_optimized should be true.

Actual Behavior

An error occurred using the string "true" for ebs_optimized.

Steps to Reproduce

  1. terraform apply

Important Factoids

While upgrading from version 1.35.0 to 1.37.0 of the AWS provider, I ran into this error with the ebs_optimized parameter in the aws_launch_template resource. I'm using the string value "true", but that resulted in the error that the value was expected to be one of ["", false, true]. Changing the value to boolean value true worked.

From 1.35.0 to 1.36.0, the value type for ebs_optimized change from schema.TypeBool to schema.TypeString (eeb04c6), and uses validateTypeStringNullableBoolean for ValidateFunc. The new validation function doesn't seem to allow for string "true" and "false" values.

References

Change of ebs_optimized's value type and validation function: 2e8a2b3
Addition of validateTypeStringNullableBoolean: #5632

@bflad bflad added upstream-terraform Addresses functionality related to the Terraform core binary. service/ec2 Issues and PRs that pertain to the ec2 service. labels Sep 26, 2018
@bflad
Copy link
Contributor

bflad commented Sep 26, 2018

Hi @kinghuang 👋 Sorry for the trouble. We generally try to prevent configuration regressions such as this although the usage of the string versions of "true"/"false" is less likely to be accounted for.

I think we can safely add "false" and "true" to the new validation function, I'm working on verifying that.

@bflad bflad added bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. and removed upstream-terraform Addresses functionality related to the Terraform core binary. labels Sep 26, 2018
@bflad bflad added this to the v1.38.0 milestone Sep 26, 2018
@bflad
Copy link
Contributor

bflad commented Sep 26, 2018

The fix for this has been merged and will release with version 1.38.0 of the AWS provider, likely later today.

@kinghuang
Copy link
Author

Awesome. Thanks for the quick turnaround!

@bflad
Copy link
Contributor

bflad commented Sep 26, 2018

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

@ghost
Copy link

ghost commented Apr 3, 2020

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!

@ghost ghost locked and limited conversation to collaborators Apr 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
2 participants