Add test for iops with gp2, remove strict validation

This commit is contained in:
clint shryock 2015-12-07 11:16:29 -06:00
parent d1bba3095b
commit 5e54bcc6ff
2 changed files with 28 additions and 8 deletions

View File

@ -37,14 +37,6 @@ func resourceAwsEbsVolume() *schema.Resource {
Optional: true, Optional: true,
Computed: true, Computed: true,
ForceNew: 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{ "kms_key_id": &schema.Schema{
Type: schema.TypeString, Type: schema.TypeString,

View File

@ -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) { func TestAccAWSEBSVolume_withTags(t *testing.T) {
var v ec2.Volume var v ec2.Volume
resource.Test(t, resource.TestCase{ 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"
}
}
`