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

Commit 4a9a0fa

Browse files
committed
Refined module 3 instructions
1 parent efbafd0 commit 4a9a0fa

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

Auth/3_IAMAuthorization/README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Browse to your CloudFormation stack created in the earlier modules and find the
3535

3636
1. Next, return to your Cloud9 IDE and open the file */website/src/amplify-config.js*.
3737

38-
1. Fill in values for both the bucket name, which you just copied, as well as the region where the CloudFormation template was launched
38+
1. Fill in values for both the bucket name, which you just copied, as well as the region where your CloudFormation template was launched
3939

4040
1. Your final structure for the storage configuration of *amplify-config.js* should look like the following.
4141

@@ -65,12 +65,18 @@ Browse to the IAM console and find your Cognito Identity Pool's authenticated us
6565

6666
1. Search for *WildRydes* to find the two roles which were created by Cognito Identity Pools when you created the Identity Pool in module one. Should you not be able to find the roles here, you can alternatively go to the **Cognito Federated Identities** console, find the correct identity pool, then click **Edit Identity Pool** in the top-right corner to see the roles listed. Each identity pool has both an Unauthenticated user role and an Authenticated user role.
6767

68-
1. Once you have found the names of the roles, go back to the IAM console and select the *Auth* role for your authenticated users.
69-
70-
1. We want to grant permissions to this role which are only applicable to this role so we will use an inline policy, which would be deleted if this role were ever deleted.
68+
1. Once you have found the names of the roles, go back to the IAM console and **select the *Auth* role** for your authenticated users.
69+
70+
> If the full name of the role is hidden from view due to column width, you can hover over the partially visible name of the role to see the full name of the role as a tool tip.
71+
72+
![IAM WildRydes Auth Role Selction](../images/iam-wildrydes-role-selection.png)
73+
74+
1. We want to grant permissions to this role explicitly so we will use an inline policy, which would be deleted with this role if it were ever to be deleted.
7175

7276
1. Choose **Add inline policy** on the right-hand side to create a new inline policy associated to this IAM role.
7377

78+
![Add inline policy to WildRydes auth role](../images/iam-wildrydes-auth-role-add-inline-policy.png)
79+
7480
1. Choose the **JSON** tab to allow you to free-form edit the new policy.
7581

7682
1. Paste the following IAM policy statements for S3 access. After pasting, you will need to go **replace the bucket name** listed in all caps with your bucket name (a total of 4 times).
@@ -90,15 +96,15 @@ Browse to the IAM console and find your Cognito Identity Pool's authenticated us
9096
"s3:DeleteObject",
9197
"s3:DeleteObjectVersion"
9298
],
93-
"Resource": "arn:aws:s3:::REPLACE_ME_WITH_YOUR_BUCKET_NAME/private/${aws:userid}/*"
99+
"Resource": "arn:aws:s3:::REPLACE_WITH_YOUR_BUCKET_NAME/private/${aws:userid}/*"
94100
},
95101
{
96102
"Effect": "Allow",
97103
"Action": [
98104
"s3:GetObject",
99105
"s3:GetObjectVersion"
100106
],
101-
"Resource": "arn:aws:s3:::REPLACE_ME_WITH_YOUR_BUCKET_NAME/protected/*"
107+
"Resource": "arn:aws:s3:::REPLACE_WITH_YOUR_BUCKET_NAME/protected/*"
102108
},
103109
{
104110
"Effect": "Allow",
@@ -107,7 +113,7 @@ Browse to the IAM console and find your Cognito Identity Pool's authenticated us
107113
"s3:DeleteObject",
108114
"s3:DeleteObjectVersion"
109115
],
110-
"Resource": "arn:aws:s3:::REPLACE_ME_WITH_YOUR_BUCKET_NAME/protected/${aws:userid}/*"
116+
"Resource": "arn:aws:s3:::REPLACE_WITH_YOUR_BUCKET_NAME/protected/${aws:userid}/*"
111117
},
112118
{
113119
"Effect": "Allow",
@@ -118,7 +124,7 @@ Browse to the IAM console and find your Cognito Identity Pool's authenticated us
118124
"s3:DeleteObject",
119125
"s3:DeleteObjectVersion"
120126
],
121-
"Resource": "arn:aws:s3:::REPLACE_ME_WITH_YOUR_BUCKET_NAME/public/*"
127+
"Resource": "arn:aws:s3:::REPLACE_WITH_YOUR_BUCKET_NAME/public/*"
122128
}
123129
]
124130
}
@@ -156,7 +162,7 @@ Authenticate in the Wild Rydes app if you're not already logged in, then browse
156162

157163
### 4. Store profile picture links in Cognito User Pools profile
158164

159-
With our image uploads now working, all will work as expected until you close your browser, but at that point the reference between your profile and your profile picture will be lost. To fix this, you will leverage a Cognito User Pools user attribute called *picture* to persist the S3 object key so the same image can be loaded upon each login or to the unicorns when you request a ride.
165+
With our image uploads now working, all will work as expected until you close your browser, but at that point the reference between your user profile and your profile picture will be lost. To fix this, you will leverage a Cognito User Pools user attribute called *picture* to persist the S3 object key so the same image can be loaded upon each login and persisted to be shown to the unicorns when you request a ride.
160166

161167
#### High-Level Instructions
162168

97 KB
Loading

Auth/website/src/pages/MainApp.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@ import React from 'react';
1616
import BaseMap from '../components/BaseMap';
1717
import ESRIMap from '../components/ESRIMap';
1818
import Amplify from 'aws-amplify';
19-
import { Auth, API, Logger } from 'aws-amplify';
19+
import { Auth, API } from 'aws-amplify';
2020
import awsConfig from '../amplify-config';
2121
import '../css/ride.css';
2222

2323
const apiName = 'WildRydesAPI';
2424
const apiPath = '/ride';
25-
const logger = new Logger('MainApp');
2625

2726
class MainApp extends React.Component {
2827
constructor(props) {

0 commit comments

Comments
 (0)