From 5e54bcc6ffa0cc1ff684ded0698dbf1cd639f505 Mon Sep 17 00:00:00 2001 From: clint shryock Date: Mon, 7 Dec 2015 11:16:29 -0600 Subject: [PATCH] Add test for iops with gp2, remove strict validation --- .../providers/aws/resource_aws_ebs_volume.go | 8 ------ .../aws/resource_aws_ebs_volume_test.go | 28 +++++++++++++++++++ 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/builtin/providers/aws/resource_aws_ebs_volume.go b/builtin/providers/aws/resource_aws_ebs_volume.go index 0e016ecaa..856c94871 100644 --- a/builtin/providers/aws/resource_aws_ebs_volume.go +++ b/builtin/providers/aws/resource_aws_ebs_volume.go @@ -37,14 +37,6 @@ func resourceAwsEbsVolume() *schema.Resource { Optional: true, Computed: true, ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, es []error) { - value := v.(int) - if value < 100 { - es = append(es, fmt.Errorf( - "%q must be an integer, minimum value 100", k)) - } - return - }, }, "kms_key_id": &schema.Schema{ Type: schema.TypeString, diff --git a/builtin/providers/aws/resource_aws_ebs_volume_test.go b/builtin/providers/aws/resource_aws_ebs_volume_test.go index aab92eb01..fabcdb1a1 100644 --- a/builtin/providers/aws/resource_aws_ebs_volume_test.go +++ b/builtin/providers/aws/resource_aws_ebs_volume_test.go @@ -26,6 +26,22 @@ func TestAccAWSEBSVolume_basic(t *testing.T) { }) } +func TestAccAWSEBSVolume_Iops(t *testing.T) { + var v ec2.Volume + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccAwsEbsVolumeConfigWithIops, + Check: resource.ComposeTestCheckFunc( + testAccCheckVolumeExists("aws_ebs_volume.iops_test", &v), + ), + }, + }, + }) +} + func TestAccAWSEBSVolume_withTags(t *testing.T) { var v ec2.Volume resource.Test(t, resource.TestCase{ @@ -86,3 +102,15 @@ resource "aws_ebs_volume" "tags_test" { } } ` + +const testAccAwsEbsVolumeConfigWithIops = ` +resource "aws_ebs_volume" "iops_test" { + availability_zone = "us-west-2a" + size = 10 + type = "gp2" + iops = 0 + tags { + Name = "TerraformTest" + } +} +`