|
2 | 2 | title : "Dev Environment" |
3 | 3 | weight : 16 |
4 | 4 | --- |
| 5 | +### Login to AWS Workshop Studio Portal |
5 | 6 |
|
6 | | -[AWS Cloud9](https://aws.amazon.com/cloud9/) is a cloud-based integrated development environment (IDE) that lets you write, run, and debug code with just a browser. AWS Cloud9 includes a code editor, debugger, and terminal. It also comes prepackaged with essential tools for popular programming languages and the AWS Command Line Interface (CLI) preinstalled so that you don’t have to install files or configure your laptop for this lab. Your AWS Cloud9 environment will have access to the same AWS resources as the user with which you signed in to the AWS Management Console. |
| 7 | +On the event dashboard, click on **Open AWS console** to federate into AWS Management Console in a new tab. On the same page, click **Get started** to open the workshop instructions. |
| 8 | + |
7 | 9 |
|
8 | | -### To set up your AWS Cloud9 development environment: |
| 10 | +In addition to the AWS console you should open your Visual Studio code server, by clicking in the `VSCodeServerURL` parameter, available from the "Event Outputs" section. When prompted for a password use the value from `VSCodeServerPassword`. |
9 | 11 |
|
10 | | -1. Choose **Services** at the top of the page, and then choose **Cloud9** under **Developer Tools**. |
| 12 | + |
11 | 13 |
|
12 | | -2. There would be an environment ready to use under **Your environments**. |
| 14 | +During the first 60 seconds, the environment will automatically update extensions and plugins. Any startup notification can be safely dismissed. |
| 15 | + |
| 16 | + |
13 | 17 |
|
14 | | -3. Click on **Open IDE**, your IDE should open with a welcome note. |
| 18 | +If a terminal is not available at the bottom left side of your screen, please open a new one like the following picture indicates. |
15 | 19 |
|
16 | | -You should now see your AWS Cloud9 environment. You need to be familiar with the three areas of the AWS Cloud9 console shown in the following screenshot: |
| 20 | + |
17 | 21 |
|
18 | | - |
| 22 | +Then run the command `aws sts get-caller-identity` just to verify that your AWS credentials have been properly configured. |
19 | 23 |
|
20 | | -- **File explorer**: On the left side of the IDE, the file explorer shows a list of the files in your directory. |
21 | | - |
22 | | -- **File editor**: On the upper right area of the IDE, the file editor is where you view and edit files that you’ve selected in the file explorer. |
23 | | - |
24 | | -- **Terminal**: On the lower right area of the IDE, this is where you run commands to execute code samples. |
| 24 | + |
25 | 25 |
|
26 | 26 |
|
27 | 27 | From within the terminal: |
28 | 28 |
|
29 | | -2. Run the command ```aws sts get-caller-identity``` just to verify that your AWS credentials have been properly configured. |
| 29 | +To keep our python files and dependencies organized lets create a python virtual environment: |
| 30 | + |
| 31 | +```bash |
| 32 | +python -m venv .venv |
| 33 | +source .venv/bin/activate |
| 34 | +``` |
30 | 35 |
|
31 | | -3. Clone the repository containing the Chalice code and migration scripts. Run: |
| 36 | +Clone the repository containing the Chalice code and migration scripts. Run: |
32 | 37 |
|
33 | 38 | ```bash |
34 | | -cd ~/environment |
| 39 | +cd /home/participant/workshop/LSQL |
35 | 40 | git clone https://github.com/aws-samples/aws-dynamodb-examples.git |
36 | 41 | cd aws-dynamodb-examples |
37 | | -git checkout :param{key="lsql_git_commit"} |
38 | | -``` |
39 | | - |
40 | | - |
41 | | -*This checkout command ensures you are using a specific, tested version of the repository* |
42 | | - |
43 | | -```bash |
44 | 42 | cd workshops/relational-migration |
45 | 43 | ``` |
46 | 44 |
|
47 | | -4. Next, run this to install three components: Boto3 (AWS SDK for Python), Chalice, and the MySQL connector for Python. |
| 45 | +Next, run this to install three components: Boto3 (AWS SDK for Python), Chalice, and the MySQL connector for Python. |
48 | 46 |
|
49 | 47 | ```bash |
50 | 48 | sudo pip3 install chalice mysql-connector-python |
51 | 49 | ``` |
52 | 50 |
|
53 | | -5. From the left navigation panel, locate our project folder by |
54 | | - clicking into ```aws-dynamodb-examples / workshops / relational-migration``` |
| 51 | +From the left navigation panel, locate our project folder by clicking into ```LSQL / aws-dynamodb-examples / workshops / relational-migration``` |
55 | 52 |
|
56 | | -6. Find the gear icon near the top of the left nav panel, and click "show hidden files" . |
57 | | - You may now see a folder called ```.chalice``` under the main **relational-migration** folder. |
58 | | - Within this folder is the ```config.json``` file that holds the MySQL connection details. |
59 | | - A script will automatically update this file in the next step. |
| 53 | +Navigate to the `.chalice` folder under the main **relational-migration** folder. Within this folder is the ```config.json``` file that holds the MySQL connection details. A script will automatically update this file in the next step. |
60 | 54 |
|
61 | | -7. Return to the terminal prompt window. Run this file which |
62 | | - uses AWS CLI commands to find the MySQL host's IP address and S3 bucket name, then sets them as |
63 | | - environment variables, while also updating the Chalice config.json file: |
| 55 | +Return to the terminal prompt window. Run this file which, uses AWS CLI commands to find the MySQL host's IP address and S3 bucket name, then sets them as environment variables, while also updating the Chalice config.json file: |
64 | 56 |
|
65 | 57 | ```bash |
66 | 58 | source ./setenv.sh |
|
0 commit comments