providers/aws: autoscaling group config validation
This commit is contained in:
parent
a87f2a7987
commit
86e935bfd5
|
@ -6,6 +6,7 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"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"
|
||||||
|
@ -231,3 +232,21 @@ func resource_aws_autoscaling_group_retrieve(id string, autoscalingconn *autosca
|
||||||
|
|
||||||
return &g, nil
|
return &g, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func resource_aws_autoscaling_group_validation() *config.Validator {
|
||||||
|
return &config.Validator{
|
||||||
|
Required: []string{
|
||||||
|
"name",
|
||||||
|
"max_size",
|
||||||
|
"min_size",
|
||||||
|
"availability_zones.*",
|
||||||
|
"launch_configuration",
|
||||||
|
},
|
||||||
|
Optional: []string{
|
||||||
|
"health_check_grace_period",
|
||||||
|
"health_check_type",
|
||||||
|
"desired_capicity",
|
||||||
|
"force_delete",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ func init() {
|
||||||
resourceMap = &resource.Map{
|
resourceMap = &resource.Map{
|
||||||
Mapping: map[string]resource.Resource{
|
Mapping: map[string]resource.Resource{
|
||||||
"aws_autoscaling_group": resource.Resource{
|
"aws_autoscaling_group": resource.Resource{
|
||||||
|
ConfigValidator: resource_aws_autoscaling_group_validation(),
|
||||||
Create: resource_aws_autoscaling_group_create,
|
Create: resource_aws_autoscaling_group_create,
|
||||||
Destroy: resource_aws_autoscaling_group_destroy,
|
Destroy: resource_aws_autoscaling_group_destroy,
|
||||||
Diff: resource_aws_autoscaling_group_diff,
|
Diff: resource_aws_autoscaling_group_diff,
|
||||||
|
|
Loading…
Reference in New Issue