Skip to content

Terraform

Keanelek Enns edited this page Apr 13, 2022 · 18 revisions

Why Terraform?

Suppose you have been tasked with setting up a set of cloud services for your company's project. You can head over to the cloud service provider of your choice and start configuring to your heart's content, but there are a couple problems. What happens if, as the months go by, you need to set up more resources, but you have lost track of the configuration options you chose when initially setting everything up and are not sure of how these new resources are going to connect to the old ones. Or perhaps you would like to try a new configuration set up, but you don't really know how to capture the old configuration in a concise manner, and you don't really care to go back and manually set it up the way it was before anyways, so you miss out on the chance to discover a better approach. Enter Terraform.

Terraform is a tool developed by HashiCorp with the purpose of codifying your cloud services setup and integrating it into your workflow. This allows for reproducibility, consistency, state management, revision management, and centralized control over all of your cloud services. Terraform is great, and it's only getting more popular among DevOps engineers. Feel free to take a look at this blog on what problem Terraform is solving as well as these videos on what Terraform is and how it works.

Why DevXP?

But there's a new problem: the HashiCorp Configuration Language (HCL). Go ahead, take a look at the Terraform registry and whatever tutorials you can find on the web and try to get a working configuration file setup for your project. Maybe you are a DevOps guru who constantly keeps up with the ever changing state of cloud services, and Terraform's configuration options make perfect sense to you, in that case, more power to you! On the off chance, however, that you are new to Terraform, or you just haven't had a decade or so to learn all there is to learn in the DevOps world, we are here for you!

DevXP makes it easy for you to create working Terraform configuration files in a matter of minutes. That way, you get all the benefits of Terraform mentioned above without having to struggle through the early stages of learning the tool and language.

Sure, you might be able to get an EC2 instance running with a bit of work, but usually companies and projects have much more complex requirements. How do you get your resources to communicate with one another? How do you make sure you are following best practices and creating a product that is secure? DevXP, that's how. DevXP provides you with a jumping off point to springboard your development as well as on going support to keep you up to date on the ever changing world of DevOps and cloud services.

Providers

Cloud service providers are companies that establish public clouds, manage private clouds, or offer on-demand cloud computing components (also known as cloud computing services) like Infrastructure-as-a-Service (IaaS), Platform-as-a-Service (PaaS), and Software-as-a-Service(SaaS). Cloud services can reduce business process costs when compared to on-premise IT.

Using a cloud provider is a helpful way to access computing services that you would otherwise have to provide on your own, such as:

  • Infrastructure: The foundation of every computing environment. This infrastructure could include networks, database services, data management, data storage (known in this context as cloud storage), servers (cloud is the basis for serverless computing), and virtualization.
  • Platforms: The tools needed to create and deploy applications. These platforms could include operating systems like Linux®, middleware, and runtime environments.
  • Software: Ready-to-use applications. This software could be custom or standard applications provided by independent service providers.

         -- RedHat

DevXP supports services from three of the biggest cloud service providers out there: Amazon, Google, and Microsoft. These services are delivered through their respective cloud service platforms: Amazon Web Services, Google Cloud Platform, and Microsoft Azure.

Resources

This section aims to explain what a resource is, and give details about the resources that are configurable through DevXP.

Terraform uses the term resource as a generic term for most cloud services. An EC2 server or a lambda function from AWS are examples of resources.

Microsoft Azure defines a resource in the following way:

A manageable item that is available through Azure. Virtual machines, storage accounts, web apps, databases, and virtual networks are examples of resources. Resource groups, subscriptions, management groups, and tags are also examples of resources.

Supported Resources

Here is a list of the resources currently supported by DevXP. Please contact one of the authors if there are specific resources you would like to see supported in the future:

For more information on how to configure these resources through DevXP, please refer to the resource configuration section inside the Tool Manager Configuration page of the wiki.


Amazon Elastic Compute Cloud (Amazon EC2) provides scalable computing capacity in the Amazon Web Services (AWS) Cloud. Using Amazon EC2 eliminates your need to invest in hardware up front, so you can develop and deploy applications faster. You can use Amazon EC2 to launch as many or as few virtual servers as you need, configure security and networking, and manage storage. Amazon EC2 enables you to scale up or down to handle changes in requirements or spikes in popularity, reducing your need to forecast traffic.

