|
|
|
|
@ -14,7 +14,7 @@ import (
|
|
|
|
|
"github.com/hashicorp/terraform/terraform"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestAccAWSLaunchConfiguration_withBlockDevices(t *testing.T) {
|
|
|
|
|
func TestAccAWSLaunchConfiguration_basic(t *testing.T) {
|
|
|
|
|
var conf autoscaling.LaunchConfiguration
|
|
|
|
|
|
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
|
|
|
@ -23,25 +23,18 @@ func TestAccAWSLaunchConfiguration_withBlockDevices(t *testing.T) {
|
|
|
|
|
CheckDestroy: testAccCheckAWSLaunchConfigurationDestroy,
|
|
|
|
|
Steps: []resource.TestStep{
|
|
|
|
|
resource.TestStep{
|
|
|
|
|
Config: testAccAWSLaunchConfigurationConfig,
|
|
|
|
|
Config: testAccAWSLaunchConfigurationNoNameConfig,
|
|
|
|
|
Check: resource.ComposeTestCheckFunc(
|
|
|
|
|
testAccCheckAWSLaunchConfigurationExists("aws_launch_configuration.bar", &conf),
|
|
|
|
|
testAccCheckAWSLaunchConfigurationAttributes(&conf),
|
|
|
|
|
resource.TestCheckResourceAttr(
|
|
|
|
|
"aws_launch_configuration.bar", "image_id", "ami-21f78e11"),
|
|
|
|
|
resource.TestCheckResourceAttr(
|
|
|
|
|
"aws_launch_configuration.bar", "instance_type", "m1.small"),
|
|
|
|
|
resource.TestCheckResourceAttr(
|
|
|
|
|
"aws_launch_configuration.bar", "associate_public_ip_address", "true"),
|
|
|
|
|
resource.TestCheckResourceAttr(
|
|
|
|
|
"aws_launch_configuration.bar", "spot_price", ""),
|
|
|
|
|
testAccCheckAWSLaunchConfigurationGeneratedNamePrefix(
|
|
|
|
|
"aws_launch_configuration.bar", "terraform-"),
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestAccAWSLaunchConfiguration_withSpotPrice(t *testing.T) {
|
|
|
|
|
func TestAccAWSLaunchConfiguration_withBlockDevices(t *testing.T) {
|
|
|
|
|
var conf autoscaling.LaunchConfiguration
|
|
|
|
|
|
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
|
|
|
@ -50,18 +43,25 @@ func TestAccAWSLaunchConfiguration_withSpotPrice(t *testing.T) {
|
|
|
|
|
CheckDestroy: testAccCheckAWSLaunchConfigurationDestroy,
|
|
|
|
|
Steps: []resource.TestStep{
|
|
|
|
|
resource.TestStep{
|
|
|
|
|
Config: testAccAWSLaunchConfigurationWithSpotPriceConfig,
|
|
|
|
|
Config: testAccAWSLaunchConfigurationConfig,
|
|
|
|
|
Check: resource.ComposeTestCheckFunc(
|
|
|
|
|
testAccCheckAWSLaunchConfigurationExists("aws_launch_configuration.bar", &conf),
|
|
|
|
|
testAccCheckAWSLaunchConfigurationAttributes(&conf),
|
|
|
|
|
resource.TestCheckResourceAttr(
|
|
|
|
|
"aws_launch_configuration.bar", "spot_price", "0.01"),
|
|
|
|
|
"aws_launch_configuration.bar", "image_id", "ami-21f78e11"),
|
|
|
|
|
resource.TestCheckResourceAttr(
|
|
|
|
|
"aws_launch_configuration.bar", "instance_type", "m1.small"),
|
|
|
|
|
resource.TestCheckResourceAttr(
|
|
|
|
|
"aws_launch_configuration.bar", "associate_public_ip_address", "true"),
|
|
|
|
|
resource.TestCheckResourceAttr(
|
|
|
|
|
"aws_launch_configuration.bar", "spot_price", ""),
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestAccAWSLaunchConfiguration_withGeneratedName(t *testing.T) {
|
|
|
|
|
func TestAccAWSLaunchConfiguration_withSpotPrice(t *testing.T) {
|
|
|
|
|
var conf autoscaling.LaunchConfiguration
|
|
|
|
|
|
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
|
|
|
@ -70,11 +70,11 @@ func TestAccAWSLaunchConfiguration_withGeneratedName(t *testing.T) {
|
|
|
|
|
CheckDestroy: testAccCheckAWSLaunchConfigurationDestroy,
|
|
|
|
|
Steps: []resource.TestStep{
|
|
|
|
|
resource.TestStep{
|
|
|
|
|
Config: testAccAWSLaunchConfigurationNoNameConfig,
|
|
|
|
|
Config: testAccAWSLaunchConfigurationWithSpotPriceConfig,
|
|
|
|
|
Check: resource.ComposeTestCheckFunc(
|
|
|
|
|
testAccCheckAWSLaunchConfigurationExists("aws_launch_configuration.bar", &conf),
|
|
|
|
|
testAccCheckAWSLaunchConfigurationGeneratedNamePrefix(
|
|
|
|
|
"aws_launch_configuration.bar", "terraform-"),
|
|
|
|
|
resource.TestCheckResourceAttr(
|
|
|
|
|
"aws_launch_configuration.bar", "spot_price", "0.01"),
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|