From 628fb1a37c84cb6c7d2eeaf785aea0769265aeb3 Mon Sep 17 00:00:00 2001 From: stack72 Date: Sun, 21 Feb 2016 22:33:48 +0000 Subject: [PATCH] provider/aws: Add test to ECS Service to make sure deployment values are set --- .../aws/resource_aws_ecs_service_test.go | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/builtin/providers/aws/resource_aws_ecs_service_test.go b/builtin/providers/aws/resource_aws_ecs_service_test.go index fcac09ba5..1d1733996 100644 --- a/builtin/providers/aws/resource_aws_ecs_service_test.go +++ b/builtin/providers/aws/resource_aws_ecs_service_test.go @@ -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 func TestAccAWSEcsService_withLbChanges(t *testing.T) { 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 = <