From c6741cf1b53d5ab9b95a2ac05dddb04f43a9952f Mon Sep 17 00:00:00 2001 From: Jack Pearkes Date: Thu, 31 Jul 2014 20:35:31 -0400 Subject: [PATCH] providers/aws: add tests for instance availability zone cc/ @dcosson here we go! --- builtin/providers/aws/resource_aws_instance_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/builtin/providers/aws/resource_aws_instance_test.go b/builtin/providers/aws/resource_aws_instance_test.go index e27db231d..8d6f88fb3 100644 --- a/builtin/providers/aws/resource_aws_instance_test.go +++ b/builtin/providers/aws/resource_aws_instance_test.go @@ -13,6 +13,10 @@ func TestAccAWSInstance_normal(t *testing.T) { var v ec2.Instance testCheck := func(*terraform.State) error { + if v.AvailZone != "us-west-2a" { + return fmt.Errorf("bad availability zone: %#v", v.AvailZone) + } + if len(v.SecurityGroups) == 0 { return fmt.Errorf("no security groups: %#v", v.SecurityGroups) } @@ -193,6 +197,8 @@ resource "aws_security_group" "tf_test_foo" { resource "aws_instance" "foo" { # us-west-2 ami = "ami-4fccb37f" + availability_zone = "us-west-2a" + instance_type = "m1.small" security_groups = ["${aws_security_group.tf_test_foo.name}"] user_data = "foo"