You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-3Lines changed: 18 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,16 +55,31 @@ And modify the `src/postgraphileOptions.js` and `serverless.yml` files to your t
55
55
56
56
## Automatic Deployment with Serverless.js
57
57
58
-
#### Deployment Prerequisites
58
+
This repository runs bash scripts during deployment written on Mac which you can find in the `scripts` folder. These scripts should run just fine on Mac and Linux, but you might run into problems on Windows. As a workaround you can just run Linux within Windows and run the deployment scripts there. If you're on Windows 10 you can install a command line Linux distro from the Microsoft Store - there is a guide further below. If you're using another version of Windows, you could run Linux in a VM (or possibly a Docker container).
59
59
60
-
-[serverless](https://serverless.com/framework/docs/providers/aws/guide/installation/) - `yarn global add serverless`
60
+
#### On Mac/Linux
61
61
62
-
After configuring your `.env` file, ~/.aws/credentials, and postgraphileOptions.js, you can deploy to AWS using serverless.js by running:
62
+
- install [serverless](https://serverless.com/framework/docs/providers/aws/guide/installation/) - `yarn global add serverless`
63
+
- Make sure you configured your [aws credentials](https://serverless.com/framework/docs/providers/aws/guide/credentials/) - if you're doing that for the first time, just create the IAM role and then use the aws-cli method as described in the link (Hint: make sure that the IAM role policy you copied from the gist contains `"s3:GetBucketLocation"`)
64
+
65
+
Now you can deploy to AWS using serverless.js by running:
63
66
64
67
```
65
68
yarn deploy
66
69
```
67
70
71
+
#### On Windows 10
72
+
73
+
- After you completed the steps in `Setup`, go to the Microsoft Marketplace in the start menu and install a command line linux distro of your choice (we use ubuntu 18.04 in these instructions).
74
+
- Run ubuntu and create a user and password.
75
+
- Run `sudo apt update` to get access to the latest packages.
76
+
- Install and activate a virtual environment: Follow the steps in [this tutorial](https://linuxize.com/post/how-to-create-python-virtual-environments-on-ubuntu-18-04/) until after the activation. From now on, always keep running within the virtual environment. (Why we do this: We will use the `aws-cli` to provide serverless with AWS credentials to create the stack on AWS on your behalf. `aws-cli` relies on python3 which is also used by the Linux system, but in a different version. In order to avoid version conflicts/incompatibilites, we install the `aws-cli` in a virtual environment which comes with its own python installation.)
77
+
- Install the aws-cli by running `pip install --upgrade awscli` (from within the venv). You can make sure it installed correctly by running `aws --version`.
78
+
- If you haven't already done that, create an IAM role for serverless as described [here](https://serverless.com/framework/docs/providers/aws/guide/credentials/). (Hint: Make sure that the IAM role policy you copied from the gist contains `"s3:GetBucketLocation"`.)
79
+
- Save the credentials to aws-cli by running `aws configure` ([more details](https://serverless.com/framework/docs/providers/aws/guide/credentials#setup-with-the-aws-cli)).
80
+
- Install yarn (you do need to use yarn and not npm because the scripts use yarn) as described on [their website](https://yarnpkg.com/lang/en/docs/install/#debian-stable), serverless with `yarn global add serverless` and zip with `sudo apt-get install zip`.
81
+
- Cd to your postgraphile project folder you created during setup and run `yarn deploy`.
82
+
68
83
## Setting up a Lambda endpoint manually
69
84
70
85
If you prefer not to use the serverless.js framework, you can also deploy your lambda function manually.
0 commit comments