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"
"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.*",
},
}
}

View File

@ -54,10 +54,11 @@ func init() {
},
"aws_launch_configuration": resource.Resource{
Create: resource_aws_launch_configuration_create,
Destroy: resource_aws_launch_configuration_destroy,
Diff: resource_aws_launch_configuration_diff,
Refresh: resource_aws_launch_configuration_refresh,
ConfigValidator: resource_aws_launch_configuration_validation(),
Create: resource_aws_launch_configuration_create,
Destroy: resource_aws_launch_configuration_destroy,
Diff: resource_aws_launch_configuration_diff,
Refresh: resource_aws_launch_configuration_refresh,
},
"aws_route_table": resource.Resource{