Contenu connexe Similaire à CTO Night & Days 2015 Winter - AWS Mobile Development Similaire à CTO Night & Days 2015 Winter - AWS Mobile Development (20) CTO Night & Days 2015 Winter - AWS Mobile Development5. OS
Apple iPhone, iPad iOS Xcode Swift, Objective-C
Google Android Android OS Android Studio Java
Amazon Kindle Fire Fire OS
27. {!
"Effect":"Allow",!
"Action":["s3:PutObject","s3:GetObject","s3:DeleteObject",!
!"s3:ListMultipartUploadParts","s3:AbortMultipartUpload"],!
"Resource":"arn:aws:s3:::BUCKET_NAME/*"!
} !
{!
"Effect":"Allow",!
"Action":["s3:ListBucket","s3:ListBucketMultipartUploads"],!
"Resource":"arn:aws:s3:::BUCKET_NAME"!
}!
{!
"Effect": "Allow",!
"Action": ["dynamodb:GetItem", "dynamodb:Query", "dynamodb:PutItem"],!
"Resource" : [ "arn:aws:dynamodb:REGION:123456789:table/TABLE_NAME", !
! "arn:aws:dynamodb:REGION:123456789:table/TABLE_NAME/!
! !index/INDEX_NAME" ]!
}!
!
Allow
Actions:
Certain operations
Resource:
One bucket, table ..
28. {!
"Effect":"Allow”,!
"Action” ["s3:PutObject","s3:GetObject","s3:DeleteObject”,!
”s3:ListMultipartUploadParts","s3:AbortMultipartUpload"],!
"Resource":"arn:aws:s3:::BUCKET_NAME/Bob/*"!
} !
{!
"Effect":"Allow",!
"Action":"s3:ListBucket",!
"Resource":"arn:aws:s3:::BUCKET_NAME",!
"Condition":{"StringLike":{"s3:prefix":”Bob/"}}!
}!
{!
"Effect":"Allow",!
"Action":["s3:ListBucketMultipartUploads"],!
"Resource":"arn:aws:s3:::BUCKET_NAME"!
}!
Allow
Actions:
Certain operations
Resource:
Within a bucket with
specific prefix (user)
29. Allow
Actions:
All sync operations
Resource:
Only to that identity
{!
"Effect": "Allow”,!
"Action": ["s3:GetObject”,"s3:PutObject”],!
"Resource": ["arn:aws:s3:::!
!myBucket/amazon/snakegame/!
!${cognito-identity.amazonaws.com:sub}"]!
}!
{!
"Effect":"Allow",!
"Action":"cognito-sync:*", !
"Resource":["arn:aws:cognito-sync:us-east-1:
!123456789012:identitypool/!
!${cognito-identity.amazonaws.com:aud}/identity/!
!${cognito-identity.amazonaws.com:sub}/*"] !
}!
Allow
Actions:
S3 Get/Put operations
Resource:
Only to a specific part
of bucket to that identity
35. {!
"identityPoolId" : "Pool Id”!
"identityId" : "Identity Id ”!
"dataSetName" : "Dataset Name”!
"operation" : "(replace|remove)”!
"kinesisSyncRecords" : [!
{!
"key" : "Key",!
"value" : "Value",!
"syncCount" : 1,!
"lastModifiedDate" : 1424801824343,!
"deviceLastModifiedDate" : 1424801824343,!
"op": "(replace|remove)" }, ...!
],!
"lastModifiedDate": 1424801824343,!
"kinesisSyncRecordsURL": "S3Url",!
"payloadType" : "(S3Url|Inline)",!
"syncCount" : 1 !
}!
40. @DynamoDBTable(tableName = "Books")!
public static class Book {!
private String isbn;!
private String title;!
…!
@DynamoDBHashKey(attributeName = “isbn")!
public String getIsbn() {!
return isbn;!
}!
!
@DynamoDBAttribute(attributeName="title")!
public String getTitle() {!
return title;!
}!
…!
45. Download download = !
transferManager.download(“MyBucket”, key, file);!
Upload upload =!
transferManager.upload(“MyBucket”, key, file);!
while (!upload.isDone()){!
// !
}!
TransferManager transferManager = !
new TransferManager(cognitoProvider);!