Provision an Amazon Lightsail server using the AWS Lightsail API

5 min read

IMPORTANT: Amazon Lightsail only supports a limited number of static IP addresses by default.

This means that if you create more than 5 servers at a time, number 6 onwards may not be assigned a static IP address, and this has the potential to cause some serious problems for these servers.

If your Lightsail server does not have a static IP, then when this server restarts for the first time, it may be assigned a completely new IP address. This will disconnect your server from GridPane, but more importantly any websites that are on this server will cease to be accessible because the DNS records will now be pointing to the wrong IP address.

The limitations aren’t exactly clear, but please keep this if you’re creating multiple Lightsail servers at the same time. You can learn more directly from AWS here:

https://aws.amazon.com/lightsail/faq/#:~:text=You%20can%20currently%20create%20up,certificates%20during%20each%20calendar%20year.

Step 1. Sign in to the IAM console

Log in to your IAM console.

Once inside the console, choose Policies in the left navigation pane.

IAM_Management_Console_-Policy_Screen_.png

Step 2. Create a Lightsail Gridpane policy

In the Policies, panel click create.

IAM_Management_Console_-_Create_Policy_1_.png

Clicking create will fire up a wizard as shown above. Choose Lightsail Sevice and in action option, choose All Lightsail Actions in Manual Action.

Under Resources choose All Resources. Please check the image below)

IAM_Management_Console_-_Create_Policy_2_.png

Click Review Policy. The next wizard window pops up, set the name of policy to Lightsail-Gridpane-FULL then click Create policy.

IAM_Management_Console_-Create_Policy_3_.png

Step 3. Create a Key and Secret.

Still, in the IAM console, choose users on the left-hand navigation screen. Click on Create User

IAM_Management_Console_-_User_List_.png

The Add user wizard activates. Choose a suitable name for your user and put a tick programmatic access checkbox.

IAM_Management_Console_-_Add_User_.png

Choose Next: Permissions. Click Attach Existing Policy Option then choose the Lightsail-Gridpane-Full policy we created in step 2.

IAM_Management_Console_-_Attach_Policy_.png

Click Nextto the tags Panel, leave everything default here and click User Review to and cross-check the user name and chosen security policy.

IAM_Management_Console_-_Add_User_Review.png

If all is correct click Create User. The next panel will have the Key and Secret for your user. Please note these values somewhere since they will NEVER be shown again. You can download these credentials as a CSV file.

IAM_Management_Console_-_Access_Key_.png

Step 4. Go to your GridPane Settings

Login to your GridPane account and click the Your Settings menu item in the dropdown menu accessible by clicking on your username and icon.

GridPane_-_Choose_Settings.png

Step 5. Enter your Amazon Lightsail Key and Secret

Locate and click the Amazon Lightsail API option in the left horizontal menu, and then enter the AWS Personal Access Token you copied in Step.3 above into the Key and Secret fields and click Create.

GridPane_-_LighSail_Key_and_Secret.png

Step 6. View/Edit your Amazon Lightsail API Token

Your AWS API Token will now be available from this settings panel. If you wish to edit or change your API Token, you may do this by clicking the edit button with the blue pencil icon.

GridPane_-_View_Edit_Key.png

A popup modal will appear and you can easily change your AWS Personal Access Token and click Update.

GridPane_-_Edit_Key___Secret.png

Step 7. Go to the GridPane Home to provision an Instance

Now we have our Amazon Lightsail Key and Secret saved in our GridPane settings we are able to provision Instances with it from within GridPane. To do this, first click Home from the GridPane main menu to access the server provisioning tool.

Step 8. Configure your Amazon LightSail Server

Select Amazon Lightsail from the choice of Cloud VPS providers and a configuration panel will open.

Enter an appropriate name for your Lightsail server, and then choose a server plan and region from the dropdown selectors, before choosing whether or not you wish for Lightsail Backups to be enabled. Currently all Instances are provisioned with Ubuntu 18.04 LTS as the default OS.

Choose your database

If you’re on the developer plan you’ll have the option to choose between Percona and MariaDB for your database.

Percona is based off the new MySQL 8. It has removed query caching (which was deprecated in 5.7 but was still available), and it has more advanced aspects for things like storing and managing json as a storage format. It will likely use more RAM than MariaDB.

MariaDB is still based on MySQL 5.7, which could mean fewer issues importing old WordPress websites from low-quality hosting environments. It will likely use less RAM than Percona.

Both are excellent options.

Provider backups

We highly recommend that you enable provider backups. It’s a small price to pay for the extra insurance they offer.

Create your server

Click the Create Server button when you are happy with your configuration choices.

Step 9. Copy your Server Credentials and keep them safe

GridPane will display your Lightsail login details, this is the only time the password will ever be displayed, so be sure not to lose it and keep it secure.

GridPane_-_Password_Popup.png

Step 10. Wait patiently while GridPane provisions your Lightsail

GridPane will begin provisioning your instance. You will now be able to see your instance in the Active Servers list.

The process of provisioning your server may take some time depending on the location of your Instance to the GridPane servers. The process required to set up a highly optimized server stack for hosting Serious WordPress Sites is worth the wait, please be patient.

At any time during the provisioning process you may check what stage the process is at by rolling over the progress bar, a pop up window will display the current job being completed.

Once GridPane has finished provisioning your Lightsail server the progress bar will turn green and you will be able to deploy some Serious WordPress Sites on it.

Step 11. Deploy your GridPane WordPress Sites on your Lightsail server

To deploy a site click on the Sites link in the GridPane main menu to begin the process. We have a separate article that details the steps in detail for you.