i have special use-case manage aws account 1 bucket , have customers whom should give access.
i found s3 acl policy suits requirement [editing bucket policy seems not idea since has 20kb limit]
so have come idea: 1) create bucket xyz 2) create folder(object) each customer. 3) grant full writes customer folder(object) - http://docs.aws.amazon.com/amazons3/latest/dev/acl-using-java-sdk.html
this i'm stuck. have 2 aws accounts (admin,customer1). admin aws account, have created bucket(xyz) , folder(cust1) , granted read access customer1 aws account. when logged in customer1 aws account , went console.aws.amazon.com/s3, didn't find folder , bucket({xyz}/cust1). kindly me out. below snippet code have used.
apologies grammar!
//here getbucket() gives "xyz" , getpath() returns "cust1/" objectmetadata metadata = new objectmetadata(); metadata.setcontentlength(0); inputstream emptycontent = new bytearrayinputstream(new byte[0]); putobjectrequest putobjectrequest = new putobjectrequest(getbucket(),getpath(), emptycontent, metadata); // send request s3 create folder connection.putobject(putobjectrequest); accesscontrollist acl = new accesscontrollist(); acl=connection.getobjectacl(getbucket(),getpath()); //system.out.println(acl); acl.grantpermission(new canonicalgrantee("asdkjaskdjalskdjalkdjexample"), permission.readacp);
Comments
Post a Comment