• Hi Team,

    We are trying to access s3 bucket from Ec2 IAM role, but that bucket exist in another account.
    We have already granted access to ec2 server to access bucket from another account as a assume role.


    How we can use assume role or profile in wp-config file so our media will upload to another aws s3 account while using assume role?

    our current config is like below:

    define( ‘AS3CF_SETTINGS’, serialize( array(
    ? ? ‘provider’ => ‘aws’,
    ? ? ‘use-server-roles’ => true,
    ? ? ‘region’ => ‘ap-northeast-2’,
    ) ) );

Viewing 1 replies (of 1 total)
  • Plugin Author Delicious Brains

    (@deliciousbrains)

    We don’t have any experience with cross-account assuming of roles in EC2 instances, but from the looks of things, you should be able to do it with WP Offload Media, as long as you’ve correctly attached the IAM Role to the EC2 instance (we often see that a restart helps after attaching a new/updated role).

    Your AS3CF_SETTINGS define looks fine, but if you’re setting the region in there you should probably set the bucket too. If you take the region out of there, and ensure that the two roles allow for listing buckets, it might be easier to debug stuff in the UI as you’ll be able to see the available buckets.

    This guide seems to detail all the bits you’ll need to put in place in the two accounts:

    https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html#switch-role-ec2-another-account

    But, again, this is advanced use, and isn’t something we’ve tested. We’d be interested in hearing how you get on though, and anything WP Offload Media related that had to be adjusted to get it to work.

    –IJ

Viewing 1 replies (of 1 total)
  • The topic ‘How to use assume role in plugin AS3CF_SETTINGS’ is closed to new replies.