Add test for iops with gp2, remove strict validation
This commit is contained in:
parent
d1bba3095b
commit
5e54bcc6ff
|
@ -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,
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
`
|
||||
|
|
Loading…
Reference in New Issue