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

Number suffixes as described in docs result in syntax error #3247

Closed
ThinTim opened this issue Sep 16, 2015 · 4 comments
Closed

Number suffixes as described in docs result in syntax error #3247

ThinTim opened this issue Sep 16, 2015 · 4 comments

Comments

@ThinTim
Copy link

ThinTim commented Sep 16, 2015

The Terraform docs state that:

  • Numbers can be suffixed with kKmMgG for some multiple of 10. For example: 1k is equal to 1000.
  • Numbers can be suffixed with [kKmMgG]b for power of 2 multiples, example: 1kb is equal to 1024.

However, terraform plan gives a syntax error when I attempt to use a suffixed number:

resource "..." "..." {
  threshold = 150mb
}

Tested on Terraform 0.6.3.

@apparentlymart
Copy link
Contributor

Oh wow... I never noticed that in the docs before, nor have I ever seen it in the code.

Out of curiosity I also tried quoting the string in case it was the Terraform layer that was supposed to be handling it, rather than the HCL layer. No dice there either:

  * aws_ebs_volume.example: cannot parse '' as int: strconv.ParseInt: parsing "1Gb": invalid syntax

This would be a rather strange feature anyway, since the quantities on many resources are already expressed in mega-somethings or giga-somethings. For example, I was experimenting with an EBS volume size here, meaning that in my above example I asked for a volume of "one giga-gigabyte". Feels like even if this feature is somehow supported somewhere it's gonna be confusing when used in conjunction with attributes that already have implied exponents, so maybe better that it doesn't work...

@hattorious
Copy link

I was caught by this today too.

resource "aws_ebs_volume" "example" {
    ...
    iops = 2k
    ...
}

and it looks like the main discussion is in #3287.

@phinze
Copy link
Contributor

phinze commented Oct 12, 2015

Thanks for the report - this is definitely confusing!

I wonder if it worked at one point or if these are "aspirational docs" we have found. ;)

Either way, closing to keep things consolidated in #3287.

@phinze phinze closed this as completed Oct 12, 2015
@ghost
Copy link

ghost commented Apr 30, 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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants