Dear god I need to automate this
- Log into Fauna via the UI
- Create a database (
crcarrick.dev
, US region group) - Security -> Create Key -> Call it
Admin
- COPY THE SECRET
yarn global add fauna-shell
fauna cloud-login
? The endpoint alias prefix (to combine with a region): (cloud) crcarrick.dev
? How do you prefer to authenticate? (Use arrow keys)
Email and Password
❯ Secret
? Secret (from a key or token): COPIED_SECRET
? Select a region
Classic
Europe (EU)
❯ United States (US)
fauna upload-graphql-schema fauna/gql/schema.gql
fauna eval --file=fauna/fql/indexes.fql
fauna eval --file=fauna/fql/roles.fql
fauna eval --file=fauna/fql/functions.fql
- Security -> Create Key -> Role:
netlify
-> Call itNetlify
- COPY THE SECRET
ntl env:set FAUNADB_SECRET "COPIED_SECRET"
- Follow
PROD
"Initial Steps", instead naming the databasecrcarrick.dev__DEV
fauna add-endpoint https://db.us.fauna.com --alias=crcarrick.dev__DEV-us --key=COPIED_SECRET
echo "graphqlHost=graphql.us.fauna.com" >> ~/.fauna-shell
Follow the PROD
"Setup GQL" steps, appending --endpoint=crcarrick\.dev__DEV-us
to the end of each command
Follow the PROD
"Setup Netlify" steps, instead naming the env variable FAUNADB_DEV_SECRET