Documentation

IAM Roles on Amazon EC2

To use the WP Offload S3 plugin 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', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx' );
define( 'AS3CF_AWS_SECRET_ACCESS_KEY', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx' );

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 the AWS plugin not to ask for or require the access key and access secret:

define( 'AS3CF_AWS_USE_EC2_IAM_ROLE', true );