回答編集履歴
2
add + mod
test
CHANGED
@@ -86,7 +86,7 @@
|
|
86
86
|
|
87
87
|
"s3:prefix": [
|
88
88
|
|
89
|
-
"cognito/[cognito app name]/
|
89
|
+
"cognito/[cognito app name]/"
|
90
90
|
|
91
91
|
]
|
92
92
|
|
@@ -129,3 +129,45 @@
|
|
129
129
|
}
|
130
130
|
|
131
131
|
```
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
##追記2
|
136
|
+
|
137
|
+
Cognito IAMロールのデフォルトポリシー
|
138
|
+
|
139
|
+
```
|
140
|
+
|
141
|
+
{
|
142
|
+
|
143
|
+
"Version": "2012-10-17",
|
144
|
+
|
145
|
+
"Statement": [
|
146
|
+
|
147
|
+
{
|
148
|
+
|
149
|
+
"Effect": "Allow",
|
150
|
+
|
151
|
+
"Action": [
|
152
|
+
|
153
|
+
"mobileanalytics:PutEvents",
|
154
|
+
|
155
|
+
"cognito-sync:*",
|
156
|
+
|
157
|
+
"cognito-identity:*"
|
158
|
+
|
159
|
+
],
|
160
|
+
|
161
|
+
"Resource": [
|
162
|
+
|
163
|
+
"*"
|
164
|
+
|
165
|
+
]
|
166
|
+
|
167
|
+
}
|
168
|
+
|
169
|
+
]
|
170
|
+
|
171
|
+
}
|
172
|
+
|
173
|
+
```
|
1
add
test
CHANGED
@@ -27,3 +27,105 @@
|
|
27
27
|
[cognitoを使ってログイン画面を作ってみた! 〜ログイン画面作成〜(作業メモ)](https://qiita.com/Yuki_BB3/items/ee8330830951acd907de)
|
28
28
|
|
29
29
|
[Amazon Cognito UserPools を JavaScript から使ってみる](https://qiita.com/kusokamayarou/items/60bcf9d16ce0df93b0ea)
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
##追記1
|
34
|
+
|
35
|
+
IAMポリシーを以下にしてみてください。
|
36
|
+
|
37
|
+
```
|
38
|
+
|
39
|
+
{
|
40
|
+
|
41
|
+
"Version": "2012-10-17",
|
42
|
+
|
43
|
+
"Statement": [
|
44
|
+
|
45
|
+
{
|
46
|
+
|
47
|
+
"Sid": "AllowPublicCognitoIdentity",
|
48
|
+
|
49
|
+
"Effect": "Allow",
|
50
|
+
|
51
|
+
"Action": [
|
52
|
+
|
53
|
+
"cognito-identity:*",
|
54
|
+
|
55
|
+
"mobileanalytics:PutEvents",
|
56
|
+
|
57
|
+
"cognito-sync:*"
|
58
|
+
|
59
|
+
],
|
60
|
+
|
61
|
+
"Resource": "*"
|
62
|
+
|
63
|
+
},
|
64
|
+
|
65
|
+
{
|
66
|
+
|
67
|
+
"Sid": "AllowPublicS3Bucket",
|
68
|
+
|
69
|
+
"Effect": "Allow",
|
70
|
+
|
71
|
+
"Action": [
|
72
|
+
|
73
|
+
"s3:ListBucket"
|
74
|
+
|
75
|
+
],
|
76
|
+
|
77
|
+
"Resource": [
|
78
|
+
|
79
|
+
"arn:aws:s3:::[Bucket name]"
|
80
|
+
|
81
|
+
],
|
82
|
+
|
83
|
+
"Condition": {
|
84
|
+
|
85
|
+
"StringLike": {
|
86
|
+
|
87
|
+
"s3:prefix": [
|
88
|
+
|
89
|
+
"cognito/[cognito app name]/[folder name]/"
|
90
|
+
|
91
|
+
]
|
92
|
+
|
93
|
+
}
|
94
|
+
|
95
|
+
}
|
96
|
+
|
97
|
+
},
|
98
|
+
|
99
|
+
{
|
100
|
+
|
101
|
+
"Sid": "AllowPublicS3Object",
|
102
|
+
|
103
|
+
"Effect": "Allow",
|
104
|
+
|
105
|
+
"Action": [
|
106
|
+
|
107
|
+
"s3:GetObject",
|
108
|
+
|
109
|
+
"s3:PutObject",
|
110
|
+
|
111
|
+
"s3:DeleteObject",
|
112
|
+
|
113
|
+
"s3:PutObjectAcl"
|
114
|
+
|
115
|
+
],
|
116
|
+
|
117
|
+
"Resource": [
|
118
|
+
|
119
|
+
"arn:aws:s3:::[Bucket name]/cognito/[cognito app name]/[folder name]/",
|
120
|
+
|
121
|
+
"arn:aws:s3:::[Bucket name]/cognito/[cognito app name]/[folder name]/*"
|
122
|
+
|
123
|
+
]
|
124
|
+
|
125
|
+
}
|
126
|
+
|
127
|
+
]
|
128
|
+
|
129
|
+
}
|
130
|
+
|
131
|
+
```
|