Repository: aws/copilot-cli

Issue:
"Upload artifacts for environment" when using both Aurora and S3 in environment addons
I'm trying to use an Aurora instance and an S3 bucket at the environment level in my CoPilot app but I'm getting this error when I deploy the environment

`upload artifacts for environment production-env: parse environment addons: parameter logical ID "Env" defined in "db-env.yml" at Ln 6, Col 5 is different than in "s3-env.yml" at Ln 6, Col 5 `

Is this a bug in Copilot or have I done something wrong? If it is a bug, is there a workaround?

Discussion:
@Lou1415926: Hey @richardbored ! Certainly an unusual error. Can you take a look at the `Parameters` section of `db-env.yml` and `s3-env.yml`, look for the parameter named `Env`? Does any of them has the `Default` field specified under? If you feel comfortable with sharing the snippet, it'd certainly help as well!@richardbored: I did find a workaround in the end. In `environments/addons/s3-env.yml`, I changed the Env Description from `The name of the environment being deployed.` to `The environment name your service, job, or workflow is being deployed to.` to match the description in `environments/addons/db-env.yml`.

Just to be clear, this is what Copilot produced for the s3-env.yml.
```
Parameters:
  App:
    Type: String
    Description: Your application's name.
  Env:
    Type: String
    Description: The name of the environment being deployed.
```

This is what I changed it to.

```
Parameters:
  App:
    Type: String
    Description: Your application's name.
  Env:
    Type: String
    Description: The environment name your service, job, or workflow is being deployed to.
```

I'm not entirely sure why that worked, but the env updated without any problems afterwards.

@Lou1415926: Ahhh @richardbored great find!! 

> I'm not entirely sure why that worked, but the env updated without any problems afterwards.

When deploying addons, Copilot merges all the addon templates into one template and deploy it as a nested stack to your main service stack. 

Copilot merges the template section by section. So it requires that each template does not have conflicting information. For example you can't merge the following:
```yaml
# addons/a.yml
Parameters:
  Env:
     Type: String
      Default: test
# addons/b.yml
Parameters:
  Env:
     Type: String
      Default: prod
```

I will send out a fix to update the generated addons template so that each parameters' `Description` is the same. Thank you very much for pointing this out!


@KollaAdithya: Fix is now released in v1.28 https://github.com/aws/copilot-cli/releases/tag/v1.28.0. Thanks @richardbored for reporting this!@xxRockOnxx: I would like to request to re-open this issue because it still exists.

The fix (making description the same) still works.

Solution patch:
diff --git a/e2e/multi-pipeline/s3template.yml b/e2e/multi-pipeline/s3template.yml
index c9562042..ea42a00f 100644
--- a/e2e/multi-pipeline/s3template.yml
+++ b/e2e/multi-pipeline/s3template.yml
@@ -7,7 +7,7 @@ Parameters:
     Description: The environment name your service, job, or workflow is being deployed to.
   Name:
     Type: String
-    Description: The name of the service, job, or workflow being deployed.
+    Description: Your workload's name.
 Resources:
   e2epipelineaddonBucket:
     Metadata:
diff --git a/internal/pkg/template/templates/addons/aurora/cf.yml b/internal/pkg/template/templates/addons/aurora/cf.yml
index c450e6cc..bd7e0cc2 100644
--- a/internal/pkg/template/templates/addons/aurora/cf.yml
+++ b/internal/pkg/template/templates/addons/aurora/cf.yml
@@ -7,7 +7,7 @@ Parameters:
     Description: The environment name your service, job, or workflow is being deployed to.
   Name:
     Type: String
-    Description: The name of the service, job, or workflow being deployed.
+    Description: Your workload's name.
   # Customize your Aurora Serverless cluster by setting the default value of the following parameters.
   {{logicalIDSafe .ClusterName}}DBName:
     Type: String
diff --git a/internal/pkg/template/templates/addons/aurora/env/rdws/ingress.yml b/internal/pkg/template/templates/addons/aurora/env/rdws/ingress.yml
index 59865c05..39fa84e0 100644
--- a/internal/pkg/template/templates/addons/aurora/env/rdws/ingress.yml
+++ b/internal/pkg/template/templates/addons/aurora/env/rdws/ingress.yml
@@ -4,7 +4,7 @@ Parameters:
     Description: Your application's name.
   Env:
     Type: String
-    Description: The environment name your request-driven web service is being deployed to.
+    Description: The environment name your service, job, or workflow is being deployed to.
   Name:
     Type: String
     Description: Your workload's name.
