Documentation

IAM Roles on Amazon EC2

To use the WP Offload Media plugin with Amazon S3 you need to define an AWS access key and secret key. This can be stored in the database or defined in your wp-config.php file like this:

define( 'AS3CF_AWS_ACCESS_KEY_ID', '********************' );
define( 'AS3CF_AWS_SECRET_ACCESS_KEY', '**************************************' );

or preferably with

define( 'AS3CF_SETTINGS', serialize( array(
    'provider' => 'aws',
    'access-key-id' => '********************',
    'secret-access-key' => '**************************************',
) ) );

However, if you host your WordPress site on an EC2 instance you won’t necessarily want to distribute your access credentials onto the instance, and will want to make use of IAM Roles.

After creating an IAM role you can use the ‘AS3CF_AWS_USE_EC2_IAM_ROLE’ constant to tell WP Offload Media not to ask for or require the access keys:

define( 'AS3CF_AWS_USE_EC2_IAM_ROLE', true );