FEATURES OPEN SOURCE ABOUT DOCS LOGIN REGISTER

Using AMIs

In this guide we will learn how to use Amazon AWS AMIs. Amazon AMIs are a special kind of machine type that can be used to instantiate other EC2 VMs with customized configurations. You can learn more about Amazon AMIs here.

First, you’ll need to either choose one of the available AMIs from Amazon or create your own, and grab its AMI code. In this example we choose an Ubuntu AMI with WordPress pre-installed. Please note that Koding supports only Ubuntu 14.

amis-choose.png

We use the AMI code in our stack. See full stack below

# Team new AMI

provider:
  aws:
    access_key: '${var.aws_access_key}'
    secret_key: '${var.aws_secret_key}'
resource:
  aws_instance:
    new-ami:
      tags:
        Name: '${var.koding_user_username}-${var.koding_group_slug}'
      instance_type: t2.nano
      ami: 'ami-001d9868'

We save our stack and build it..

stack-ready.png

We can also test our AMI. In our case we used a bitnami-wordpress Ubuntu AMI, we grab our VM IP and use our browser to navigate to the IP. If all is well you can see the bitnami-wordpress page served.

wordpress-running.png