diff --git a/builtin/providers/aws/resource_aws_autoscaling_group.go b/builtin/providers/aws/resource_aws_autoscaling_group.go index 0da567389..6aa20b9b6 100644 --- a/builtin/providers/aws/resource_aws_autoscaling_group.go +++ b/builtin/providers/aws/resource_aws_autoscaling_group.go @@ -6,6 +6,7 @@ import ( "strconv" "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" @@ -231,3 +232,21 @@ func resource_aws_autoscaling_group_retrieve(id string, autoscalingconn *autosca 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", + }, + } +} diff --git a/builtin/providers/aws/resources.go b/builtin/providers/aws/resources.go index 8648b8d39..66f613a3d 100644 --- a/builtin/providers/aws/resources.go +++ b/builtin/providers/aws/resources.go @@ -13,10 +13,11 @@ func init() { resourceMap = &resource.Map{ Mapping: map[string]resource.Resource{ "aws_autoscaling_group": resource.Resource{ - Create: resource_aws_autoscaling_group_create, - Destroy: resource_aws_autoscaling_group_destroy, - Diff: resource_aws_autoscaling_group_diff, - Refresh: resource_aws_autoscaling_group_refresh, + ConfigValidator: resource_aws_autoscaling_group_validation(), + Create: resource_aws_autoscaling_group_create, + Destroy: resource_aws_autoscaling_group_destroy, + Diff: resource_aws_autoscaling_group_diff, + Refresh: resource_aws_autoscaling_group_refresh, }, "aws_elb": resource.Resource{