The LEMP template is an IBM Cloud Schematics template that is used to create a virtual machine instance and configure it with the "LEMP" stack: Linux, NGINX, MySQL (mariadb), and PHP. Schematics uses Terraform as the infrastructure-as-code engine. With this template, you can create and manage infrastructure as a single unit.
For more information about how to use the template, see the IBM Cloud Schematics documentation.
This sample uses chargable services and you are charged for the time the services are deployed. Running the terraform destroy
command deletes all resources, including the IBM Cloud database service instance. Billing for VSIs and IBM Cloud database terminates on the hour.
The user must have Identity and Access Management (IAM) access to create and configure an IBM Cloud database instance and VSIs.
Set the following variables before you use the template:
softlayer_username
is a the infrastructure user name. Go to Access (IAM) > Users, and select your name. Then, verify the user name is listed in the VPN password section.softlayer_api_key
is a classic infrastructure API key. Go to Access (IAM) > Users, and select your name. Then, verify that a classic infrastructure API key is included in the API keys section. If you don't already have one, you can create one from the IBM Cloud API keys page.
You must also set the following deployment values on the Create page. You can enter customized values or accept the defaults.
Variable Name | Description | Default Value |
---|---|---|
cores | The number of CPU cores to allocate. | 1 |
datacenter | The data center to create resources in, for example, dal13. To get a list of all data centers, run the ic sl vs options command. |
wdc01 |
disk_size | The numeric disk sizes in GB for the instance’s block device and disk image settings. | 25 |
domain | The domain for the instance, for example, domain.dev | domain.dev |
hostname | The hostname for the instance, for example, vm1 | lemp |
memory | The amount of memory in MB to allocate. | 1026 |
network_speed | The connection speed in Mbps for the instance’s network components. | 100 |
os_reference_code | The code that is used to provision the computing instance. To see available OS reference codes, log in to the IBM Cloud Infrastructure (SoftLayer) API. | CENTOS_LATEST_64 |
private_network_only | Enter true or false. True means a compute instance has access only to the private network. | false |
softlayer_api_key | Enter your classic infrastructure API key. See the IBM Cloud API keys page to get the details of an existing API key or to create a new one. | |
softlayer_username | Enter your classic infrastructure user name. Go to Access (IAM) > Users, and select your name. Then, locate your user name from the VPN password section. | |
ssh_key | Your public SSH key to access the virtual machine. Your public key is saved to a id_rsa.pub file in the .ssh subdirectory of your home directory. |
|
ssh_label | An identifying label to assign to the SSH key. | public ssh key - Schematics VM |
ssh_notes | A description to assign to the SSH key. | |
ssh_user | The default user name for the virtual machine, for example, the "root" user for UNIX operating systems. | root |
tags | Add descriptive tags to label the resource. A tag is a label that you assign to a resource for easy filtering of resources in your resource list. |
This template outputs the IPv4 address of the created virtual machine.