Closed kumarappanc closed 7 years ago
Hi.
It's a list of strings not a list of integers (try "80"
instead of 80
), so technically this behaviour is by design. This is because all other port values (e.g. in firewall rules) in our resources are specified as strings (mainly because in some places, any
is a valid port).
Having said that, I understand that it could be confusing so I'm open to switching them to purely integers. Is that what you'd prefer? Either way, I'll update the documentation so that it's more explicit in describing the property data type.
CC: @mingsheng36 @wninobla
Actually, looking at the documentation it already shows examples where they ports are integers. I'm just going to switch it over to being integers. This will be fixed in v1.2 but if you need to keep working for now, just wrap each port in quotes (e.g. "80"
instead of 80
) and you'll be good to go. Later when you upgrade to v1.2 you can simply remove the quotes and everything will keep working.
I don't think we can use a port list here unless we explicitly keep each group of ports explicit. In the case of doing noncontinuous ports like in the simple example, you'd have to parse it out that way. May be easy to change on your end but I'm not the one coding. 😀. I am good so long as I know what it expects integer vs. a string.
Ok you answered my question on the same note... Lol
Even the string values doesn't work.
It looks like the problem is in the following function
func (helper resourcePropertyHelper) GetIntSetItems(key string) (items []int) { value, ok := helper.data.GetOk(key) if !ok || value == nil { return } rawItems := value.(*schema.Set).List()
items = make([]int, len(rawItems))
for index, item := range rawItems {
items[index] = item.(int)
}
return
}
conversion item.(int) not working
@kumarappanc Ugh. Sorry, I'll have to fix that.
Give me 5 mins and I'll see if I can build a hotfixed version of 1.1.x.
BTW, I've updated the acceptance tests for ddcloud_port_list
- they work correctly now.
Verified in alpha4.
When applying the following resource terraform crashes
When I use the port option instead of ports, it works.