Search code examples
amazon-s3drupal-7

Drupal 7 I need to replace images in files system and also replace over S3 bucket without changing url of image over S3


Drupal 7 I need to replace images in files system and also replace over S3 bucket without changing url of image over S3.

I am using s3fs module for upload images over S3.


Solution

  • Granting Cross-Account Permissions to Upload Objects While Ensuring the Bucket Owner Has Full Control

    {
       "Version":"2012-10-17",
       "Statement":[
         {
           "Sid":"111",
           "Effect":"Allow",
           "Principal":{"AWS":"1111111111"},
           "Action":"s3:PutObject",
           "Resource":"arn:aws:s3:::examplebucket/*"
         },
         {
           "Sid":"112",
           "Effect":"Deny",
           "Principal":{"AWS":"1111111111" },
           "Action":"s3:PutObject",
           "Resource":"arn:aws:s3:::examplebucket/*",
           "Condition": {
             "StringNotEquals": {"s3:x-amz-grant-full-control":["emailAddress=xyz@amazon.com"]}
           }
         }
       ]
    }
    

    For detail please check Granting Cross-Account Permissions to Upload Objects