From 5f8aace19d9ccfdce00a09c6f6e97404208a0003 Mon Sep 17 00:00:00 2001 From: Roshan Kumar Date: Wed, 28 Nov 2018 11:50:54 -0800 Subject: [PATCH 1/2] Update storage.md --- android/storage.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/android/storage.md b/android/storage.md index d915985e434..f7c263e7181 100755 --- a/android/storage.md +++ b/android/storage.md @@ -467,6 +467,29 @@ Note: Please review the documentation for [API](./api) before you proceed with t You can also upload and download Amazon S3 Objects using AWS AppSync, a GraphQL based solution to build data-driven apps with real-time and offline capabilities. Sometimes you might want to create logical objects that have more complex data, such as images or videos, as part of their structure. _For example, you might create a Person type with a profile picture or a Post type that has an associated image_. You can use AWS AppSync to model these as GraphQL types. If any of your mutations have a variable with bucket, key, region, mimeType, and localUri fields, the SDK uploads the file to Amazon S3 for you. +For starters, attach the following policy to your IAM role to grant it programmatic read-write access to your bucket: + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": ["s3:ListBucket"], + "Resource": ["arn:aws:s3:::myBucket"] + }, + { + "Effect": "Allow", + "Action": [ + "s3:PutObject", + "s3:GetObject" + ], + "Resource": ["arn:aws:s3:::myBucket/*"] + } + ] +} +``` + ### Schema Setup If any mutations have an input type `S3ObjectInput` with fields `bucket`, `key`, `region`, `mimeType` and `localUri` fields, the SDK will upload the file to S3. ``` From 2c818210db32f99faaf5c8b2ca018826723895c3 Mon Sep 17 00:00:00 2001 From: Roshan Kumar Date: Fri, 30 Nov 2018 17:01:44 -0800 Subject: [PATCH 2/2] Update storage.md --- android/storage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/storage.md b/android/storage.md index f7c263e7181..28b8923bf66 100755 --- a/android/storage.md +++ b/android/storage.md @@ -467,7 +467,7 @@ Note: Please review the documentation for [API](./api) before you proceed with t You can also upload and download Amazon S3 Objects using AWS AppSync, a GraphQL based solution to build data-driven apps with real-time and offline capabilities. Sometimes you might want to create logical objects that have more complex data, such as images or videos, as part of their structure. _For example, you might create a Person type with a profile picture or a Post type that has an associated image_. You can use AWS AppSync to model these as GraphQL types. If any of your mutations have a variable with bucket, key, region, mimeType, and localUri fields, the SDK uploads the file to Amazon S3 for you. -For starters, attach the following policy to your IAM role to grant it programmatic read-write access to your bucket: +Attach the following policy to your IAM role to grant it programmatic read-write access to your bucket: ``` {