DevOps

Using AI to orchestrate IaC into templates for application environments

August 16, 2024
10 min READ

The orchestration of application environments is one of the fundamental problems that our products were created to address.

In our work with DevOps, IT, and platform teams, we’ve often found that even those with advanced resources and expertise in Infrastructure as Code (IaC) and Kubernetes still struggle to build, deliver, and maintain development, testing, staging, and even production environments at scale.

Orchestration and maintenance for environments often involves extensive, complex, and time-consuming manual work, including:

  • Working across multiple IaC or Kubernetes tools to ensure provisioning works correctly to deliver the environment
  • Setting the dependencies, parameters, and authentication needed to provision those resources
  • Validating that the environment was orchestrated correctly, then digging through code to identify and correct errors
  • Making updates to the resources or configuration of the environment with the assurance that all environments your teams use adhere to the latest changes

This article shows how Quali Torque users leverage generative Artificial Intelligence (AI) to navigate these challenges by automating the creation of reusable templates defining their application environments.

To see this functionality in action, watch this 2-minute demo video:

Step 1. Leverage your IaC & Kubernetes resources by connecting a repository

Our users eliminate orchestration of environments by creating reusable templates, which are referred to as “blueprints” in the platform.

One way to think of these templates is as “Environments as Code.” To create blueprints for environments, Torque leverages our users’ existing IaC and Kubernetes resources (while also providing out-of-the-box assets to augment the resources available to them).

To leverage your IaC modules, enter the public URL for a repository to your account and Torque will automatically discover the resource configurations defined in your IaC modules.

Once discovered, Torque can leverage those resources to create blueprints that define the code for all the resources, dependencies, and parameters needed to provision them to generate the environment.

Once a Blueprint is created, Torque users can launch the environment by simply initiating the code via Torque’s native UI, integrations with their tools, or a GitOps motion.

A Blueprint can be used to provision an environment every time it’s needed—thereby eliminating the need to orchestrate that environment once it’s created.

Step 2. Describe your environment in a prompt for the AI Blueprint Designer

Once Torque can access your IaC and Kubernetes modules, the AI Blueprint Designer can find, add, and configure those resources to a new Blueprint.

From the Blueprints page, select “New Blueprint,” then submit your prompt.

Here’s an example prompt:

 

Once submitted, Torque will find those resources from the library of IaC modules discovered from your repository, automatically add each of those resources to a new blueprint, set the inputs, and define the dependencies among those resources to create the cluster.

Torque automatically designs that environment and allows users to modify the configuration using the graphical UI.

 

Torque shows the design of this environment in the Designer Canvas, where you can see which resources were added and how the dependencies were configured.

You can also click through to the Inputs for each resource.

Meanwhile, Torque also generates a new YAML file defining all the code for your blueprint. While users can modify the code in the YAML directly, any change made to the resources shown in the Designer Canvas will be reflected in the YAML file automatically.

Torque automatically creates a YAML file that can execute the code needed to provision the environment described in your AI prompt.

This not only accelerates the orchestration of application environments, but also simplifies it so that more stakeholders can create blueprints regardless of their familiarity with the IaC, Kubernetes, and cloud platforms used to run individual infrastructure components.

Many of our customers have reduced wait times for environments and accelerated software pipelines overall by simplifying the process of creating and launching environments via self-service.

Step 3. Set cloud governance policies to deny unapproved resource deployments

Governance is important to keep in mind with this approach. DevOps and IT team hold the keys to the cloud for good reason—they know how to prevent misconfigurations, security risks, and wasted cloud costs.

Since the AI Blueprint Designer enables more people to create and run environments, you’ll need to ensure those resources adhere to your cloud governance standards.

Those with administrator-level permissions in Torque can create and set custom policies, which Torque enforces by automatically denying the provisioning of any resource that violates them.

Torque also provides out-of-the-box policies that admins can customize and set.

For example, one common security vulnerability is public-facing cloud storage resources, such as Amazon S3.

To prevent this threat in Torque, admin can set a policy for Only Private S3 Buckets to ensure that any attempt to run an environment with an open S3 bucket is denied. Admins can choose to apply that policy to specific Spaces in Torque, where only certain users have access.

Some other popular policies include:

  • Allowed or prohibited cloud platforms—to prevent shadow IT in the form of the use of unapproved clouds.
  • Allowed or prohibited VM sizes—to maintain cloud cost efficiency by ensuring your teams only use the specific size of cloud instance needed.
  • Maximum duration—to prevent wasted budget for resources that are configured to run longer than needed

For more insight into cloud governance with Quali Torque, watch this brief demo:

Step 4. Launch & share access to run your environment with your teammates

Once you’ve created a Blueprint, you can save it in Torque and click “Launch” to generate the environment.

Torque also provides a self-service catalog for all users to find and launch environments from Blueprints.

Torque provides a self-service view to:

  • Launch and access the live environment as well as any other outputs, such as documentation for the environment
  • Review and perform actions on individual cloud resources provisioned to deliver the environment. This includes the ability to Power Off, Restart, Power On, and Connect individual assets without the need to shut down and re-launch the complete environment.
  • View the logs for each IaC module that was provisioned to deliver the environment, including a drill down into the code for each one.
  • Reconcile configuration drift and understand updates made to the resources within the environment.

As more DevOps teams prioritize developer productivity, AI will play a more prominent role in simplifying the developer experience by automating the complex manual tasks that often stand in the way of true self service.

To try the AI Blueprint Designer for free, visit the Torque Playground and create a new blueprint today.