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: content/global-serverless-application/getting_started/aws-ws-event.en.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,30 +7,29 @@ chapter: true
7
7
8
8
### Login to AWS Workshop Studio Portal
9
9
10
-
1. If you are provided a one-click join link, skip to step 3.
10
+
1. If you are provided a one-click join link, use it and skip to step 3.
11
11
12
12
2. Visit [https://catalog.us-east-1.prod.workshops.aws](https://catalog.us-east-1.prod.workshops.aws). If you attended any other workshop earlier on this portal, please logout first. Click on **Get Started** on the right hand side of the window.
13
-
14
13

15
14
16
15
3. On the next, **Sign in** page, choose **Email One-Time Passcode (OTP)** to sign in to your workshop page.
17
-
18
16

19
17
20
18
4. Provide an email address to receive a one-time passcode.
5. Enter the passcode that you received in the provided email address, and click **Sign in**.
25
22
26
23
6. Next, in the textbox, enter the event access code (eg: abcd-012345-ef) that you received from the event facilitators. If you are provided a one-click join link, you will be redirected to the next step automatically.
7. Select on **I agree with the Terms and Conditions** on the bottom of the next page and click **Join event** to continue to the event dashboard.
31
27
32
28
8. 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.
9. 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`.
Copy file name to clipboardExpand all lines: content/global-serverless-application/getting_started/on-your-own.en.md
+15-12Lines changed: 15 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,26 +5,29 @@ weight: 5
5
5
chapter: true
6
6
---
7
7
8
-
::alert[These setup instructions are identitical for LADV, LHOL, LBED, LMR, and LGME - all of which use the same Cloud9 template. Only complete this section once, and only if you're running it on your own account.]{type="warning"}
8
+
::alert[These setup instructions are identitical for LADV, LHOL, LBED, LMR, and LGME - all of which use the same Visual Studio Code template. Only complete this section once, and only if you're running it on your own account.]{type="warning"}
9
9
10
-
::alert[Only complete this section if you are running the workshop on your own. If you are at an AWS hosted event (such as re\:Invent, Immersion Day, etc), go to :link[At an AWS hosted Event]{href="/global-serverless-application/getting_started/aws-ws-event"}]
10
+
::alert[Only complete this section if you are running the workshop on your own. If you are at an AWS hosted event (such as re\:Invent, Immersion Day, etc), go to :link[At an AWS hosted Event]{href="/hands-on-labs/setup/aws-ws-event"}]
11
11
12
12
## Launch the CloudFormation stack
13
13
::alert[During the course of the lab, you will make DynamoDB tables that will incur a cost that could approach tens or hundreds of dollars per day. Ensure you delete the DynamoDB tables using the DynamoDB console, and make sure you delete the CloudFormation stack as soon as the lab is complete.]
14
14
15
-
1. Launch the CloudFormation template in US West 2 to deploy the resources in your account: [](https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks/new?stackName=DynamoDBID&templateURL=:param{key="design_patterns_s3_lab_yaml"})
16
-
*Optionally, download [the YAML template](:param{key="design_patterns_s3_lab_yaml"}) and launch it your own way*
15
+
1.**[Deprecated]** - Launch the CloudFormation template in US West 2 to deploy the resources in your account: [](https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks/new?stackName=DynamoDBID&templateURL=:param{key="design_patterns_s3_lab_yaml"})
17
16
18
-
2. Click *Next* on the first dialog.
17
+
1.*Optionally, download [the YAML template](https://github.com/aws-samples/aws-dynamodb-examples/blob/master/workshops/modernizer/modernizer-db.yaml) from our GitHub repository and launch it your own way*
19
18
20
-
3. In the Parameters section, note the *Timeout* is set to zero. This means the Cloud9 instance will not sleep; you may want to change this manually to a value such as 60 to protect against unexpected charges if you forget to delete the stack at the end.
21
-
Leave the *WorkshopZIP* parameter unchanged and click *Next*
4. Scroll to the bottom and click *Next*, and then review the *Template* and *Parameters*. When you are ready to create the stack, scroll to the bottom, check the box acknowledging the creation of IAM resources, and click *Create stack*.
26
-
27
-

28
-
The stack will create a Cloud9 lab instance, a role for the instance, and a role for the AWS Lambda function used later on in the lab. It will use Systems Manager to configure the Cloud9 instance.
23
+
1. In the Parameters section, note the *AllowedIP** contains a default IP Address, if you want to access the instance via SSH obtain your own public IP address. Ensure to add the `/32` network mask at the end. Do not modify any other parameter and click *Next*.
6. Scroll to the bottom and click *Next*, and then review the *Template* and *Parameters*. When you are ready to create the stack, scroll to the bottom, check the box acknowledging the creation of IAM resources, and click *Create stack*.
The stack will create a Visual Studio Code EC2 instance, a role for the instance, and a role for the AWS Lambda function used later on in the lab. The CloudFormation template will create a set of folders that can be used to execute individually the lab modules presented in this guide.
29
32
30
33
5. After the CloudFormation stack is `CREATE_COMPLETE`, :link[continue onto Module 1]{href="/global-serverless-application/module_1"}.
Copy file name to clipboardExpand all lines: content/global-serverless-application/module_1/index.en.md
+57-29Lines changed: 57 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,41 +3,54 @@ title : "Module 1: Deploy the backend resources"
3
3
weight : 20
4
4
---
5
5
6
+
### Login to AWS Workshop Studio Portal
6
7
7
-
## Setup Steps
8
-
This lab requires a terminal shell with Python3 and the AWS Command Line Interface (CLI) installed and configured with admin credentials.
8
+
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.
We will use AWS Cloud9 for this event. [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.
11
+
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`.
11
12
12
-
### To set up your AWS Cloud9 development environment:
3. Click on **Open** under **Cloud9 IDE**, and your IDE should open with a welcome note.
19
+
If a terminal is not available at the bottom left side of your screen, please open a new one like the following picture indicates.
19
20
20
-
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:
1. Run ```aws sts get-caller-identity``` to verify the AWS CLI is functioning
32
-
2. Run ```python3 --version``` to verify that python3 is installed
33
-
3. Your Cloud9 environment is already configured with boto3, but for this lab we will also need AWS Chalice.
34
-
Run ```sudo python3 -m pip install chalice``` to install [AWS Chalice](https://github.com/aws/chalice).
27
+
28
+
From within the terminal:
29
+
30
+
To keep our python files and dependencies organized lets create a python virtual environment, in the LMR folder:
31
+
32
+
```bash
33
+
cd LMR
34
+
python -m venv .venv
35
+
source .venv/bin/activate
36
+
```
37
+
38
+
Your VS Code environment is already configured with boto3, but for this lab we will also need [AWS Chalice](https://github.com/aws/chalice).
39
+
40
+
```bash
41
+
pip install chalice
42
+
```
35
43
36
44
::alert[You may see a couple of WARNING lines near the bottom of the command output, these are safely ignored.]{type="info"}
37
45
38
-
4. Run ```curl -O https://amazon-dynamodb-labs.com/assets/global-serverless.zip```
39
-
5. Run ```unzip global-serverless.zip && cd global-serverless```
40
-
6. To see what application resources we will be deploying you can open the **app.py** file by navigating to "global-serverless/app.py" in the file explorer. This code defines Lambda function and API Gateway routes.
To see what application resources we will be deploying you can open the **app.py** file by navigating to "global-serverless/app.py" in the file explorer. This code defines Lambda function and API Gateway routes.
41
54
42
55
### Deploy a new DynamoDB table
43
56
1. In your terminal, run:
@@ -121,10 +134,18 @@ aws dynamodb get-item \
121
134
122
135
### Deploy the backend API service to the first region
123
136
124
-
1. Run ```export AWS_DEFAULT_REGION=us-west-2``` to instruct Chalice to deploy into us-west-2 for our first region
125
-
2. Run ```chalice deploy``` and wait for the infrastructure to be created. Chalice is a Python based serverless framework.
137
+
1. Run the following instruction to instruct Chalice to deploy into us-west-2 for our first region
138
+
```bash
139
+
export AWS_DEFAULT_REGION=us-west-2
140
+
```
141
+
142
+
2. Run the following instruction and wait for the infrastructure to be created. Chalice is a Python based serverless framework.
143
+
```bash
144
+
chalice deploy
145
+
```
146
+
126
147
3. When the script completes, it reports a list of resources deployed. **Copy and paste the Rest API URL into a note as you will need it later.**
127
-
4. Copy that REST API URL and paste it into a new browser tab to test it. You should see a JSON response of {ping: "ok"}
148
+
4. Copy that REST API URL and paste it into a new browser tab to test it. You should see a JSON response of `{ping: "ok"}`
128
149
5. You can type in certain paths to the end of the URL. Add the word scan so that the URL now ends with ```/api/scan```
129
150
You should see a JSON response representing the results of a table scan.
130
151
@@ -149,13 +170,20 @@ Click Ping again and check the latency.
149
170
You now have a test harness where you can perform reads and writes to a DynamoDB record via the custom API.
150
171
151
172
### Deploy the service stack to the second region, Ireland
152
-
1. Run ```export AWS_DEFAULT_REGION=eu-west-1``` to instruct Chalice to deploy into eu-west-1 for our second region.
153
-
2. Run ```chalice deploy``` and wait for the infrastructure to be created in eu-west-1.
173
+
1. Run the following instruction to instruct Chalice to deploy into eu-west-1 for our second region.
174
+
```bash
175
+
export AWS_DEFAULT_REGION=eu-west-1
176
+
```
177
+
178
+
2. Run the following instruction and wait for the infrastructure to be created in eu-west-1.
179
+
```bash
180
+
chalice deploy
181
+
```
154
182
3. When the script completes, it reports a list of resources deployed. Again, copy down the new REST API URL to a note for later use.
155
183
4. Return to the web app.
156
184
5. Click **Add API** again and paste in the new API URL. A second row of buttons appears in an alternate color.
157
185
158
-
Note: In this workshop you have permissions for Global Tables in us-west-2 and eu-west-1.
186
+
Note: In this workshop you have permissions for Global Tables in `us-west-2` and `eu-west-1`.
159
187
In your own account you could add any number of replicas in any regions.
160
188
161
189
Note 2: If you make any changes to the code in ```app.py```, you can push the updates to your Lambda function
0 commit comments