AWS Lightsail - Load Balanced WordPress

AWS Lightsail for Beginners: Setup Load Balanced WordPress Site Ep 1 (S3 Bucket Setup)

This video is the 1st episode of a 3 part series where I will walk you through enabling a Load Balanced WordPress website. In this video we will setup the Amazon S3 bucket, configure it and then connect it with the WordPress instance. This will enable the storage of media files outside of the WordPress instance, which is a required step in having a Load Balanced website.

Steps:

  1. Create & configure S3 bucket
  2. Create User
  3. Give it access via policy
  4. Setup Wp
  5. Add plugin

In this video I share the two policies that need to be used to setup the S3 bucket properly.

1) This policy is applied on the S3 bucket to enable public access:

{
 "Version": "2008-10-17",
 "Statement": [
 {
  "Sid": "AllowPublicRead",
  "Effect": "Allow",
  "Principal": {
   "AWS": "*"
  },
  "Action": "s3:GetObject",
  "Resource": "arn:aws:s3:::mywpmedia2018/*"
 }
 ]
}

2. This policy below enabled the User access to the S3 bucket:

{
 "Version": "2012-10-17",
 "Statement": [
 {
  "Effect": "Allow",
  "Action": [
   "s3:CreateBucket",
   "s3:DeleteObject",
   "s3:Put*",
   "s3:Get*",
   "s3:List*"
  ],
  "Resource": [
   "arn:aws:s3:::mywpmedia2018",
   "arn:aws:s3:::mywpmedia2018/*"
  ]
 }
 ]
}

Remember to replace the bucket names with your bucket names.

This following piece of code is what you put in the wp-config.php file

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

Remember to replace the asterisks with the keys you will generate as part of the User setup in the AWS Console (IAM Service).

Also in this video I talk about setting up SSH and Using a App Management service RunCloud. You can find those videos on my channel.

All videos tutorials on the website as well as the YouTube channel aim to provide a simplified process for a specific scenario; there could be many different factors and unique use cases you may have. The tutorials may not cover every situation; so treat is as a starting point or learning concept to apply to your unique situations, and consider this inspiration but not prescription or explicit direction.

Scroll to Top