Cloud Native 9 min read

Why Serverless Devs Needs Terraform and How Multi‑Environment Differs from Pure Terraform

This article explains the distinct roles of Serverless Devs and Terraform, compares multi‑environment deployment with direct Terraform usage, clarifies the concepts of environments versus environment variables, and details why the multi‑environment feature is implemented as a component rather than a CLI tool.

Alibaba Cloud Native
Alibaba Cloud Native
Alibaba Cloud Native
Why Serverless Devs Needs Terraform and How Multi‑Environment Differs from Pure Terraform

Relationship between Serverless Devs and Terraform

Serverless Devs focuses on application management and DevOps, while Terraform is dedicated to cloud resource provisioning. Although they target different domains, they can be integrated because both benefit from standardisation and open‑source tooling.

What Serverless Devs Adds Beyond Terraform

Serverless Devs uploads code or dependencies to NAS, leaving VPC, switch, security‑group, and NAS mount creation to Terraform.

It uploads files to OSS and triggers functions for report generation, without managing OSS bucket creation.

It handles code/image building, layer creation, deployment, version release, and gray‑release for a full CI/CD experience, while Terraform does not manage FC networking, log stores, or ACR instances.

It provides remote debugging, instance login, and rapid issue detection via logs and monitoring.

Thus Serverless Devs concentrates on the runtime and operational aspects of serverless applications, while Terraform excels at standardised, widely‑recognised resource management.

Differences Between Multi‑Environment Deployment and Direct Terraform

Terraform is a local tool requiring management of AK/SK and provider installation; the multi‑environment service is multi‑tenant and removes that burden.

The multi‑environment feature adds versioned template management, automatically protecting existing environments from incompatible IaC changes.

Terraform is resource‑centric with weak application linkage; the multi‑environment model links environments, services, and pipelines, enabling permission‑based resource access and batch deployments.

Terraform is one IaC option; future plans include integration with ROS and Pulumi.

Environment vs. Environment Variables

Environment variables are static configuration snippets that lack resource governance. An "environment" is a managed entity with lifecycle operations, access control, and safety checks (e.g., preventing deletion when other services depend on it).

Why Multi‑Environment Is Implemented as a Component, Not a CLI Feature

Serverless Devs provides both a CLI (generic commands such as s init, s config, s verify, --template, --debug) and components (specific commands like s deploy, s build, s invoke for Function Compute). The env command requires a server‑side control plane for secure resource deployment, which is why it is realised as a component.

Implementation Principle

Follow Serverless Devs component development standards to create a component that interfaces with backend services.

The backend uses a Serverless + Kubernetes architecture, with message‑triggered functions rendering templates and executing deployment tasks.

KubeVela is employed to manage Kubernetes resources and execute Terraform jobs.

References

KubeVela: https://kubevela.io/

Serverless Devs CLI documentation: https://docs.serverless-devs.com/serverless-devs/command/readme

Alibaba Cloud Function Compute component: https://docs.serverless-devs.com/fc/readme

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Cloud NativeServerlessKubeVelaTerraformInfrastructure as CodeMulti-Environment
Alibaba Cloud Native
Written by

Alibaba Cloud Native

We publish cloud-native tech news, curate in-depth content, host regular events and live streams, and share Alibaba product and user case studies. Join us to explore and share the cloud-native insights you need.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.