hashicorp/terraform — pull request #211 by mitchellh (2014-08-21 04:08:04+00:00)
Title: helper/schema: TypeSet - Sets!

This introduces the `TypeSet` type to `helper/schema`. Sets are lists that are unordered and have only unique items in them. The usage is simple:

```
"ports": &schema.Schema{
Type: schema.TypeSet,
Elem: &schema.Schema{Type: schema.TypeInt},
Set: func(a interface{}) int { return a.(int) }
}
```

You must set the type to `TypeSet` and then specify a hashing function in the `Set` element. This gets the item and must return a hash code to uniquely identify that item.