Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Commit 65e744a

Browse files
committed
Updating instructions and screenshots to reflect new console UI
1 parent 997cfac commit 65e744a

18 files changed

+50
-55
lines changed

WebApplication/2_UserManagement/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ From the Amazon Cognito console select your user pool and then select the **App
9595
<details>
9696
<summary><strong>Step-by-step instructions (expand for details)</strong></summary><p>
9797

98-
1. From the Pool Details page for your user pool, select **App clients** from the left navigation bar.
98+
1. From the Pool Details page for your user pool, select **App clients** from the **General settings** section in the left navigation bar.
9999

100-
1. Click **Add an app client**.
100+
1. Choose **Add an app client**.
101101

102-
1. Give the app a name such as `WildRydesWebApp`.
102+
1. Give the app client a name such as `WildRydesWebApp`.
103103

104104
1. **Uncheck** the Generate client secret option. Client secrets aren't supported for use with browser-based applications.
105105

106-
1. Click **Create app client**.
106+
1. Choose **Create app client**.
107107

108108
<kbd>![Create app client screenshot](../images/add-app.png)</kbd>
109109

WebApplication/3_ServerlessBackend/README.md

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Attach the managed policy called `AWSLambdaBasicExecutionRole` to this role to g
6161

6262
1. Select **Roles** in the left navigation bar and then choose **Create new role**.
6363

64-
1. Select **Lambda** for the role type from **AWS Service Role**, then click **Next: Permissions**
64+
1. Select **Lambda** for the role type from the **AWS service** group, then click **Next: Permissions**
6565

6666
**Note:** Selecting a role type automatically creates a trust policy for your role that allows AWS services to assume this role on your behalf. If you were creating this role using the CLI, AWS CloudFormation or another mechanism, you would specify a trust policy directly.
6767

@@ -75,22 +75,28 @@ Attach the managed policy called `AWSLambdaBasicExecutionRole` to this role to g
7575

7676
1. Type `WildRydesLambda` into the filter box on the Roles page and choose the role you just created.
7777

78-
1. On the Permissions tab, click **Add inline policy** link to create a new inline policy.
78+
1. On the Permissions tab, choose the **Add inline policy** link in the lower right corner to create a new inline policy.
7979
![Inline policies screenshot](../images/inline-policies.png)
8080

81-
1. Ensure **Policy Generator** is selected and choose **Select**.
81+
1. Select **Choose a service**.
8282

83-
1. Select **Amazon DynamoDB** from the **AWS Service** dropdown.
83+
1. Begin typing `DynamoDB` into the search box labeled **Find a service** and select **DynamoDB** when it appears.
84+
![Select policy service](../images/select-policy-service.png)
8485

85-
1. Select **PutItem** from the Actions list.
86+
1. Choose **Select actions**.
8687

87-
1. Paste the ARN of the table you created in the previous section in the **Amazon Resource Name (ARN)** field.
88+
1. Begin typing `PutItem` into the search box labeled **Filter actions** and check the box next to **PutItem** when it appears.
8889

89-
![Policy generator screenshot](../images/policy-generator.png)
90+
1. Select the **Resources** section.
9091

91-
1. Choose **Add Statement**.
92+
1. With the **Specific** option selected, choose the Add ARN link in the **table** section.
9293

93-
1. Choose **Next Step** then **Apply Policy**.
94+
1. Paste the ARN of the table you created in the previous section in the **Specify ARN for table** field, and choose **Add**.
95+
96+
1. Choose **Review Policy**.
97+
98+
1. Enter `DynamoDBWriteAccess` for the policy name and choose **Create policy**.
99+
![Review Policy](../images/review-policy.png)
94100

95101
</p></details>
96102

@@ -113,39 +119,36 @@ Make sure to configure your function to use the `WildRydesLambda` IAM role you c
113119

114120
1. Click **Create function**.
115121

116-
1. Click on **Author from scratch**.
122+
1. Keep the default **Author from scratch** card selected.
117123

118124
1. Enter `RequestUnicorn` in the **Name** field.
119125