Essentially EC2 is a virtual machine of any size and specification you may desire. It is hosted on Amazon's servers and is the foundation of your computational needs when it comes to cloud services. It is Amazon's equivalent of Google's GCE.

Learn how to configure it using DevXP here

Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance. Customers of all sizes and industries can use Amazon S3 to store and protect any amount of data for a range of use cases, such as data lakes, websites, mobile applications, backup and restore, archive, enterprise applications, IoT devices, and big data analytics. Amazon S3 provides management features so that you can optimize, organize, and configure access to your data to meet your specific business, organizational, and compliance requirements.

S3 is a general purpose storage service that focuses on flexibility. It is Amazon's equivalent of Google's storage buckets.

Learn how to configure it using DevXP here

Lambda is a compute service that lets you run code without provisioning or managing servers. Lambda runs your code on a high-availability compute infrastructure and performs all of the administration of the compute resources, including server and operating system maintenance, capacity provisioning and automatic scaling, code monitoring and logging. With Lambda, you can run code for virtually any type of application or backend service. All you need to do is supply your code in one of the languages that Lambda supports.

Essentially, you write a function, package it up the way Amazon has specified, and then you can set it up to run whenever a user makes a specified request. You are only charged for the time that your function runs.

Learn how to configure it using DevXP here

Amazon S3 Glacier is a secure, durable, and extremely low-cost Amazon S3 storage class for data archiving and long-term backup. With S3 Glacier, customers can store their data cost effectively for months, years, or even decades. S3 Glacier enables customers to offload the administrative burdens of operating and scaling storage to AWS, so they don't have to worry about capacity planning, hardware provisioning, data replication, hardware failure detection and recovery, or time-consuming hardware migrations.

Glacier is a special case of S3. It stores data for extended periods of time with low cost, but is meant for data that is retrieved infrequently, and when it is retrieved, it doesn't need to be done quickly.

Learn how to configure it using DevXP here

Amazon DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability. DynamoDB lets you offload the administrative burdens of operating and scaling a distributed database so that you don't have to worry about hardware provisioning, setup and configuration, replication, software patching, or cluster scaling. DynamoDB also offers encryption at rest, which eliminates the operational burden and complexity involved in protecting sensitive data.

Learn how to configure it using DevXP here


Compute Engine is a computing and hosting service that lets you create and run virtual machines on Google infrastructure. Compute Engine offers scale, performance, and value that lets you easily launch large compute clusters on Google's infrastructure. There are no upfront investments, and you can run thousands of virtual CPUs on a system that offers quick, consistent performance.

Essentially GCE is a virtual machine of any size and specification you may desire. It is hosted on Google's servers and is the foundation of your computational needs when it comes to cloud services. It is Google's equivalent of Amazon's EC2.

Learn how to configure it using DevXP here

Buckets are the basic containers that hold your data. Everything that you store in Cloud Storage must be contained in a bucket. You can use buckets to organize your data and control access to your data, but unlike directories and folders, you cannot nest buckets. While there is no limit to the number of buckets you can have in a project or location, there are limits to the rate you can create or delete buckets.

Google storage buckets are a general purpose storage service. It is Google's equivalent of Amazon's S3.

Learn how to configure it using DevXP here

Google Functions is a compute service that lets you run code without provisioning or managing servers. Functions run your code on a high-availability compute infrastructure and performs all of the administration of the compute resources, including server and operating system maintenance, capacity provisioning and automatic scaling, code monitoring and logging. With Functions, you can run code for virtually any type of application or backend service. All you need to do is supply your code in one of the languages that Functions supports.

Essentially, you write a function, package it up the way Google has specified, and then you can set it up to run whenever a user makes a specified request. You are only charged for the time that your function runs.

Learn how to configure it using DevXP here

Google Cloud Run is a compute service that lets you run code without provisioning or managing servers. CloudRun runs your code on a high-availability compute infrastructure and performs all of the administration of the compute resources, including server and operating system maintenance, capacity provisioning and automatic scaling, code monitoring and logging. With CloudRun, you can run code for virtually any type of application or backend service. All you need to do is supply your code as a docker image.

Learn how to configure it using DevXP here


Support for Microsoft Azure features is on its way!