WordPress on Lightsail

Using AWS Console

To be honest the documentation is so good and its such an easy set up I don’t see the need to add anything else.

I set up a website, 512MB, 1 Vcpu 2-GB SSD and accessed it via the browser, via ssh and putty, accessed the database using phpmyadmin all in less than 30 minutes.

The only issues I had was that the export / import of the original wordpress site to the new site lost the uploaded images but thats probably something I did.

I would recommend following the AWS/Bitnami documentation as it ticked all the box’s for me.

https://lightsail.aws.amazon.com/ls/webapp/home/instances

Using Terraform

The basic terraform script to create a WordPress installation on Lightsail is:

MAIN.tf

provider “aws” {
region = “${var.region}”
access_key = “${var.aws_access_key}”
secret_key = “${var.aws_secret_key}”
}

resource “aws_lightsail_instance” “wp_test” {
name = “MyLightsailWP”
availability_zone = “eu-west-1a”
blueprint_id = “wordpress_4_9_8”
bundle_id = “nano_2_0”
key_pair_name = “FromLightsail”
}

OUTPUT.tf

output “publicIP” {
value = aws_lightsail_instance.wp_test.public_ip_address
}

output “Username” {
value = aws_lightsail_instance.wp_test.username
}

However there is currently one big gotcha that had me running round in circles for some time.

The KEY PAIR to be used must have been created by Lightsail (either CLI or GUI) it is NOT, and I can’t stresss this enough, it is NOT a key pair created via any other means e.g. EC2/Key Pair option.

Maybe this will change in the future but thats how it stands at the moment.