diff --git a/internal/pkg/template/templates/addons/aurora/env/rdws/serverlessv2.yml b/internal/pkg/template/templates/addons/aurora/env/rdws/serverlessv2.yml
index a227e219..5098f7c9 100644
--- a/internal/pkg/template/templates/addons/aurora/env/rdws/serverlessv2.yml
+++ b/internal/pkg/template/templates/addons/aurora/env/rdws/serverlessv2.yml
@@ -4,7 +4,7 @@ Parameters:
     Description: Your application's name.
   Env:
     Type: String
-    Description: The environment name your service, job, or workflow is being deployed to.
+    Description: The name of the environment being deployed.
   # Customize your Aurora Serverless cluster by setting the default value of the following parameters.
   {{logicalIDSafe .ClusterName}}DBName:
     Type: String
diff --git a/internal/pkg/template/templates/addons/aurora/env/serverlessv2.yml b/internal/pkg/template/templates/addons/aurora/env/serverlessv2.yml
index 2506b8ef..be324063 100644
--- a/internal/pkg/template/templates/addons/aurora/env/serverlessv2.yml
+++ b/internal/pkg/template/templates/addons/aurora/env/serverlessv2.yml
@@ -4,7 +4,7 @@ Parameters:
     Description: Your application's name.
   Env:
     Type: String
-    Description: The environment name your service, job, or workflow is being deployed to.
+    Description: The name of the environment being deployed.
   # Customize your Aurora Serverless cluster by setting the default value of the following parameters.
   {{logicalIDSafe .ClusterName}}DBName:
     Type: String
diff --git a/internal/pkg/template/templates/addons/aurora/rdws/cf.yml b/internal/pkg/template/templates/addons/aurora/rdws/cf.yml
index 9559d98a..30b1de14 100644
--- a/internal/pkg/template/templates/addons/aurora/rdws/cf.yml
+++ b/internal/pkg/template/templates/addons/aurora/rdws/cf.yml
@@ -7,7 +7,7 @@ Parameters:
     Description: The environment name your service, job, or workflow is being deployed to.
   Name:
     Type: String
-    Description: The name of the service, job, or workflow being deployed.
+    Description: Your workload's name.
   ServiceSecurityGroupId:
     Type: String
     Description: The security group associated with the VPC connector.
diff --git a/internal/pkg/template/templates/addons/aurora/rdws/serverlessv2.yml b/internal/pkg/template/templates/addons/aurora/rdws/serverlessv2.yml
index 8094f65f..6d699e46 100644
--- a/internal/pkg/template/templates/addons/aurora/rdws/serverlessv2.yml
+++ b/internal/pkg/template/templates/addons/aurora/rdws/serverlessv2.yml
@@ -7,7 +7,7 @@ Parameters:
     Description: The environment name your service, job, or workflow is being deployed to.
   Name:
     Type: String
-    Description: The name of the service, job, or workflow being deployed.
+    Description: Your workload's name.
   ServiceSecurityGroupId:
     Type: String
     Description: The security group associated with the VPC connector.
diff --git a/internal/pkg/template/templates/addons/aurora/serverlessv2.yml b/internal/pkg/template/templates/addons/aurora/serverlessv2.yml
index 28776c0c..a5960c6c 100644
--- a/internal/pkg/template/templates/addons/aurora/serverlessv2.yml
+++ b/internal/pkg/template/templates/addons/aurora/serverlessv2.yml
@@ -7,7 +7,7 @@ Parameters:
     Description: The environment name your service, job, or workflow is being deployed to.
   Name:
     Type: String
-    Description: The name of the service, job, or workflow being deployed.
+    Description: Your workload's name.
   # Customize your Aurora Serverless cluster by setting the default value of the following parameters.
   {{logicalIDSafe .ClusterName}}DBName:
     Type: String
diff --git a/internal/pkg/template/templates/addons/ddb/cf.yml b/internal/pkg/template/templates/addons/ddb/cf.yml
index 2a966875..caa34d93 100644
--- a/internal/pkg/template/templates/addons/ddb/cf.yml
+++ b/internal/pkg/template/templates/addons/ddb/cf.yml
@@ -7,7 +7,7 @@ Parameters:
     Description: The environment name your service, job, or workflow is being deployed to.
   Name:
     Type: String
-    Description: The name of the service, job, or workflow being deployed.
+    Description: Your workload's name.
 Resources:
   {{logicalIDSafe .Name}}:
     Metadata:
diff --git a/internal/pkg/template/templates/addons/s3/cf.yml b/internal/pkg/template/templates/addons/s3/cf.yml
index df195594..db708d9b 100644
--- a/internal/pkg/template/templates/addons/s3/cf.yml
+++ b/internal/pkg/template/templates/addons/s3/cf.yml
@@ -7,7 +7,7 @@ Parameters:
     Description: The environment name your service, job, or workflow is being deployed to.
   Name:
     Type: String
