By Fengchong (Senior Technical Expert of Alibaba Cloud Serverless)
Part 1 of this 2-part seriesdescribed how to use the multi-environment features of Serverless Devs. Part 2 will answer some common questions readers may have after reading Part 1.
Since you have supported Terraform, what is the role of Serverless Devs [1]? Is it enough to use Terraform directly?
The orientation of Serverless Devs and Terraform is significantly different. Serverless Devs is oriented to application management and DevOps, and Terraform is oriented to cloud resources. They are two different fields, but that does not mean that they cannot be integrated (or cannot be integrated at some levels). Integration and integration capabilities are standard to measure whether open-source tools are standardized.
Terraform addresses the provisioning of cloud resources. This field has a very clear methodology. Serverless Devs should emphasize how to make good use of cloud resources. The relationship between the two can be told from following scenarios.
We found that whether using cloud product SDK or GPLs (such as Pulumi), lots of efforts are required in the lifecycle of resources, which is very inefficient for component developers to connect to more cloud products.
However, Terraform is the most professional in this area. Whether it is standardization, recognition, and resource richness, it can meet end users' and developers' needs. Therefore, Serverless Devs and Terraform are triggered to combine this idea.
Serverless Devs is not coupled with Terraform. On the contrary, the HCL language of Terraform is naturally used in the component specifications of Serverless Devs, which can be considered as a capability of Serverless Devs to support multiple languages.
The value to developers is that they can complete the construction of infrastructure with relatively low code and devote their energy to the development related to Serverless EDAS application lifecycle management. Otherwise, they have to develop a large number of resources CRUD code, which is very inefficient.
If you use Terraform to deploy resources in multiple environments, what is the difference between using Terraform to deploy resources?
Use environment variables in CI/CD, configure VPC and NAS in environment variables, and reference environment variables in s.yaml seem to be ok. Why does it create an environment concept?
We can distinguish the difference in positioning from their names: environment and environment variables. Environment variables are a set of static configurations. Although some resource configurations can be written into the environment variable and referenced in the CI/CD pipeline, this method cannot manage resources.
The environment is an entity resource with the ability to manage the lifecycle of the infrastructure. The environment can be used to add, delete, modify, and query the infrastructure and grant the user the operation permissions by RAM. When updating the environment, you can also connect with some security checks.
The environment can be used to protect infrastructure. For example, when multiple services share the environment, if environment deletion is initiated, the system will automatically find that the environment is dependent on other services. In this case, the deletion will be rejected.
Is it suitable for me to use this function?
Individual developers are also applicable, but these users should not be allowed to write templates. Instead, the platform should provide templates for various business scenarios. Developers can use them out of the box, which will be our main work in the future.
The most complex concepts of Alibaba Cloud for individual users are RAM, VPC, ECS, SLB, and NAS. The learning curve is too high.
This problem is clear under the Serverless architecture. Serverless claims it has a low threshold, low cost, and low O&M. However, many users give up Serverless because they need to understand a lot of concepts and configure a lot of things to get started with Serverless. Environment templates and environments can significantly simplify the cost of starting cloud products and operate safely at the same time.
For example, if you select a template deployment environment, you can pull up all cloud resources with one click. This is a real Serverless.
Serverless Devs consists of CLI [3] and components [4]:
s init
, s config
, s verify
, -- template
, and -- debug
.s deploy
, s build
, and s invoke
. These are the capabilities of FC components.From the perspective of the generality of env
commands and the problems to be solved, it is also appropriate to implement the CLI. However, from the implementation point of view, a server control plane is required to complete the deployment of user resources. Specific cloud services must be completed for security reasons, so it is completed through a component.
Terraform for Serverless Devs – Implement Enterprise-Level Multi-Environment Deployment (Part 1)
100 posts | 7 followers
FollowAlibaba Cloud Serverless - August 23, 2022
Alibaba Cloud Community - August 26, 2022
Alibaba Cloud Community - November 25, 2021
Alibaba Cloud Community - December 21, 2021
Alibaba Cloud Serverless - February 17, 2023
Alibaba Cloud Native Community - August 25, 2022
100 posts | 7 followers
FollowAlibaba Cloud Function Compute is a fully-managed event-driven compute service. It allows you to focus on writing and uploading code without the need to manage infrastructure such as servers.
Learn MoreElastic and secure virtual cloud servers to cater all your cloud hosting needs.
Learn MoreAccelerate software development and delivery by integrating DevOps with the cloud
Learn MoreAn enterprise-level continuous delivery tool.
Learn MoreMore Posts by Alibaba Cloud Serverless