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,10 +13,11 @@ 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{
|
||||||
Create: resource_aws_autoscaling_group_create,
|
ConfigValidator: resource_aws_autoscaling_group_validation(),
|
||||||
Destroy: resource_aws_autoscaling_group_destroy,
|
Create: resource_aws_autoscaling_group_create,
|
||||||
Diff: resource_aws_autoscaling_group_diff,
|
Destroy: resource_aws_autoscaling_group_destroy,
|
||||||
Refresh: resource_aws_autoscaling_group_refresh,
|
Diff: resource_aws_autoscaling_group_diff,
|
||||||
|
Refresh: resource_aws_autoscaling_group_refresh,
|
||||||
},
|
},
|
||||||
|
|
||||||
"aws_elb": resource.Resource{
|
"aws_elb": resource.Resource{
|
||||||
|
|
Loading…
Reference in New Issue