providers/aws: launch configuration validation
This commit is contained in:
parent
86e935bfd5
commit
278dd49a4d
|
@ -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/autoscaling"
|
||||
|
@ -188,3 +189,17 @@ func resource_aws_launch_configuration_retrieve(id string, autoscalingconn *auto
|
|||
|
||||
return &l, nil
|
||||
}
|
||||
|
||||
func resource_aws_launch_configuration_validation() *config.Validator {
|
||||
return &config.Validator{
|
||||
Required: []string{
|
||||
"name",
|
||||
"image_id",
|
||||
"instance_type",
|
||||
},
|
||||
Optional: []string{
|
||||
"key_name",
|
||||
"security_groups.*",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,6 +54,7 @@ func init() {
|
|||
},
|
||||
|
||||
"aws_launch_configuration": resource.Resource{
|
||||
ConfigValidator: resource_aws_launch_configuration_validation(),
|
||||
Create: resource_aws_launch_configuration_create,
|
||||
Destroy: resource_aws_launch_configuration_destroy,
|
||||
Diff: resource_aws_launch_configuration_diff,
|
||||
|
|
Loading…
Reference in New Issue