How can I set the PRISMA_CONFIG environment in aws...
# orm-help
x
How can I set the PRISMA_CONFIG environment in aws task?
s
Where is it running?
ECS Task? Lambda? etc.
x
aws Fargate
s
Inside your task definition
there’s an
environment
section
[{“name”: “NAME”, “value”:“X”}]
x
but
x
PRISMA_CONFIG is not single line string
s
I use:
Copy code
"environment": [
        {
          "name": "PORT",
          "value": "60000"
        }, {
          "name": "SQL_CLIENT_HOST",
          "value": "${var.db_endpoint}"
        }, {
          "name": "SQL_CLIENT_PORT",
          "value": "3306"
        }, {
          "name": "SQL_CLIENT_USER",
          "value": "${var.db_username}"
        }, {
          "name": "SQL_CLIENT_PASSWORD",
          "value": "${var.db_password}"
        },  {
          "name": "SQL_CLIENT_CONNECTION_LIMIT",
          "value": "10"
        },  {
          "name": "SQL_INTERNAL_HOST",
          "value": "${var.db_endpoint}"
        },  {
          "name": "SQL_INTERNAL_PORT",
          "value": "3306"
        },  {
          "name": "SQL_INTERNAL_USER",
          "value": "${var.db_username}"
        },  {
          "name": "SQL_INTERNAL_PASSWORD",
          "value": "${var.db_password}"
        },  {
          "name": "SQL_INTERNAL_DATABASE",
          "value": "graphcool"
        },  {
          "name": "SQL_INTERNAL_CONNECTION_LIMIT",
          "value": "10"
        },  {
          "name": "JAVA_OPTS",
          "value": "-Xmx1350m"
        },  {
          "name": "CLUSTER_ADDRESS",
          "value": "${aws_lb.prisma.dns_name}"
        },  {
          "name": "SCHEMA_MANAGER_SECRET",
          "value": "notrequired"
        },  {
          "name": "BUGSNAG_API_KEY",
          "value": ""
        },  {
          "name": "MANAGEMENT_API_SECRET",
          "value": "${var.prisma_management_api_secret}"
        },  {
          "name": "PRISMA_MANAGEMENT_API_JWT_SECRET",
          "value": "${var.prisma_management_api_secret}"
        }
      ],
x
How can I set this?
s
You don’t need too, just use the above method
x
Isn't it the same?
s
No.. the above is simple key:value. What you’re trying to do is embed an object a large multi-line string in a value
It can be done, but it’ll be a lot less readable
x
PRISMA_CONFIG is a multi-line string
s
Well then just set it in the task definition
x
It uses yaml '|'
s
Though I’d recommend doing it in a more readable way if possible,
x
This command works in terminal.
docker run -e PRISMA_CONFIG=$'port: 4466\ndatabases:\n default:\n connector: mysql\n host: xxx.rds.amazonaws.com\n port: 3306\n user: xxx\n password: xxx\n migrations: true' prismagraphql/prisma:1.20
s
Then put that in the task definition… I don’t know how many times I have to say it, lol
x
But aws task environment ignore repeated white space
or someting else
It
it's not work
s
Then do it the way I suggested
x
So how to define PRISMA_CONFIG?
s
You don’t, you define the underlying env vars that it uses
x
😯
But it
it's not an object
😧