Skip to content

Commit 785bdc0

Browse files
authored
Doc: Update Cognito sample Readme to add permissions (#624)
1 parent d50afe5 commit 785bdc0

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

samples/mqtt/cognito_connect/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,27 @@ Note that in a real application, you may want to avoid the use of wildcards in y
3838
## How to run
3939

4040
To run this sample, you need to have a Cognito identifier ID. You can get a Cognito identifier ID by creating a Cognito identity pool. For creating Cognito identity pools, please see the following page on the AWS documentation: [Tutorial: Creating an identity pool](https://docs.aws.amazon.com/cognito/latest/developerguide/tutorial-create-identity-pool.html)
41+
You should also add _iot:Connect_ permission to the role added to congnito or the default role created automatically when creating the new identity (or create a new policy attached to the new role).
42+
<details>
43+
<summary> (see sample policy)</summary>
44+
<pre>
45+
{
46+
"Version": "2012-10-17",
47+
"Statement": [
48+
{
49+
"Effect": "Allow",
50+
"Action": [
51+
"cognito-identity:GetCredentialsForIdentity",
52+
"iot:Connect"
53+
],
54+
"Resource": [
55+
"*"
56+
]
57+
}
58+
]
59+
}
60+
</pre>
61+
</details>
4162

4263
**Note:** This sample assumes using an identity pool with unauthenticated identity access for the sake of convenience. Please follow best practices in a real world application based on the needs of your application and the intended use case.
4364

0 commit comments

Comments
 (0)