Terraform
Last updated
Was this helpful?
Last updated
Was this helpful?
Terraform is a declarative way of setup your infrastructure, and may be used to deploy nanos instances with on supported cloud providers.
Download and install .
See below an explanation of the resources needed to upload a nanos image and to launch an instance to google cloud provider. You can see the entire configuration file at the end of this section. All files required to run this example is in .
Start importing the ops terraform plugin and set your google cloud settings.
Create an image in your local machine with your application binary file. You have to specify your google cloud account settings in a configuration file and set the target cloud to gcp
.
Upload the nanos image to google storage. The resources below create a bucket in google storage and upload the nanos image.
Use the path of the object uploaded to create the image.
Use the image as base to launch an instance. Make sure you add firewall rules to make your application publicly available.
After joining all pieces we get the next terraform configuration file.
After running this configuration you will see the path where the image file was created locally and the ip address of the launched instance.