-    Description: The name of the service, job, or workflow being deployed.
+    Description: Your workload's name.
 Resources:
   {{logicalIDSafe .Name}}Bucket:
     Metadata:
diff --git a/site/content/docs/developing/addons/environment.en.md b/site/content/docs/developing/addons/environment.en.md
index 088b904d..954dd1e3 100644
--- a/site/content/docs/developing/addons/environment.en.md
+++ b/site/content/docs/developing/addons/environment.en.md
@@ -213,7 +213,7 @@ function with that value's export name to import it from an environment addon.
         Description: The environment name your service, job, or workflow is being deployed to.
       Name:
         Type: String
-        Description: The name of the service, job, or workflow being deployed.
+        Description: Your workload's name.
     Resources:
       MyTableAccessPolicy:
         Type: AWS::IAM::ManagedPolicy
diff --git a/site/content/docs/developing/addons/environment.ja.md b/site/content/docs/developing/addons/environment.ja.md
index 44affb2e..12a9672f 100644
--- a/site/content/docs/developing/addons/environment.ja.md
+++ b/site/content/docs/developing/addons/environment.ja.md
@@ -206,7 +206,7 @@ Environment Addon からの値は、ワークロード Addon またはワーク
         Description: The environment name your service, job, or workflow is being deployed to.
       Name:
         Type: String
-        Description: The name of the service, job, or workflow being deployed.
+        Description: Your workload's name.
     Resources:
       MyTableAccessPolicy:
         Type: AWS::IAM::ManagedPolicy
diff --git a/site/content/docs/developing/addons/workload.en.md b/site/content/docs/developing/addons/workload.en.md
index 4fbc8e5c..739ae6b2 100644
--- a/site/content/docs/developing/addons/workload.en.md
+++ b/site/content/docs/developing/addons/workload.en.md
@@ -188,7 +188,7 @@ Parameters:
     Description: The environment name your service, job, or workflow is being deployed to.
   Name:
     Type: String
-    Description: The name of the service, job, or workflow being deployed.
+    Description: Your workload's name.
 
 Resources:
   # Create your resource here, such as an AWS::DynamoDB::Table:
diff --git a/site/content/docs/developing/addons/workload.ja.md b/site/content/docs/developing/addons/workload.ja.md
index c9cb4b5c..0b9b5a61 100644
--- a/site/content/docs/developing/addons/workload.ja.md
+++ b/site/content/docs/developing/addons/workload.ja.md
@@ -183,7 +183,7 @@ Parameters:
     Description: The environment name your service, job, or workflow is being deployed to.
   Name:
     Type: String
-    Description: The name of the service, job, or workflow being deployed.
+    Description: Your workload's name.
 
 Resources:
   # AWS::DynamoDB::Table などのリソースをここで作成します。



Test patch:
diff --git a/internal/pkg/addon/testdata/merge/env/first.yaml b/internal/pkg/addon/testdata/merge/env/first.yaml
index b975fc30..99840f5f 100644
--- a/internal/pkg/addon/testdata/merge/env/first.yaml
+++ b/internal/pkg/addon/testdata/merge/env/first.yaml
@@ -10,7 +10,7 @@ Parameters:
     Description: Your application's name.
   Env:
     Type: String
-    Description: The environment name your service, job, or workflow is being deployed to.
+    Description: The name of the environment being deployed.
 
 Mappings:
   MyTableDynamoDBSettings:
diff --git a/internal/pkg/addon/testdata/merge/env/second.yaml b/internal/pkg/addon/testdata/merge/env/second.yaml
index 0341def8..470722a4 100644
--- a/internal/pkg/addon/testdata/merge/env/second.yaml
+++ b/internal/pkg/addon/testdata/merge/env/second.yaml
@@ -16,7 +16,7 @@ Parameters:
   # Different indentation and order should not matter.
   Env:
     Type: String
-    Description: The environment name your service, job, or workflow is being deployed to.
+    Description: The name of the environment being deployed.
   App: # Line comment is ignored.
       Type: String
       Description: Your application's name.
diff --git a/internal/pkg/addon/testdata/merge/env/wanted.yaml b/internal/pkg/addon/testdata/merge/env/wanted.yaml
index 109a32e0..a4e6e4be 100644
--- a/internal/pkg/addon/testdata/merge/env/wanted.yaml
+++ b/internal/pkg/addon/testdata/merge/env/wanted.yaml
@@ -12,7 +12,7 @@ Parameters:
     Description: Your application's name.
   Env:
     Type: String
