|
|
|
|
@ -34,6 +34,7 @@ func TestAccAWSBeanstalkEnv_basic(t *testing.T) {
|
|
|
|
|
|
|
|
|
|
func TestAccAWSBeanstalkEnv_tier(t *testing.T) {
|
|
|
|
|
var app elasticbeanstalk.EnvironmentDescription
|
|
|
|
|
beanstalkQueuesNameRegexp := regexp.MustCompile("https://sqs.+?awseb[^,]+")
|
|
|
|
|
|
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
|
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
|
|
|
@ -44,6 +45,38 @@ func TestAccAWSBeanstalkEnv_tier(t *testing.T) {
|
|
|
|
|
Config: testAccBeanstalkWorkerEnvConfig,
|
|
|
|
|
Check: resource.ComposeTestCheckFunc(
|
|
|
|
|
testAccCheckBeanstalkEnvTier("aws_elastic_beanstalk_environment.tfenvtest", &app),
|
|
|
|
|
resource.TestMatchResourceAttr(
|
|
|
|
|
"aws_elastic_beanstalk_environment.tfenvtest", "queues.0", beanstalkQueuesNameRegexp),
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestAccAWSBeanstalkEnv_outputs(t *testing.T) {
|
|
|
|
|
var app elasticbeanstalk.EnvironmentDescription
|
|
|
|
|
beanstalkAsgNameRegexp := regexp.MustCompile("awseb.+?AutoScalingGroup[^,]+")
|
|
|
|
|
beanstalkElbNameRegexp := regexp.MustCompile("awseb.+?EBLoa[^,]+")
|
|
|
|
|
beanstalkInstancesNameRegexp := regexp.MustCompile("i-([0-9a-fA-F]{8}|[0-9a-fA-F]{17})")
|
|
|
|
|
beanstalkLcNameRegexp := regexp.MustCompile("awseb.+?AutoScalingLaunch[^,]+")
|
|
|
|
|
|
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
|
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
|
|
|
Providers: testAccProviders,
|
|
|
|
|
CheckDestroy: testAccCheckBeanstalkEnvDestroy,
|
|
|
|
|
Steps: []resource.TestStep{
|
|
|
|
|
resource.TestStep{
|
|
|
|
|
Config: testAccBeanstalkEnvConfig,
|
|
|
|
|
Check: resource.ComposeTestCheckFunc(
|
|
|
|
|
testAccCheckBeanstalkEnvExists("aws_elastic_beanstalk_environment.tfenvtest", &app),
|
|
|
|
|
resource.TestMatchResourceAttr(
|
|
|
|
|
"aws_elastic_beanstalk_environment.tfenvtest", "autoscaling_groups.0", beanstalkAsgNameRegexp),
|
|
|
|
|
resource.TestMatchResourceAttr(
|
|
|
|
|
"aws_elastic_beanstalk_environment.tfenvtest", "load_balancers.0", beanstalkElbNameRegexp),
|
|
|
|
|
resource.TestMatchResourceAttr(
|
|
|
|
|
"aws_elastic_beanstalk_environment.tfenvtest", "instances.0", beanstalkInstancesNameRegexp),
|
|
|
|
|
resource.TestMatchResourceAttr(
|
|
|
|
|
"aws_elastic_beanstalk_environment.tfenvtest", "launch_configurations.0", beanstalkLcNameRegexp),
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
@ -189,8 +222,7 @@ resource "aws_elastic_beanstalk_application" "tftest" {
|
|
|
|
|
resource "aws_elastic_beanstalk_environment" "tfenvtest" {
|
|
|
|
|
name = "tf-test-name"
|
|
|
|
|
application = "${aws_elastic_beanstalk_application.tftest.name}"
|
|
|
|
|
solution_stack_name = "64bit Amazon Linux 2015.09 v2.0.8 running Go 1.4"
|
|
|
|
|
#solution_stack_name =
|
|
|
|
|
solution_stack_name = "64bit Amazon Linux running Python"
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
@ -204,7 +236,7 @@ resource "aws_elastic_beanstalk_environment" "tfenvtest" {
|
|
|
|
|
name = "tf-test-name"
|
|
|
|
|
application = "${aws_elastic_beanstalk_application.tftest.name}"
|
|
|
|
|
tier = "Worker"
|
|
|
|
|
solution_stack_name = "64bit Amazon Linux 2015.09 v2.0.4 running Go 1.4"
|
|
|
|
|
solution_stack_name = "64bit Amazon Linux running Python"
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
@ -219,7 +251,7 @@ resource "aws_elastic_beanstalk_environment" "tfenvtest" {
|
|
|
|
|
name = "tf-test-name"
|
|
|
|
|
application = "${aws_elastic_beanstalk_application.tftest.name}"
|
|
|
|
|
cname_prefix = "%s"
|
|
|
|
|
solution_stack_name = "64bit Amazon Linux 2015.09 v2.0.4 running Go 1.4"
|
|
|
|
|
solution_stack_name = "64bit Amazon Linux running Python"
|
|
|
|
|
}
|
|
|
|
|
`, randString)
|
|
|
|
|
}
|
|
|
|
|
|