providers/aws: launch configuration validation

This commit is contained in:
Jack Pearkes 2014-07-15 12:36:29 -04:00
parent 86e935bfd5
commit 278dd49a4d
2 changed files with 20 additions and 4 deletions

View File

@ -5,6 +5,7 @@ import (
"log" "log"
"github.com/hashicorp/terraform/flatmap" "github.com/hashicorp/terraform/flatmap"
"github.com/hashicorp/terraform/helper/config"
"github.com/hashicorp/terraform/helper/diff" "github.com/hashicorp/terraform/helper/diff"
"github.com/hashicorp/terraform/terraform" "github.com/hashicorp/terraform/terraform"
"github.com/mitchellh/goamz/autoscaling" "github.com/mitchellh/goamz/autoscaling"
@ -188,3 +189,17 @@ func resource_aws_launch_configuration_retrieve(id string, autoscalingconn *auto
return &l, nil 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.*",
},
}
}

View File

@ -54,6 +54,7 @@ func init() {
}, },
"aws_launch_configuration": resource.Resource{ "aws_launch_configuration": resource.Resource{
ConfigValidator: resource_aws_launch_configuration_validation(),
Create: resource_aws_launch_configuration_create, Create: resource_aws_launch_configuration_create,
Destroy: resource_aws_launch_configuration_destroy, Destroy: resource_aws_launch_configuration_destroy,
Diff: resource_aws_launch_configuration_diff, Diff: resource_aws_launch_configuration_diff,