- Open the page and click on the `Create queue` button.
77
-
- Select the standart queue option and specify the name `gradejs-public`.
77
+
- Select the standard queue option and specify the name `gradejs-public`.
78
78
- Set the `visibility timeout` to 2 minutes.
79
79
- Click on the `Create queue` button.
80
80
skipped 2 lines
83
83
- Open the [AWS Elastic Beanstalk](https://us-east-2.console.aws.amazon.com/elasticbeanstalk/home) page and click on the `Create a new environment` button.
84
84
- Select `Web server environment` option.
85
85
- Type the newly created application name (`gradejs`).
86
-
- Specify an environment name, for example `gradejs-public-api`. Leave the domain and description name fileds blank.
86
+
- Specify an environment name, for example `gradejs-public-api`. Leave the domain and description name fields blank.
87
87
- Select the latest version of Node.js 16 managed platform on Amazon Linux 2. The version minimal required version is 5.5.1.
88
88
- Use the sample application code and click on the `Configure more options` button.
89
89
- Select the `Custom configuration` configuration preset.
90
90
- In the `Software` section click on the `Edit` button.
91
91
- Enable the `CloudWatch` log streaming with a 5 day retention.
92
-
- Specify the `AWS_REGION` environment variable. It should be the same as your current AWS environemnt. For example, `us-east-2`.
92
+
- Specify the `AWS_REGION` environment variable. It should be the same as your current AWS environment. For example, `us-east-2`.
93
93
- Specify the `DB_URL` environment variable. It should point to the newly created RDS database. For example: `postgres://postgres:<secret>@<hostname>/gradejs`.
94
94
- Specify the `INTERNAL_API_ORIGIN` environment variable. Consider using our staging internal API origin: `http://fpjs-dev-gradejs-internal-api.eba-fybi4md5.us-east-1.elasticbeanstalk.com`
95
95
- Specify the `SQS_WORKER_QUEUE_URL` queue. It should be a newly created `gradejs-backend` queue. For example `https://sqs.us-east-2.amazonaws.com/<account_id>/gradejs-backend`.
96
-
- Specify the `AWS_REGION` environment variable. It should be the same as your current AWS environemnt. For example, `us-east-2`.
96
+
- Specify the `CORS_ALLOWED_ORIGIN` variable. Use comma-separated URLs your API will be talking to, for example: `http://localhost:3000,https://staging.gradejs.com`.
97
97
- Specify the `EB_START` environment variable: `api`.
98
98
- Click on the `Save` button and then click on the `Create environment` button.
99
99
skipped 1 lines
101
101
102
102
- Select `Worker environment` option.
103
103
- Type the newly created application name (`gradejs-public`).
104
-
- Specify an environment name: `gradejs-public-worker`. Leave the domain and description name fileds blank.
104
+
- Specify an environment name: `gradejs-public-worker`. Leave the domain and description name fields blank.
105
105
- Select the latest version of Node.js 16 managed platform on Amazon Linux 2. The version minimal required version is 5.5.1.
106
106
- Use the sample application code and click on the `Configure more options` button.
107
107
- Select the `Custom configuration` configuration preset.
skipped 3 lines
111
111
- Set the `EB_START` environment variable to `worker`.
112
112
- Click on the `Save` button and then click on the `Create environment` button.
113
113
114
-
7. Setting up a `Continuous Deploy` pipeline:
114
+
7. Create an [AWS Elastic Beanstalk](https://us-east-2.console.aws.amazon.com/elasticbeanstalk/home) web environment:
115
+
116
+
- Open the [AWS Elastic Beanstalk](https://us-east-2.console.aws.amazon.com/elasticbeanstalk/home) page and click on the `Create a new environment` button.
117
+
- Select `Web server environment` option.
118
+
- Type the newly created application name (`gradejs-web`).
119
+
- Specify an environment name, for example `gradejs-public-web`. Leave the domain and description name fields blank.
120
+
- Select the latest version of Node.js 16 managed platform on Amazon Linux 2. The version minimal required version is 5.5.1.
121
+
- Use the sample application code and click on the `Configure more options` button.
122
+
- Select the `Custom configuration` configuration preset.
123
+
- In the `Software` section click on the `Edit` button.
124
+
- Enable the `CloudWatch` log streaming with a 5 day retention.
125
+
- Specify the `API_ORIGIN` environment variable. It should point to public API entrypoint you created in chapter 5.
126
+
- Specify the `CORS_ORIGIN` environment variable, set it to empty string to disable CORS checks.
127
+
- Specify `PLAUSIBLE_DOMAIN`, `GA_ID` (strings) and `DUMP_ANALYTICS` (bool) to setup analytics if required. Set to empty if not required.
128
+
- Specify the `EB_START` environment variable: `web`.
129
+
- Click on the `Save` button and then click on the `Create environment` button.
130
+
131
+
8. Setting up a `Continuous Deploy` pipeline:
115
132
116
133
- Go to the [AWS CodePipeline](https://us-east-2.console.aws.amazon.com/codesuite/codepipeline/pipelines) page and click on the `Create pipeline` page.
117
134
- Type a pipeline name `gradejs-public@production-deploy` and click on the `Next` button.