Just checking, but for `prisma deploy` is there a ...
# orm-help
k
Just checking, but for
prisma deploy
is there a way I can have my
PRISMA_MANAGEMENT_API_SECRET
secret NOT defined in
~/.prisma/config.yml
? I just added a nice
.env
file with the var defined for when I use
docker-compose
for the Prisma server. The
managementApiSecret
option gets populated automatically thanks to the
.env
file when it reads
docker-compose.yml
. I was initially hoping
prisma deploy
would read and find the var defined in the
.env
there but nope, I gotta duplicate my secret between different files (
.env
and
~/.prisma/config.yml
) - I'd like one source of truth if possible but not a huge deal if not...
👍 1
n
how does your
.env
file look like?
k
@nilan Sorry. I got distracted there - went onto tackling a bunch of docker issues unrelated to Prisma all Thursday. I see that there is the option
--env-file
for
prisma deploy
. So I defined a new .env that looks like this:
Copy code
PRISMA_STAGE="dev"
PRISMA_ENDPOINT="<http://ec2-18-204-34-223.compute-1.amazonaws.com/:4466/server-prisma/dev>"
PRISMA_CLUSTER="aws01"
PRISMA_SECRET="my_prisma_secret"
APP_SECRET="my_app_secret"
PRISMA_MANAGEMENT_API_SECRET="my_api_secret"
(wrote some fake secrets)
My endpoint is alive and visiting it in a browser I get a playground interface.
in
~/.prisma/config.yml
I have the following:
Copy code
clusters:
  local:
    host: '<http://localhost:4466>'
    clusterSecret: "my_api_secret" # PRISMA_MANAGEMENT_API_SECRET
  aws01:
    host: '<http://ec2-18-204-34-223.compute-1.amazonaws.com/:4466>'
    clusterSecret: "my_api_secret" # PRISMA_MANAGEMENT_API_SECRET
Deploy works fine locally but not at all for my other cluster (which I call
aws01
). When I run
prisma deploy -e ./.env.aws01
I get a funky error...

https://puu.sh/AbF3Q/bf2c87b38c.png

I'm honestly confused by how my
~/.prisma/config.yml
, my
./database/prisma.yml
, and
.env
actually comes together when
prisma deploy
is fired. 😩
n
that's a great question! we should explain this better, could you please create a new discussion about this in the Forum? 🙂
oh and I don't understand how your error comes to be, looks like the CLI might hit the wrong endpoint (but it's still hitting a GraphQL endpoint)
k
@nilan Long weekend. I got it working coming back to it today and unfortunately I'm not 100% sure on what I did to make it work. I committed the sin of changing a half dozen things (including updating to 1.7.4) between attempts. So, I'm no use there! I was able to reproduce by adding a / before the :4466 in the host definition in
~/.prisma/config.yml
, something I had fixed without much thought when I resumed work today.
host: '<http://ec2-xx-xxx-xx-xxx.compute-1.amazonaws.com:4466>'
works,
host: '<http://ec2-xx-xxx-xx-xxx.compute-1.amazonaws.com/:4466>'
doesn't work even though I think that's acceptable formatting for a browser's address bar. Is that a dumb mistake that's my own problem? Or do you think prisma should be robust in handling poor host formatting? Looks like there exists some talk about prisma deploy and these various config files going on right now so I'm not going to add another thread.
n
I am not sure 🙂 do you have a resource that documents that
/:
is valid?
when I enter
<https://example.com/:123>
on https://www.freeformatter.com/url-parser-query-string-splitter.html,
:123
is detected as a "resource". for
<https://example.com:123>
,
:123
is detected as the port
💯 1