-    Description: The environment name your service, job, or workflow is being deployed to.
+    Description: The name of the environment being deployed.
   IsProd:
     Type: String
     Default: "false"
diff --git a/internal/pkg/addon/testdata/merge/first.yaml b/internal/pkg/addon/testdata/merge/first.yaml
index 02f80bbc..9e007576 100644
--- a/internal/pkg/addon/testdata/merge/first.yaml
+++ b/internal/pkg/addon/testdata/merge/first.yaml
@@ -13,7 +13,7 @@ Parameters:
         Description: The environment name your service, job, or workflow is being deployed to.
     Name:
         Type: String
-        Description: The name of the service, job, or workflow being deployed.
+        Description: Your workload's name.
 
 Mappings:
     MyTableDynamoDBSettings:
diff --git a/internal/pkg/addon/testdata/merge/invalid-parameters.yaml b/internal/pkg/addon/testdata/merge/invalid-parameters.yaml
index 97556118..d826e9b7 100644
--- a/internal/pkg/addon/testdata/merge/invalid-parameters.yaml
+++ b/internal/pkg/addon/testdata/merge/invalid-parameters.yaml
@@ -1,5 +1,5 @@
 Parameters:
     Name:
       Type: String
-      Description: The name of the service, job, or workflow being deployed.
+      Description: Your workload's name.
       Default: api # "Default" doesn't exist in first.yaml, therefore it should error.
\ No newline at end of file
diff --git a/internal/pkg/addon/testdata/merge/second.yaml b/internal/pkg/addon/testdata/merge/second.yaml
index f3a35bd0..21562b0e 100644
--- a/internal/pkg/addon/testdata/merge/second.yaml
+++ b/internal/pkg/addon/testdata/merge/second.yaml
@@ -16,7 +16,7 @@ Parameters:
     # Different indentation and order should not matter.
     Name:
       Type: String
-      Description: The name of the service, job, or workflow being deployed.
+      Description: Your workload's name.
     App: # Line comment is ignored.
         Type: String
         Description: Your application's name.
diff --git a/internal/pkg/addon/testdata/merge/wanted.yaml b/internal/pkg/addon/testdata/merge/wanted.yaml
index ac5f3dc4..0273c820 100644
--- a/internal/pkg/addon/testdata/merge/wanted.yaml
+++ b/internal/pkg/addon/testdata/merge/wanted.yaml
@@ -15,7 +15,7 @@ Parameters:
     Description: The environment name your service, job, or workflow is being deployed to.
   Name:
     Type: String
-    Description: The name of the service, job, or workflow being deployed.
+    Description: Your workload's name.
   IsProd:
     Type: String
     Default: "false"
diff --git a/internal/pkg/addon/testdata/storage/aurora.yml b/internal/pkg/addon/testdata/storage/aurora.yml
index 59dc57cb..5a2af74b 100644
--- a/internal/pkg/addon/testdata/storage/aurora.yml
+++ b/internal/pkg/addon/testdata/storage/aurora.yml
@@ -7,7 +7,7 @@ Parameters:
     Description: The environment name your service, job, or workflow is being deployed to.
   Name:
     Type: String
-    Description: The name of the service, job, or workflow being deployed.
+    Description: Your workload's name.
   # Customize your Aurora Serverless cluster by setting the default value of the following parameters.
   auroraDBName:
     Type: String
diff --git a/internal/pkg/addon/testdata/storage/bucket.yml b/internal/pkg/addon/testdata/storage/bucket.yml
index a780c42a..0a2cacbd 100644
--- a/internal/pkg/addon/testdata/storage/bucket.yml
+++ b/internal/pkg/addon/testdata/storage/bucket.yml
@@ -7,7 +7,7 @@ Parameters:
     Description: The environment name your service, job, or workflow is being deployed to.
   Name:
     Type: String
-    Description: The name of the service, job, or workflow being deployed.
+    Description: Your workload's name.
 Resources:
   bucketBucket:
     Metadata:
diff --git a/internal/pkg/addon/testdata/storage/ddb.yml b/internal/pkg/addon/testdata/storage/ddb.yml
index 46e6d7d2..1dead38a 100644
--- a/internal/pkg/addon/testdata/storage/ddb.yml
+++ b/internal/pkg/addon/testdata/storage/ddb.yml
@@ -7,7 +7,7 @@ Parameters:
     Description: The environment name your service, job, or workflow is being deployed to.
   Name:
     Type: String
-    Description: The name of the service, job, or workflow being deployed.
+    Description: Your workload's name.
 Resources:
   ddb:
     Metadata: