From 91378ce0af30411b82d9b06f08e64546ba8d5eb6 Mon Sep 17 00:00:00 2001 From: Graham Floyd Date: Fri, 23 Jan 2015 15:51:25 -0600 Subject: [PATCH] Add test for launch configuration with spot price --- .../resource_aws_launch_configuration_test.go | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/builtin/providers/aws/resource_aws_launch_configuration_test.go b/builtin/providers/aws/resource_aws_launch_configuration_test.go index 64591ea44..32036af59 100644 --- a/builtin/providers/aws/resource_aws_launch_configuration_test.go +++ b/builtin/providers/aws/resource_aws_launch_configuration_test.go @@ -30,6 +30,18 @@ func TestAccAWSLaunchConfiguration(t *testing.T) { "aws_launch_configuration.bar", "instance_type", "t1.micro"), resource.TestCheckResourceAttr( "aws_launch_configuration.bar", "associate_public_ip_address", "true"), + resource.TestCheckResourceAttr( + "aws_launch_configuration.bar", "spot_price", ""), + ), + }, + + resource.TestStep{ + Config: TestAccAWSLaunchConfigurationWithSpotPriceConfig, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSLaunchConfigurationExists("aws_launch_configuration.bar", &conf), + testAccCheckAWSLaunchConfigurationAttributes(&conf), + resource.TestCheckResourceAttr( + "aws_launch_configuration.bar", "spot_price", "0.01"), ), }, }, @@ -129,3 +141,14 @@ resource "aws_launch_configuration" "bar" { associate_public_ip_address = true } ` + +const TestAccAWSLaunchConfigurationWithSpotPriceConfig = ` +resource "aws_launch_configuration" "bar" { + name = "foobar-terraform-test" + image_id = "ami-21f78e11" + instance_type = "t1.micro" + user_data = "foobar-user-data" + associate_public_ip_address = true + spot_price = "0.01" +} +`