IaC ~ Terraform and Pulumi
Terraform and Pulumi
Before reading this blog I would recommend to read this blog – https://www.indiangnu.org/2017/top-5-infrastructure-as-code-iac-software/
Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solutions.
Key feature of Terraform and Pulumi are..
- IaC (Infrastructure as Code) for better management of
- Infrastructure and state management
- Supports all Cloud providers like Azure, GCP, AWS and virtualization infrastructure like VMware and HyperV
- Change Automation
- Help you to adapt IaaS, SaaS and PaaS
How to user Terraform –
Terraform has 3 steps . First is “terraform init” initialization step in which Terraform will check and download required providers and plugins. Second is “terraform plan” in this step Terraform will create plan of change in your infrastructure and user has choice to verify and confirm then plan and then start third step ie “terraform apply” this in step Terraform will create resources in providers infrastructure like azure, aws or gcp. Terraform will also save all objects created in Terraform stafe “.tfstate” file and we can use same configuration to add or delete or update resource in same workflow….
To Debug Terraform error we can define debug and log fails mentioned below-
export TF_LOG_PROVIDER=TRACE
export TF_LOG_CORE=TRACE
export TF_LOG_PATH=logs.txt
terraform init
terraform plan
terraform apply
For formatting and configuration validation use below command –
terraform validate
terraform fmt
terraform refresh
HashiCorp Configuration Language (HCL) –
In Terraform we can define infrastructure required to deploy as code using HCL.
HCL is a toolkit for creating structured configuration languages that are both human- and machine-friendly, for use with command-line tools. Although intended to be generally useful, it is primarily targeted towards devops tools, servers, etc. HCL has both a native syntax, intended to be pleasant to read and write for humans, and a JSON-based variant that is easier for machines to generate and parse. HCL syntax is designed to be easily read and written by humans, and allows declarative logic to permit its use in more complex applications
What is Pulumi ?
Pulumi is a modern infrastructure as code platform that allows you to use familiar programming languages and tools to build, deploy, and manage cloud infrastructure.
Pulumi vs. Terraform
Here is a summary of the key differences between Pulumi and Terraform:
Component | Pulumi | Terraform |
Language Support | Python, TypeScript, JavaScript, Go, C#, F# | Hashicorp Configuration Language (HCL) |
State Management | Managed through Pulumi Service by default, self-managed options available | Self-managed by default, managed SaaS offering available |
Provider Support | Native cloud providers with 100% same-day resource coverage plus Terraform-based providers for additional coverage | Support across multiple IaaS, SaaS, and PaaS providers |
OSS License | Apache License 2.0 | Mozilla Public License 2.0 |
Ref –
Pulumi – https://www.pulumi.com
Terraform – https://www.terraform.io
HCL – https://github.com/hashicorp/hcl
Terraform Error – https://learn.hashicorp.com/tutorials/terraform/troubleshooting-workflow
Thank you,
Arun Bagul
(Personal Blog and This is based on my knowledge)
Similar Posts:
- Top 5 Infrastructure as Code (IaC) software
- Cloud: Monitoring as a Service (MaaS)
- Top 5 configuration management software
- Packer – How packer has simplified Cloud provisioning
- CloudStack: An Overview of the Open Source IaaS Platform.
- How to login to Windows and Run command from Linux
- Launching AWS instance using Chef server