126+
1. Select **Node.js 6.10** for the **Runtime**.
127+
128+
1. Ensure `Choose an existing role` is selected from the **Role** dropdown.
129+
120130
1. Select `WildRydesLambda` from the **Existing Role** dropdown.
121131
![Create Lambda function screenshot](../images/create-lambda-function.png)
122132

123133
1. Click on **Create function**.
124134

125-
1. Click **Configuration**.
126-
127-
1. Select **Node.js 6.10** for the **Runtime**.
128-
129-
1. Leave the default of `index.handler` for the **Handler** field.
130-
131-
1. Copy and paste the code from [requestUnicorn.js](requestUnicorn.js) into the code entry area.
135+
1. Scroll down to the **Function code** section and replace the exiting code in the **index.js** code editor with the contents of [requestUnicorn.js](requestUnicorn.js).
132136
![Create Lambda function screenshot](../images/create-lambda-function-code.png)
133137

134-
1. Scroll to top and click **"Save"** (**Not** "Save and test" since we haven't configured any test event)
138+
1. Click **"Save"** in the upper right corner of the page.
135139

136140
</p></details>
137141

138142
## Implementation Validation
139143

140144
For this module you will test the function that you built using the AWS Lambda console. In the next module you will add a REST API with API Gateway so you can invoke your function from the browser-based application that you deployed in the first module.
141145

142-
1. From the main edit screen for your function, select **Configure test event** from "Select a test event..." dropdown list.
146+
1. From the main edit screen for your function, select **Configure test event** from the the **Select a test event...** dropdown.
143147
![Configure test event](../images/configure-test-event.png)
144148

145-
1. Leave "Hello World" there
149+
1. Keep **Create new test event** selected.
146150

147-
1. Put "TestRequestEvent" into Event name
148-
![Configure test event](../images/configure-test-event-2.png)
151+
1. Enter `TestRequestEvent` in the **Event name** field
149152

150153
1. Copy and paste the following test event into the editor:
151154

@@ -171,10 +174,13 @@ For this module you will test the function that you built using the AWS Lambda c
171174
}
172175
```
173176

177+
![Configure test event](../images/configure-test-event-2.png)
174178

175179
1. Click **Create**.
176180

177-
1. Click **Test**.
181+
1. On the main function edit screen click **Test** with `TestRequestEvent` selected in the dropdown.
182+
183+
1. Scroll to the top of the page and expand the **Details** section of the **Execution result** section.
178184

179185
1. Verify that the execution succeeded and that the function result looks like the following:
180186
```JSON

WebApplication/4_RESTfulAPIs/README.md

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ Use the Amazon API Gateway console to create a new API.
6969

7070
1. Select **New API** and enter `WildRydes` for the **API Name**.
7171

72+
1. Keep `Edge optimized` selected in the **Endpoint Type** dropdown.
73+
***Note***: Edge optimized are best for public services being accessed from the Internet. Regional endpoints are typically used for APIs that are accessed primarily from within the same AWS Region.
74+
7275
1. Choose **Create API**
7376

7477
![Create API screenshot](../images/create-api.png)
@@ -91,35 +94,37 @@ In the Amazon API Gateway console, create a new Cognito user pool authorizer for
9194

9295
1. Chose **Create New Authorizer**.
9396

94-
![Create user pool authorizer screenshot](../images/create-user-pool-authorizer.png)
95-
9697
1. Enter `WildRydes` for the Authorizer name.
9798

9899
1. Select **Cognito** for the type.
99100

100-
1. In the Region drop-down under **Cognito User Pool**, select the Region where you created your Cognito user pool in module 2.
101+
1. In the Region drop-down under **Cognito User Pool**, select the Region where you created your Cognito user pool in module 2 (by default the current region should be selected).
101102

102103
1. Enter `WildRydes` (or the name you gave your user pool) in the **Cognito User Pool** input.
103104

104105
1. Enter `Authorization` for the **Token Source**.
105106

106107
1. Choose **Create**.
107108

109+
![Create user pool authorizer screenshot](../images/create-user-pool-authorizer.png)
110+
108111
#### Verify your authorizer configuration
109112

110113
1. Open a new browser tab and visit `/ride.html` under your website's domain.
111114

