github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/builtin/providers/fastly/validators.go (about)

     1  package fastly
     2  
     3  import "fmt"
     4  
     5  func validateS3FormatVersion(v interface{}, k string) (ws []string, errors []error) {
     6  	value := uint(v.(int))
     7  	validVersions := map[uint]struct{}{
     8  		1: {},
     9  		2: {},
    10  	}
    11  
    12  	if _, ok := validVersions[value]; !ok {
    13  		errors = append(errors, fmt.Errorf(
    14  			"%q must be one of ['1', '2']", k))
    15  	}
    16  	return
    17  }