This repository was archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
Eb deployment #23
Open
steve-louis
wants to merge
21
commits into
develop
Choose a base branch
from
eb_deployment
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Eb deployment #23
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
e7d995a
Add ignore for .ebextensions and .elasticbeanstalk
steve-louis 9b9ff81
Update package.json for EB deployments
steve-louis 2f3dc9c
Add MONGO_CONNECTION_STRING environment variable
steve-louis c9d27dd
Add API_PORT environment variable
steve-louis 2913cc8
Forgot process.env for API env var
steve-louis 7a2f33a
Add .ebextensions configs
steve-louis 37d9606
Add sample mongo connection string to env var
steve-louis d0f74eb
Use default EB proxy and correct mongo port
steve-louis b8dcfb5
Add EC2 KeyPair config
steve-louis 33fdcad
Add eb deployment README and dir structure
steve-louis 4e62214
Add https proxy to eb config
steve-louis 9e81887
Add Getting Started section for eb deployment
steve-louis 1c65706
Remove extra SSH key steps
steve-louis a9f35b7
Add Creating EB deployment docs
steve-louis 223710e
Update Mongo SG description
steve-louis 11288fa
Add setting up MongoDB instance docs
steve-louis 2af0ec0
Adding Connecting Backend to Mongo docs
steve-louis 42e50ce
Add eb deployment wrap-up
steve-louis dee874f
Add links to the next doc
steve-louis 76f24d5
Add steps on how to terminate environment
steve-louis c6a4c0c
PR feedback typo and doc improvments
steve-louis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # Elastic Beanstalk Configuration files | ||
| .elasticbeanstalk/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # Getting Started | ||
|
|
||
| Before you can create resources in AWS you will first need to configure your local environment. | ||
|
|
||
| Note that the EB CLI requires Python to be installed on your system. | ||
|
|
||
| ### AWS Authentication Keys | ||
|
|
||
| 1) Login into your AWS Educate account and select "AWS Account" on the top right | ||
|
|
||
|
|
||
| 2) Select "AWS Educate Starter Account" which should open a new tab | ||
|
|
||
|  | ||
|
|
||
|
|
||
| 3) Select the "Account Details" button and you will be presented with | ||
|
|
||
|  | ||
|
|
||
|
|
||
| 4) Using your favorite editor copy the entire contents of the "AWS CLI" section to the `~/.aws/credentials` file on Mac/Linux and `%UserProfile%\.aws\credentials` on Windows. | ||
| More information can be found in the [CLI Configuration Docs](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) | ||
|
|
||
| <br> | ||
| <br> | ||
| Now that your API credentials are saved, you will be able to authenticate against your AWS account using CLI tools as well as programs that use the AWS SDK. Note that AWS Educate tokens expire after 3 hours, so please repeat these steps if you receive an expired session error. | ||
| <br> | ||
| <br> | ||
|
|
||
| ### Install and Configure the EB CLI | ||
| EB ClI - See installation [instructions](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install-advanced.html) for your OS | ||
|
|
||
| Once installed check that the CLI is installed by running: | ||
|
|
||
| ``` | ||
| eb --version | ||
| EB CLI 3.19.3 (Python 3.8.5) | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| Next: [Creating EB Environment](../02_Creating_EB_Environment/README.md) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+56.1 KB
docs/beanstalk/01_Getting_Started/images/4_Editing_AWS_Credentials_File.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| # Creating Your Elastic Beanstalk Environment | ||
|
|
||
| Now that you have the EB CLI installed, you will be able to push your Backend (Server) code to Elastic Beanstalk in your AWS account. | ||
|
|
||
| Note that all of the following will take place withing the `server` directory. | ||
|
|
||
| ## Initializing Your Elastic Beanstalk Project | ||
|
|
||
| Initializing your Elastic Beanstalk project will create a `.elasticbeanstalk` folder which will contain a configuration file with information about your EB deployment. | ||
|
|
||
|
|
||
| <br> | ||
| 1) Run the `eb init` command which will prompt you for a few questions. You make your selection by typing the matching number or character and pressing "Enter". | ||
| Make sure to select the "US East (N. Virginia)" option which should be #1. | ||
|
|
||
|  | ||
|
|
||
|
|
||
| <br> | ||
| 2) You will now be prompted to either create an application or select an existing on. Enter the number for "Create a new Application" | ||
|
|
||
|  | ||
|
|
||
|
|
||
| <br> | ||
| 3) Next you will be prompted to enter the name of your project. In this example "CSCL" was used. Feel free to use a different name. | ||
|
|
||
|  | ||
|
|
||
|
|
||
| <br> | ||
| 4) Now you will be asked if you are "using Node.js", enter `y` or "yes". Next, choose the "Node.js 12" option which should be #1. | ||
|
|
||
|  | ||
|
|
||
|
|
||
| <br> | ||
| 5) You will be prompted to create an "SSH key pair". Enter `y`to accept. When prompted for a name, you must enter the same name that was referenced earlier in the deployment. Since we used "CSCL" earlier, it should be "cscl". | ||
|
|
||
|  | ||
|
|
||
|
|
||
| <br> | ||
| 6) You will be prompted to enter a passphrase. Press "Enter" two times to enter a blank passphrase if you don't wish to use one. Setting a passphrase will require you to enter it whenever you attempt to connect to your server using SSH. | ||
|
|
||
|
|
||
|  | ||
|
|
||
|
|
||
| <br> | ||
| 7) Congrats! Your EB environment has been initialized locally. You will notice a new folder called `elasticbeanstalk` which will contain your configuration file. | ||
|
|
||
|  | ||
|
|
||
|
|
||
| ## Creating your EB environment in AWS | ||
|
|
||
| Now that your configuration has been initialized. The EB CLI will use your config in `.elasticbeanstalk` and the deployment configs in `.ebextensions` to create your environment. | ||
|
|
||
| <br> | ||
| Making sure that you are still in the `server` directory. Run the `eb crreate` command followed by the name of the environment you are creating. You will be able to create multiple environments and also delete it later. So don't worry if you need to change the name. | ||
|
|
||
|  | ||
|
|
||
| Once you kick off the deployment, EB CLI will display the log events on your console. This can take a few minutes, so feel free to check back later. | ||
|
|
||
| Once finished you will be presented with the output. | ||
|
|
||
|  | ||
| <br> | ||
| <br> | ||
| This deployment create the following resources: | ||
|
|
||
| - API Gateway: Used to proxy (pass along) your HTTP requests to your Beanstalk server. This allows you to connect using HTTPS which will allow your Frontend to call your Backend server without generating any security errors. | ||
|
|
||
| - EC2 Instance running MongoDB: This server is using a Bitnami Image containing MongoDB. This is where your database will live. | ||
|
|
||
| - Elastic Beanstalk deployment: This represents a number of resources which include an EC2 instance where your code will be running. | ||
|
|
||
|
|
||
| ## Updating the Code | ||
|
|
||
| Whenever you are ready to update your code on AWS. Run the `eb deploy` command. You can provide an environment name if you have more than one using `eb deploy <environment name>`. | ||
|
|
||
| --- | ||
|
|
||
| Next: [Setting Up Mongo](../03_Setting_Up_Mongo/README.md) | ||
Binary file added
BIN
+14.9 KB
docs/beanstalk/02_Creating_EB_Environment/images/EB_CLI_Create_1_CSCL.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+180 KB
docs/beanstalk/02_Creating_EB_Environment/images/EB_CLI_Create_2_CSCL_Finished.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+105 KB
docs/beanstalk/02_Creating_EB_Environment/images/EB_CLI_INIT_1_Select_Region.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.9 KB
docs/beanstalk/02_Creating_EB_Environment/images/EB_CLI_INIT_2_Create_New_App.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.23 KB
docs/beanstalk/02_Creating_EB_Environment/images/EB_CLI_INIT_3_Set_Name.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+25 KB
...eanstalk/02_Creating_EB_Environment/images/EB_CLI_INIT_4_Configure_Platform.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.5 KB
docs/beanstalk/02_Creating_EB_Environment/images/EB_CLI_INIT_5_SSH_Key_Setup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+27.5 KB
...eanstalk/02_Creating_EB_Environment/images/EB_CLI_INIT_6_SSH_Key_Passphrase.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+41.7 KB
docs/beanstalk/02_Creating_EB_Environment/images/EB_CLI_INIT_7_Finish.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,157 @@ | ||
| # Configuring MongoDB | ||
|
|
||
| After deploying your application to AWS you will need to access your MongoDB server so that you can import your database data. First you will need to add an entry in the Security Group which can be thought as a Firewall rule and then retrieving the MongoDB credentials from the logs. | ||
|
|
||
| One of the easiest ways to access and manage a Mongo database is to use [MongoDB Compass](https://www.mongodb.com/try/download/compass). Download and install it and follow the instructions down below. | ||
|
|
||
| ## Getting MongoDB Credentials | ||
|
|
||
| First, you will be getting your MongoDB username and password. The server imaged used to create this database server . | ||
|
|
||
| Follow the [instrcutions](https://docs.bitnami.com/aws/faq/get-started/find-credentials/#option-1-find-password-by-checking-the-system-log-on-the-aws-cloud-console-ec2) to learn how you can retrieve those credentials. Make sure to save that information for now. It will be necessary for later steps. | ||
|
|
||
| ## Getting MongoDB IPs | ||
| Your MongoDB server will have two IPs. A Private one used to access it within your Virtual Private Cloud (VPC) network. The other is a Public one used to access it over the internet. | ||
|
|
||
| <br> | ||
| 1) Make you r way to the EC2 dashboard by typing "EC2" in the search bar and selecting "EC2". You will be presented with the EC2 dashboard. | ||
|
|
||
|  | ||
|
|
||
|
|
||
| <br> | ||
| 2) Click on the "Instances" link to view all of your current EC2 instances. | ||
|
|
||
|  | ||
|
|
||
|
|
||
| <br> | ||
| 3) On this screen you will see all of your instances. There should only be two at the moment. One for MongoDB and one for Elastic Beanstalk. | ||
|
|
||
|  | ||
|
|
||
|
|
||
| <br> | ||
| 4) To the right you should see the Public IP address for your MongoDB instance. Look at the instance named "CSCL_DB". Do note this Public IP address. | ||
|
|
||
|  | ||
|
|
||
|
|
||
| <br> | ||
| 5) Click on the "Instance ID" of the "CSCL_DB" instance to go to the Instance Profile screen. Here you will see lots of information about your instance, including monitoring metrics. Do note the Private IP address. | ||
|
|
||
|  | ||
|
|
||
| ## Granting Access to MongoDB Server From Current IP | ||
| Now that you have the IP addresses of your MongoDB server. You will need to open up a port so that you can access it from your local machine. | ||
|
|
||
| <br> | ||
| 1) First you will need to click the "Security Group" link in the left-side menu. | ||
|
|
||
|  | ||
|
|
||
|
|
||
|
|
||
| <br> | ||
| 2) On this screen you will see all of your current Security Groups. Locate the one with a description of "Lock MongoDB down to webserver access" and click the "Security Group ID" link. | ||
|
|
||
|  | ||
|
|
||
|
|
||
| <br> | ||
| 3) On this screen you will see information about the Security Group associated with the MongoDB server. You should only see a single Inbound rule and an unrestricted Outbound rule. Click the "Edit Inbound Rule" button. | ||
|
|
||
|  | ||
|
|
||
|
|
||
|
|
||
| <br> | ||
| 4) On this screen you will be able to add and remove rules. You will only need to add a single rule to grant yourself access to the Mongo Server. | ||
|
|
||
|  | ||
|
|
||
|
|
||
| <br> | ||
| 5) For the Type select "Custom TCP". For the "Port Range" enter "27017". For the source, select "My IP" which should populate the next field with your current IP address. Feel free to add a description if you wish. | ||
|
|
||
|  | ||
|
|
||
|
|
||
| <br> | ||
| 6) Once your new rule has been added, click "Save Rules" | ||
|
|
||
|  | ||
|
|
||
|
|
||
| <br> | ||
| 7) You will be taken to the Secrurity Group page where you can review all the Inbound rules again. | ||
|
|
||
|  | ||
|
|
||
|
|
||
| <br> | ||
| At this point, your MongoDB server will be accessible from your current IP address and the Elastic Beanstalk server. If you are using a VPN or public IP, remember to remove access as soon as you are done. | ||
|
|
||
| ## Constructing the MongoDB Connection String | ||
|
|
||
| Now that we have the database credentials, the private and public ip address of your MongoDB server, you can create the connection strings. Use the following template to construct your connection strings, one will be used to access the database from your local machine and the other from the EB server. | ||
|
|
||
| Public Connection String: | ||
| ``` | ||
| mongodb://<username>:<password>@<publicIP>/admin | ||
| ``` | ||
|
|
||
| Private Connection String (used by your backend server): | ||
| ``` | ||
| mongodb://<username>:<password>@<privateIp>/cscl?authSource=admin | ||
| ``` | ||
| *Note that "cscl" in the Private connection string is the name of your database. Update the connection string accordingly if you are using a different database.* | ||
|
|
||
| ## Connecting to MongoDB Using MongoDB Compass and Importing Your Data | ||
| Now that you have network access to the database, you can use MongoDB Compass to connect to it and import your data. | ||
|
|
||
| <br> | ||
| 1) In MongoDB Compass click "New Connection" and enter the "Public Connection String" you created earlier in the text field then click "CONNECT". | ||
|
|
||
|  | ||
|
|
||
|
|
||
| <br> | ||
| 2) Once logged in you will be presented with the current databases on your MongoDB server. Click the "CREATE DATABASE" button at the top to create a new database. | ||
|
|
||
|  | ||
|
|
||
|
|
||
| <br> | ||
| 3) On this form, enter the desired database name. For these instructions "cscl" will be used for the database. "items" will be used for the collection name. Click "Create Database" once done. | ||
|
|
||
|  | ||
|
|
||
|
|
||
| <br> | ||
| 4) Once your database is created you will be presented with the list of all databases. Select the database you created, i.e. "cscl". | ||
|
|
||
|  | ||
|
|
||
|
|
||
| <br> | ||
| 5) Select the collection that you created under your database, i.e. "items" | ||
|
|
||
|  | ||
|
|
||
|
|
||
| <br> | ||
| 6) Click the "ADD DATA" button in the upper-left, and select "Import File". | ||
|
|
||
|  | ||
|
|
||
|
|
||
| <br> | ||
| 7) Select the JSON file provided to you in the  or your own MongoDB backup. Enable the Options that you would like, and click "IMPORT". | ||
|
|
||
|  | ||
|
|
||
| --- | ||
| Congrats! You now have loaded data into your Mongo database in the cloud. Feel free to remove your IP address entry from the Security Group to remove access to your Database server. | ||
|
|
||
| Next: [Connecting the Backend to MongoDB](../04_Connecting_Backend_to_Mongo) |
Binary file added
BIN
+286 KB
...ting_Up_Mongo/images/Connecting_To_Mongo/MongoServer_1_EC2_Dashboard_Screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+293 KB
...ngo/images/Connecting_To_Mongo/MongoServer_2_EC2_Dashboard_Select_Instances.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+127 KB
.../03_Setting_Up_Mongo/images/Connecting_To_Mongo/MongoServer_3_EC2_Instances.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+159 KB
...Setting_Up_Mongo/images/Connecting_To_Mongo/MongoServer_4_EC2_Get_Public_IP.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+227 KB
...etting_Up_Mongo/images/Connecting_To_Mongo/MongoServer_5_EC2_Get_Private_IP.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+149 KB
...Up_Mongo/images/Connecting_To_Mongo/sg_add_current_ip_for_Mongo_1_select_sg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+167 KB
...go/images/Connecting_To_Mongo/sg_add_current_ip_for_Mongo_2_locate_mongo_sg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+149 KB
.../images/Connecting_To_Mongo/sg_add_current_ip_for_Mongo_3_sg_profile_screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+92.6 KB
...Mongo/images/Connecting_To_Mongo/sg_add_current_ip_for_Mongo_4_add_new_rule.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+97.6 KB
..._Mongo/images/Connecting_To_Mongo/sg_add_current_ip_for_Mongo_5_select_myip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+95.3 KB
..._Up_Mongo/images/Connecting_To_Mongo/sg_add_current_ip_for_Mongo_6_IP_added.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+152 KB
...g_Up_Mongo/images/Connecting_To_Mongo/sg_add_current_ip_for_Mongo_7_summary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+83 KB
.../03_Setting_Up_Mongo/images/Mongo_Compass/1_Mongo_Compass_connect_to_server.png
Oops, something went wrong.
Binary file added
BIN
+56 KB
...k/03_Setting_Up_Mongo/images/Mongo_Compass/2_Mongo_Compass_create_db_screen.png
Oops, something went wrong.
Binary file added
BIN
+74.4 KB
...Mongo/images/Mongo_Compass/3_Mongo_Compass_creating_database_and_collection.png
Oops, something went wrong.
Binary file added
BIN
+56.8 KB
...lk/03_Setting_Up_Mongo/images/Mongo_Compass/4_Mongo_Compass_select_database.png
Oops, something went wrong.
Binary file added
BIN
+52.2 KB
.../03_Setting_Up_Mongo/images/Mongo_Compass/5_Mongo_Compass_select_collection.png
Oops, something went wrong.
Binary file added
BIN
+75.2 KB
...03_Setting_Up_Mongo/images/Mongo_Compass/6_Mongo_Compass_import_file_button.png
Oops, something went wrong.
Binary file added
BIN
+89.6 KB
...03_Setting_Up_Mongo/images/Mongo_Compass/7_Mongo_Compass_import_file_submit.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # Connecting The Backend to MongoDB | ||
| You will now update your backend server so it will be able to connect to the MongoDB server. This will be achieved by providing a connection string using an Environment Variable. | ||
| Here is an helpful [video](https://www.youtube.com/watch?v=ADh_OFBfdEE) explaining what Environment Variables are. | ||
|
|
||
| ## Updating Your Backend Environment | ||
|
|
||
| Retrieve the Private IP connection string you created in the previous sections. Make sure that you are in the `server` directory and use the `eb setenv` command to update your backend server's environment variables. Note that you can use `eb list` to view the available environments. | ||
|
|
||
| The format is: | ||
| ```shell | ||
| MONGO_CONNECTION_STRING=<PRIVATE_CONNECTION_STRING> -e <EB_ENVIRONMENT> | ||
| ``` | ||
|
|
||
|  | ||
|
|
||
| --- | ||
|
|
||
| Once deployed, your backend server will be able to connect to your MongoDB Database. | ||
|
|
||
| Next: [Wrapping Up](../05_Wrapping_Up/README.md) |
Binary file added
BIN
+56.1 KB
...stalk/04_Connecting_Backend_to_Mongo/images/ebcli_setting_mongo_conn_string.png
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # Wrapping UP | ||
| Congrats for making it this far, you're almost all set up and ready to fully deploy your app. You will now be retrieving your backend's Gateway URL which will be used in your Frontend environment to fetch, create and update data using your API. | ||
|
|
||
| ## Getting Your API URL | ||
| <br> | ||
| 1) In the AWS console, search for "API Gateway" and click "API Gateway". | ||
|
|
||
|  | ||
|
|
||
|
|
||
| <br> | ||
| 2) You should only see a single API called "CSCL-HTTPS-Proxy". Click the link to view the configuration. | ||
|
|
||
|  | ||
|
|
||
|
|
||
| <br> | ||
| 3) On this screen, you will see your API Gateway's URL. This is the URL that will be used to access your API in Elastic Beanstalk. | ||
|
|
||
|  | ||
|
|
||
| ## Testing | ||
| Now that you have the URL you can test it by copying it to your browser and pressing enter. You should see the response from the root (`/`) route of your API. | ||
| Also, you can test using Curl or Postman | ||
|
|
||
|
|
||
| Curl) | ||
|
|
||
|  | ||
|
|
||
|
|
||
| Postman) | ||
|  | ||
|
|
||
|
|
||
| ## What's Next | ||
|
|
||
| To delete all resources created by your deployment, run the `eb terminate <environment>` command. | ||
|
|
||
|  | ||
|
|
||
| --- | ||
|
|
||
| Next up is to create your frontend using AWS Amplify. Make sure to note the API Gateway URL because it will be used in the Frontend deployment. | ||
|
|
||
| [Amplify Deployment Documentation](../../amplify/README.md) | ||
|
|
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Deploying The Client Using AWS Elastic Beanstalk | ||
| Elastic Beanstalk is an Amazon service which gives Developers the ability to quickly deploy an application to the cloud without having worry about complex configuration and the management of cloud resources. For the API Server (Backend) and database, this will involve using the EB CLI tool to trigger an automated deployment to create a single API server, and a Mongo database server, along with the necessary resources to get your environment up and running. | ||
|
|
||
| You can find more information at the [Elastic Beanstalk Product Page](https://aws.amazon.com/elasticbeanstalk/). | ||
|
|
||
| ## Getting Started | ||
| 1) Set up your AWS account. You should have received that information from a member of the Hack team. | ||
|
|
||
| 2) Set up your GitHub account. If you're reading this, there is a good chance that you have already done that. | ||
|
|
||
| 3) Fork this repository under your team or personal account. | ||
|
|
||
| ## Preparing For the Deployment | ||
| A deployment is pushing a version of your code to an environment (developmernt, production, etc...). This version of your application is usually available to your end users, in this case it will be publicly available on the internet. By following the steps below, your code will be packaged and automatically deployed to AWS Elastic Beanstalk. There will be some manual steps for the initial deployment, but all subsequent deployments will only update your code.. | ||
|
|
||
| Please follow the instructions in the linked sections below to deploy your API to AWS: | ||
|
|
||
| 1) [Setup](./01_Getting_Started/README.md) | ||
|
|
||
| 2) [Creating Your Elastic Beanstalk Environment](./02_Creating_EB_Environment/README.md) | ||
|
|
||
| 3) [Setting Up Mongo](./03_Setting_Up_Mongo/README.md) | ||
|
|
||
| 4) [Connecting Backend to Mongo](./04_Connecting_Backend_To_Mongo/README.md) | ||
|
|
||
| 5) [Wrapping Up](./05_Wrapping_Up/README.md) | ||
|
|
||
|
|
||
| ### Conclusion | ||
| Now that your app has been deployed to AWS Elastic Beanstalk, you will be able to retrieve, edit, and create data through your API over the internet. Please explore the Elastic Beanstalk dashboard for other neat features. Also, do remember to open an issue on this repository if you find any mistakes with these instructions. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.