parent
a76105b0f1
commit
f424085f44
|
@ -3,6 +3,7 @@ package aws
|
|||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
|
@ -24,6 +25,16 @@ func resourceAwsVpc() *schema.Resource {
|
|||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
|
||||
value := v.(string)
|
||||
_, ipnet, err := net.ParseCIDR(value)
|
||||
|
||||
if err != nil || ipnet == nil || value != ipnet.String() {
|
||||
errors = append(errors, fmt.Errorf(
|
||||
"%q must contain a valid CIDR", k))
|
||||
}
|
||||
return
|
||||
},
|
||||
},
|
||||
|
||||
"instance_tenancy": &schema.Schema{
|
||||
|
|
Loading…
Reference in New Issue