Copilot-cli: Specifiy a JSON environment variable results in failed deployment

Created on 18 Aug 2020  ·  3Comments  ·  Source: aws/copilot-cli

Hello,

If I add a JSON string as a variable in my manifest the deployment fails:

variables:
  HASURA_GRAPHQL_JWT_SECRET: "{}"

Results in Model validation failed ("#/ContainerDefinitions/0/Environment/8/Value: expected type: String, found: JSONObject".)

I tried to escape the JSON, but the result is the same.

Where is the expected type taken from? Can I specify it?

copilot version: v0.2.0
macOS 10.15.4 (19E287)

Best regards,
Benedikt

typbug typrequest

Most helpful comment

Hi @BenediktMiller!

I can also reproduce the error while deploying the service:
Screen Shot 2020-08-18 at 10 19 17 AM

It looks like it's because the CFN template that's generated from the manifest does not escape the JSON object itself.

In the mean time to mitigate, one option could be to store the JSON object as a secret in SSM like mentioned in https://github.com/aws/copilot-cli/issues/1291 and I think that should unblock you until we fix the bug.

Sorry for the inconvenience 🙇‍♂️

All 3 comments

Hi @BenediktMiller!

I can also reproduce the error while deploying the service:
Screen Shot 2020-08-18 at 10 19 17 AM

It looks like it's because the CFN template that's generated from the manifest does not escape the JSON object itself.

In the mean time to mitigate, one option could be to store the JSON object as a secret in SSM like mentioned in https://github.com/aws/copilot-cli/issues/1291 and I think that should unblock you until we fix the bug.

Sorry for the inconvenience 🙇‍♂️

The workaround works for me, thank you😃

Related #1120

Was this page helpful?
0 / 5 - 0 ratings