May 10, 2023
0
 Min Read

Streamline Your Infrastructure with Shieldoo's Experimental Terraform Provider

Valdemar Zavadsky
Valdemar Zavadsky
11 Jan 2022
5 min read
Streamline Your Infrastructure with Shieldoo's Experimental Terraform Provider

Estimated read time: 7 minutes

We're excited to introduce the experimental Shieldoo Terraform Provider, an innovative solution that simplifies the creation and management of secure servers and firewalls within your cloud infrastructure.

By leveraging this Terraform provider, you can easily deploy Shieldoo™️ resources in public clouds like AWS, Digital Ocean, Azure or many others and manage their configuration through Terraform scripts.

In this blog post, we'll discuss the key features of the Shieldoo Terraform Provider and explain how it can help streamline your infrastructure management process.

Where to Get the Shieldoo Terraform Provider

Where to Get the Shieldoo Terraform Provider

The Shieldoo Terraform Provider's source code is available on GitHub at the following link (we are still in experimental mode): https://github.com/shieldoo/terraform-provider-shieldoo.

This provider enables you to create and configure Shieldoo™️ servers and firewalls using Terraform, a popular Infrastructure-as-Code (IaC) tool.

Key Features of the Shieldoo Terraform Provider

Key Features of the Shieldoo Terraform Provider

Create Servers

The provider allows you to create servers within Shieldoo™️'s secure network and returns configuration data for further processing. This makes it easy to deploy and manage secure servers within your cloud environment.

Create Firewalls and Firewall Rules

The Shieldoo Terraform Provider enables you to create firewalls and define firewall rules used by your servers. This ensures that your infrastructure remains protected from external threats.

Using Shieldoo Terraform Provider with public cloud

Using Shieldoo Terraform Provider with public cloud

The Shieldoo Terraform Provider is designed towork seamlessly with cloud infrastructure of public clouds like AWS, Digital Ocean, Azure or many others.

Here's how you can use it to create and manage resources in these environments:

1. Describe your infrastructure using Terraform scripts.

You can create Shieldoo™️ firewalls and servers and store their configuration data in the Terraform output, making it easy to manage and track your resources.

2. Deploy AWS and Azure resources.

You can use the corresponding Terraform providers for AWS and Azure to create cloud resources such as EC2 instances or Azure Virtual Machines.

3. Create cloud-init configurations.

Once your cloud resources have been deployed, you can create cloud-init configurations that include Shieldoo™️ installation commands and the Shieldoo™️ configuration data generated in previous Terraform steps. This ensures that your instances are automatically configured with the appropriate Shieldoo™️ settings.

How it looks like in terraform code?

There is example of deployment of EC2 virtual machine in AWS with installed Shieldoo™️ on machine via cloud-init.

terraform {
 required_providers {
   aws = {
     source = "hashicorp/aws"
     version = "~> 4.16"
   }
   shieldoo = {
     source = "shieldoo-io/shieldoo"
     version = ">=1.0.0"
   }
 }
 required_version = ">=0.14"
}
 
provider "aws" {
 region = "eu-west-1"
}
 
// create shieldoofirewall for server
resource "shieldoo_firewall" "fw_example1" {
 name = "fw-example1"
 rules_inbound = [
   {
     port    = "any"
     protocol = "icmp"
   },
   {
     port    = "22"
     protocol = "tcp"
   }
 ]
}
 
// create shieldooserver configuration
resource "shieldoo_server" "aws_server_1" {
 name        = "aws-server-1"
 firewall_id = shieldoo_firewall.fw_example1.id
 description = "exampledescription"
}
 
// createcloud-init configuration for server
data "cloudinit_config" "server_config" {
 gzip          = true
 base64_encode = true
 part {
   content_type = "text/cloud-config"
   content = templatefile("${path.module}/cloud-config.yaml", {
     config :shieldoo_server.aws_server_1.configuration
   })
 }
}
 
// create awsserver with cloud-init configuration
resource "aws_instance" "aws_server_1" {
 ami           = "ami-09dd5f12915cfb387" // AWS Linuxdefault image by 2023-04-12
 instance_type = "t2.micro"
 key_name      = "valda"
 user_data     = data.cloudinit_config.server_config.rendered
 tags = {
   Name = "aws-test-1"
 }
}

Conclusion

The experimental Shieldoo Terraform Provider simplifies the process of deploying and managing secure servers and firewalls in your cloud infrastructure. By integrating this provider with your existing AWS or Azure environment, you can streamline the configuration and management of your resources, ensuring a secure and well-organised infrastructure.

Try the Shieldoo Terraform Provider and discover how it can help you create a more efficient and secure cloud environment.

FAQs

What is a Terraform provider?

Terraform providers are plugins that enable API interaction between cloud providers and SaaS providers. These providers use the Terraform configuration code to tell Terraform which services it needs to interact with. Terraform is platform-agnostic and used widely, making it popular and versatile.

How does Terraform provider work?

Terraform communicates with different cloud providers, databases, and services using providers, which act as a translation layer. These providers provision resources that describe infrastructure objects like virtual networks. Every Terraform provider has detailed documentation describing the available resources and configuration options.

What is the purpose of Terraform?

The main purpose of Terraform is to solve infrastructure challenges by allowing you to manage any infrastructure using an immutable approach and reducing the complexity of infrastructure upgrades. It can also automate any changes, so you don’t have to write step-by-step instructions since Terraform understands any underlying logic. Terraform allows you to standardise configurations since components are easily available in the Terraform Registry. It also provides opportunities for collaboration since you can work on Terraform providers across teams using a Version Control System.

Are you looking for a free solution?
Shieldoo is opensource, so you can run it on your server or cloud.

All the information you may need can be found at GitHub.

Try now