Repository: aws/amazon-ecs-cli-v2
Pull request #287 (2019-11-06 23:59:55)

Move LBFargateStackConfig to stack pkg


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.



Patch:
diff --git a/internal/pkg/cli/app_package.go b/internal/pkg/cli/app_package.go
index 2f89c8d1..7f3d5b3e 100644
--- a/internal/pkg/cli/app_package.go
+++ b/internal/pkg/cli/app_package.go
@@ -15,7 +15,7 @@ import (
 
 	"github.com/aws/amazon-ecs-cli-v2/internal/pkg/archer"
 	"github.com/aws/amazon-ecs-cli-v2/internal/pkg/deploy"
-	"github.com/aws/amazon-ecs-cli-v2/internal/pkg/deploy/cloudformation"
+	"github.com/aws/amazon-ecs-cli-v2/internal/pkg/deploy/cloudformation/stack"
 	"github.com/aws/amazon-ecs-cli-v2/internal/pkg/manifest"
 	"github.com/aws/amazon-ecs-cli-v2/internal/pkg/store/ssm"
 	"github.com/aws/amazon-ecs-cli-v2/internal/pkg/term/color"
@@ -178,16 +178,16 @@ func (opts *PackageAppOpts) getTemplates(env *archer.Environment) (*cfnTemplates
 	}
 	switch t := mft.(type) {
 	case *manifest.LBFargateManifest:
-		stack := cloudformation.NewLBFargateStack(&deploy.CreateLBFargateAppInput{
+		appStack := stack.NewLBFargateStack(&deploy.CreateLBFargateAppInput{
 			App:      mft.(*manifest.LBFargateManifest),
 			Env:      env,
 			ImageTag: opts.Tag,
 		})
-		tpl, err := stack.Template()
+		tpl, err := appStack.Template()
 		if err != nil {
 			return nil, err
 		}
-		params, err := stack.SerializedParameters()
+		params, err := appStack.SerializedParameters()
 		if err != nil {
 			return nil, err
 		}
diff --git a/internal/pkg/deploy/cloudformation/lb_fargate_app.go b/internal/pkg/deploy/cloudformation/stack/lb_fargate_app.go
similarity index 98%
rename from internal/pkg/deploy/cloudformation/lb_fargate_app.go
rename to internal/pkg/deploy/cloudformation/stack/lb_fargate_app.go
index 2eb6830a..51943353 100644
--- a/internal/pkg/deploy/cloudformation/lb_fargate_app.go
+++ b/internal/pkg/deploy/cloudformation/stack/lb_fargate_app.go
@@ -1,7 +1,7 @@
 // Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 // SPDX-License-Identifier: Apache-2.0
 
-package cloudformation
+package stack
 
 import (
 	"bytes"
@@ -35,6 +35,10 @@ const (
 	lbFargateTaskCountKey           = "TaskCount"
 )
 
+const (
+	ecrURLFormatString = "%s.dkr.ecr.%s.amazonaws.com/%s"
+)
+
 // LBFargateStackConfig represents the configuration needed to create a CloudFormation stack from a
 // load balanced Fargate application.
 type LBFargateStackConfig struct {


Test patch:
diff --git a/internal/pkg/deploy/cloudformation/lb_fargate_app_test.go b/internal/pkg/deploy/cloudformation/stack/lb_fargate_app_test.go
similarity index 99%
rename from internal/pkg/deploy/cloudformation/lb_fargate_app_test.go
rename to internal/pkg/deploy/cloudformation/stack/lb_fargate_app_test.go
index 2d46f77e..f4d0b7a2 100644
--- a/internal/pkg/deploy/cloudformation/lb_fargate_app_test.go
+++ b/internal/pkg/deploy/cloudformation/stack/lb_fargate_app_test.go
@@ -1,7 +1,7 @@
 // Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 // SPDX-License-Identifier: Apache-2.0
 
-package cloudformation
+package stack
 
 import (
 	"errors"