providers/aws: security group validations
This commit is contained in:
parent
278dd49a4d
commit
ff0741a12e
|
@ -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",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue