|
|
|
|
@ -48,6 +48,28 @@ func TestAccAWSBeanstalkConfigurationTemplate_VPC(t *testing.T) {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestAccAWSBeanstalkConfigurationTemplate_Setting(t *testing.T) {
|
|
|
|
|
var config elasticbeanstalk.ConfigurationSettingsDescription
|
|
|
|
|
|
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
|
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
|
|
|
Providers: testAccProviders,
|
|
|
|
|
CheckDestroy: testAccCheckBeanstalkConfigurationTemplateDestroy,
|
|
|
|
|
Steps: []resource.TestStep{
|
|
|
|
|
resource.TestStep{
|
|
|
|
|
Config: testAccBeanstalkConfigurationTemplateConfig_Setting(acctest.RandString(5)),
|
|
|
|
|
Check: resource.ComposeTestCheckFunc(
|
|
|
|
|
testAccCheckBeanstalkConfigurationTemplateExists("aws_elastic_beanstalk_configuration_template.tf_template", &config),
|
|
|
|
|
resource.TestCheckResourceAttr(
|
|
|
|
|
"aws_elastic_beanstalk_configuration_template.tf_template", "setting.#", "1"),
|
|
|
|
|
resource.TestCheckResourceAttr(
|
|
|
|
|
"aws_elastic_beanstalk_configuration_template.tf_template", "setting.4112217815.value", "m1.small"),
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func testAccCheckBeanstalkConfigurationTemplateDestroy(s *terraform.State) error {
|
|
|
|
|
conn := testAccProvider.Meta().(*AWSClient).elasticbeanstalkconn
|
|
|
|
|
|
|
|
|
|
@ -177,3 +199,26 @@ resource "aws_elastic_beanstalk_configuration_template" "tf_template" {
|
|
|
|
|
}
|
|
|
|
|
`, name, name)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func testAccBeanstalkConfigurationTemplateConfig_Setting(name string) string {
|
|
|
|
|
return fmt.Sprintf(`
|
|
|
|
|
resource "aws_elastic_beanstalk_application" "tftest" {
|
|
|
|
|
name = "tf-test-%s"
|
|
|
|
|
description = "tf-test-desc"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
resource "aws_elastic_beanstalk_configuration_template" "tf_template" {
|
|
|
|
|
name = "tf-test-%s"
|
|
|
|
|
application = "${aws_elastic_beanstalk_application.tftest.name}"
|
|
|
|
|
|
|
|
|
|
solution_stack_name = "64bit Amazon Linux running Python"
|
|
|
|
|
|
|
|
|
|
setting {
|
|
|
|
|
namespace = "aws:autoscaling:launchconfiguration"
|
|
|
|
|
name = "InstanceType"
|
|
|
|
|
value = "m1.small"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
`, name, name)
|
|
|
|
|
}
|
|
|
|
|
|