How to prepare an environment to run the system on the cloud

IaC
スポンサーリンク
スポンサーリンク

At first

In order to operate the system in a non-cloud environment (on-premises), it is necessary to prepare hardware such as PCs and routers, wiring power cables and LAN cables to run them, and infrastructure environments such as os installation network settings.

When running a system in the cloud, you need to prepare an infrastructure environment such as a computer, network, or storage in a virtual space on the cloud.

There are the following methods as a means of building an infrastructure environment on the cloud, each with its advantages and disadvantages.

Use the management console provided by the cloud vendor

Use the SDK provided by the cloud vendor

Use third-party tools

Use the management console provided by the cloud vendor

You can access the management console provided by the cloud vendor from the browser and build the environment on the cloud with intuitive operation.

The screen below is the aws, Azure, GCP, and OCI management consoles.

AWS(Amazon Web Services)
GCP(Google Cloud Platform)
Azure
OCI(Oracle Cloud Infrastructure)

The management console of any cloud vendor has a similar UI, and you can use the service by selecting the cloud service you want to use on the GUI and entering the necessary items.

The advantage of building an environment using the management console is that it is easy to use the service you want to use by intuitively entering what you need on the GUI.

If you want to check the service contents for a moment, you can easily create or destroy it from the management console.

The disadvantage is that when you have to build the same environment, you will be inputting one by one on the GUI, so it will take time and the probability of mistakes due to input errors etc. will increase.

In addition, when managing the setting contents and change history, it is necessary to leave it separately, so there is a possibility that forgetting to mention it may occur.

Use the SDK provided by the cloud vendor

By using the SDK provided by the cloud vendor, it becomes possible to operate the environment on the cloud from the command line or program, and it is possible to realize IaC(Infrastructure as Code) that manages the infrastructure with code.

The SDK provided by each vendor can download the SDK for each program language such as CLI for operation on the command line from the following link, JavaScript, Python, Java, .Net, etc.

The advantage of using the SDK is that the environment is managed by code, so it is easy to reproduce the same environment, and since it becomes easier to automate environment construction, it is possible to prevent human accidents due to human operation errors.

In addition, since it is code, you can manage the change history etc. using code management tools such as git.

The disadvantage is that you need to be able to understand the code and code it while reading documents, so it is expensive to learn and it takes time to build the first.

In addition, since the SDK itself is different for each cloud vendor, if you need to use the services of multiple cloud vendors called multicloud, you will have to learn how to use the SDK of each cloud vendor, which will be expensive to learn.

Use third-party tools

Build your environment in the cloud using third-party IaC tools to build and manage your infrastructure with your code.

Some of the third-party tools include:

Tool nameFeatures
TerraformWith the OSS tool developed by HashiCorp, you can define the environment to be built on the cloud in a dedicated language called HCL.
It is cross-platform compatible and can be operated on Windows, macOS, Linux, etc.
Many cloud vendors support it, making it the de facto standard for IaC tools.
PulumiIt is an OSS tool developed by Pulumi, and supports multiple program languages ​​such as JavaScript, TypeScript, Python, Go, and .Net. You can define the environment to build on the cloud using your favorite programming language.
It is cross-platform compatible and can be operated on Windows, macOS, Linux, etc.
It supports multiple cloud vendors, though not as much as Terraform.

The advantage of using a third-party tool is similar to the advantage described in “Use the SDK provided by the cloud vendor”, because the environment is managed by the code so that the same environment can be easily reproduced. Since it becomes easier to automate the environment construction, it will be possible to prevent human accidents due to human operation mistakes, and since it is a code, it is possible to manage change history etc. using a code management tool such as git.

In addition to this, by using tools compatible with multiple cloud vendors such as Terraform, multi-cloud support is available, and learning costs to learn how to use the tool can be reduced.

The disadvantage is that it is necessary to be able to design what to do with which tool because there are advantages and disadvantages depending on the tool, and it is necessary to understand the code and code while reading documents, etc., so it is expensive to learn and it takes time to build the first.


See below for how to use Terraform.

Summary

Building infrastructure in the cloud doesn’t require physical preparation like on-pre, so you can easily build and destroy it from your PC.

You can also easily build a method for building from the GUI using the management console, or you can build the infrastructure while managing the infrastructure with code using a program.

The method for automating is also progressing, and after building an infrastructure environment on the cloud with Terraform, it is possible to link with the configuration management tool Ansible to configure the OS and application, and then perform the verification work automatically.

In the cloud, the version upgrade of the service itself and the speed of the function are fast, and the version upgrade of the tool itself is also quick, so I think it is important to first try it out.

If you’ve never touched the cloud, you can try using the cloud free tiers at the link below.

There is also a Terraform code below that you can try out for free, so please try it.

In addition, if you have already built an environment on the cloud, you may be able to convert the pre-built environment to Terraform code using tools such as the one in the link below and services provided by the cloud vendor, so you may be able to do Iac support later.

Comment

スポンサーリンク