provider/aws: Add test to ECS Service to make sure deployment values are

set
This commit is contained in:
stack72 2016-02-21 22:33:48 +00:00
parent 5f7060e9f5
commit 628fb1a37c
1 changed files with 48 additions and 0 deletions

View File

@ -178,6 +178,26 @@ func TestAccAWSEcsService_withIamRole(t *testing.T) {
}) })
} }
func TestAccAWSEcsService_withDeploymentValues(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSEcsServiceDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccAWSEcsServiceWithDeploymentValues,
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSEcsServiceExists("aws_ecs_service.mongo"),
resource.TestCheckResourceAttr(
"aws_ecs_service.mongo", "deployment_maximum_percent", "200"),
resource.TestCheckResourceAttr(
"aws_ecs_service.mongo", "deployment_minimum_healthy_percent", "100"),
),
},
},
})
}
// Regression for https://github.com/hashicorp/terraform/issues/3444 // Regression for https://github.com/hashicorp/terraform/issues/3444
func TestAccAWSEcsService_withLbChanges(t *testing.T) { func TestAccAWSEcsService_withLbChanges(t *testing.T) {
resource.Test(t, resource.TestCase{ resource.Test(t, resource.TestCase{
@ -418,6 +438,34 @@ resource "aws_ecs_service" "ghost" {
} }
` `
var testAccAWSEcsServiceWithDeploymentValues = `
resource "aws_ecs_cluster" "default" {
name = "terraformecstest1"
}
resource "aws_ecs_task_definition" "mongo" {
family = "mongodb"
container_definitions = <<DEFINITION
[
{
"cpu": 128,
"essential": true,
"image": "mongo:latest",
"memory": 128,
"name": "mongodb"
}
]
DEFINITION
}
resource "aws_ecs_service" "mongo" {
name = "mongodb"
cluster = "${aws_ecs_cluster.default.id}"
task_definition = "${aws_ecs_task_definition.mongo.arn}"
desired_count = 1
}
`
var tpl_testAccAWSEcsService_withLbChanges = ` var tpl_testAccAWSEcsService_withLbChanges = `
resource "aws_ecs_cluster" "main" { resource "aws_ecs_cluster" "main" {
name = "terraformecstest12" name = "terraformecstest12"