providers/aws: security group validations

This commit is contained in:
Jack Pearkes 2014-07-15 12:40:20 -04:00
parent 278dd49a4d
commit ff0741a12e
2 changed files with 17 additions and 4 deletions

View File

@ -5,6 +5,7 @@ import (
"log"
"github.com/hashicorp/terraform/flatmap"
"github.com/hashicorp/terraform/helper/config"
"github.com/hashicorp/terraform/helper/diff"
"github.com/hashicorp/terraform/terraform"
"github.com/mitchellh/goamz/ec2"
@ -177,3 +178,14 @@ func resource_aws_security_group_retrieve(id string, ec2conn *ec2.EC2) (*ec2.Sec
return &sg, nil
}
func resource_aws_security_group_validation() *config.Validator {
return &config.Validator{
Required: []string{
"name",
},
Optional: []string{
"description",
},
}
}

View File

@ -93,6 +93,7 @@ func init() {
},
"aws_security_group": resource.Resource{
ConfigValidator: resource_aws_security_group_validation(),
Create: resource_aws_security_group_create,
Destroy: resource_aws_security_group_destroy,
Diff: resource_aws_security_group_diff,