112115
1. If you are redirected to the sign-in page, sign in with the user you created in the last module. You will be redirected back to `/ride.html`.
113116

114-
1. Copy the auth token from the notification on the `/ride.html`,
117+
1. Copy the auth token from the notification on the `/ride.html`,
115118

116119
1. Go back to previous tab where you have just finished creating the Authorizer
117120

118-
1. Click "Test", paste it into the **Authorization Token** field in the popup dialog.
121+
1. Click **Test** at the bottom of the card for the authorizer.
122+
123+
1. Paste the auth token into the **Authorization Token** field in the popup dialog.
119124

120125
![Test Authorizer screenshot](../images/apigateway-test-authorizer.png)
121126

122-
1. Click **Test** button and verify that you see the claims for your user displayed.
127+
1. Click **Test** button and verify that the response code is 200 and that you see the claims for your user displayed.
123128

124129
</p></details>
125130

@@ -137,8 +142,12 @@ Create a new resource called /ride within your API. Then create a POST method fo
137142

138143
1. Ensure the **Resource Path** is set to `ride`.
139144

145+
1. Select **Enable API Gateway CORS** for the resource.
146+
140147
1. Click **Create Resource**.
141148

149+
![Create resource screenshot](../images/create-resource.png)
150+
142151
1. With the newly created `/ride` resource selected, from the **Action** dropdown select **Create Method**.
143152

144153
1. Select `POST` from the new dropdown that appears, then **click the checkmark**.
@@ -169,27 +178,7 @@ Create a new resource called /ride within your API. Then create a POST method fo
169178

170179
</p></details>
171180

172-
### 4. Enable CORS
173-
Modern web browsers prevent HTTP requests from scripts on pages hosted on one domain to APIs hosted on another domain unless the API provides cross-origin resource sharing (CORS) response headers that explicitly allow them. In the Amazon API Gateway console you can add the necessary configuration to send the appropriate CORS headers under the action menu when you have a resource selected. You should enable CORS for POST and OPTIONS on your /ride resource. For simplicity, you can set the Access-Control-Allow-Origin header value to '\*', but in a production application you should always explicitly whitelist authorized domains to mitigate [cross-site request forgery (CSRF)](https://www.owasp.org/index.php/Cross-Site_Request_Forgery_%28CSRF%29) attacks.
174-
175-
For more information about CORS configurations in general, see https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
176-
177-
<details>
178-
<summary><strong>Step-by-step instructions (expand for details)</strong></summary><p>
179-
180-
1. In the Amazon API Gateway console, in the middle panel, select the `/ride` resource.
181-
182-
1. From the **Actions** drop-down list select **Enable CORS**.
183-
184-
1. Use the default settings and choose **Enable CORS and replace existing CORS headers**.
185-
186-
1. Choose **Yes, replace existing values**.
187-
188-
1. Wait for a checkmark to appear next to all the steps.
189-
190-
</p></details>
191-
192-
### 5. Deploy Your API
181+
### 4. Deploy Your API
193182
From the Amazon API Gateway console, choose Actions, Deploy API. You'll be prompted to create a new stage. You can use prod for the stage name.
194183

195184
<details>
@@ -207,7 +196,7 @@ From the Amazon API Gateway console, choose Actions, Deploy API. You'll be promp
207196

208197
</p></details>
209198

210-
### 6. Update the Website Config
199+
### 5. Update the Website Config
211200
Update the /js/config.js file in your website deployment to include the invoke URL of the stage you just created. You should copy the invoke URL directly from the top of the stage editor page on the Amazon API Gateway console and paste it into the \_config.api.invokeUrl key of your sites /js/config.js file. Make sure when you update the config file it still contains the updates you made in the previous module for your Cognito user pool.
212201

213202
<details>

WebApplication/images/add-app.png

-57.4 KB
Loading
-61.3 KB
Loading
1.24 KB
Loading
76.3 KB
Loading
-28.5 KB
Loading
-40.7 KB
Loading

WebApplication/images/create-api.png

-75.3 KB
Loading

0 commit comments

Comments
 (0)