providers/aws: launch configuration validation
This commit is contained in:
parent
86e935bfd5
commit
278dd49a4d
|
@ -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.*",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -54,10 +54,11 @@ func init() {
|
||||||
},
|
},
|
||||||
|
|
||||||
"aws_launch_configuration": resource.Resource{
|
"aws_launch_configuration": resource.Resource{
|
||||||
Create: resource_aws_launch_configuration_create,
|
ConfigValidator: resource_aws_launch_configuration_validation(),
|
||||||
Destroy: resource_aws_launch_configuration_destroy,
|
Create: resource_aws_launch_configuration_create,
|
||||||
Diff: resource_aws_launch_configuration_diff,
|
Destroy: resource_aws_launch_configuration_destroy,
|
||||||
Refresh: resource_aws_launch_configuration_refresh,
|
Diff: resource_aws_launch_configuration_diff,
|
||||||
|
Refresh: resource_aws_launch_configuration_refresh,
|
||||||
},
|
},
|
||||||
|
|
||||||
"aws_route_table": resource.Resource{
|
"aws_route_table": resource.Resource{
|
||||||
|
|
Loading…
Reference in New Issue