Rather than directly diving into the Terraform scripts, let’s quickly learn about what is Terraform and how IBM Cloud Schematics simplifies the Terraform scripting experience on IBM Cloud.

What is Terraform?

Terraform is an open-source software, developed by HashiCorp, that enables predictable and consistent provisioning of IBM Cloud platform, classic infrastructure, and VPC infrastructure resources by using a high-level scripting language. You can use Terraform to automate your IBM Cloud resource provisioning, rapidly build complex, multi-tier cloud environments, and enable Infrastructure as Code (IaC).

What is IBM Cloud Schematics?

With IBM Cloud Schematics, you can organize your IBM Cloud resources across environments by using workspaces. Every workspace points to a set of Terraform configuration files that build a Terraform template. You can choose to create your own Terraform template or use one of the pre-defined templates that are provided by IBM. Workspaces allow for the separation of concerns for cloud resources and can be individually managed with IBM Cloud Identity and Access Management. To use IBM Cloud Schematics, you don’t need to install the Terraform CLI or the IBM Cloud Provider plug-in for Terraform.

Let’s Get Started

Creating one VSI in a VPC is pretty easy using the Terraform IBM provider. If you check the documentation, the sample Terraform script goes like this:

Java

But what is the simplest way to provision multiple VSIs in a VPC?

This question came up while working on vpc-instance-extension code sample to auto-assign a floating IP as and when a new VSI is created.

#devops #infrastructure #terraform #vpc

Create Multiple Instances in a VPC Using Terraform
2.75 GEEK