A service is a unit for resource management in Function Compute. You must create a service before you can create a function. Functions that belong to a service inherit its attributes, such as permissions and log settings. This topic describes the concept of a service in Function Compute and explains how to create and update a service in the Function Compute console.
What is a service?
From a business perspective, an application can be split into multiple services. From a resource usage perspective, a service can consist of multiple functions. For example, a data processing service can be split into data preparation and data processing. The data preparation function requires fewer resources and can run on a smaller instance. The data processing function requires more resources and can run on a larger instance.
Create a service
Log on to the Function Compute console. In the left-side navigation pane, click Services & Functions.
In the top navigation bar, select a region. On the Services page, click Create Service.
In the Create Service panel, enter a service name and description, configure the following items as needed, and then click OK.
Configuration Item
Description
Example
Logging
Specifies whether to enable Simple Log Service. The valid values are described as follows:
Enable: Function execution logs are saved to Simple Log Service for persistence. This helps you debug code, analyze failures, and perform data analytics.
Disable: Function execution logs cannot be stored or queried in Simple Log Service.
Enable
Advanced Configuration
Tracing Analysis
Specifies whether to enable Tracing Analysis. The valid values are described as follows:
Enable: You can use Jaeger to upload trace information to track function executions. This helps you quickly analyze and diagnose performance bottlenecks in a serverless architecture. For more information, see Introduction to Tracing Analysis.
Disable: Tracing Analysis is disabled.
Enable
Service Role
Configure the role that functions in the service use. This grants the functions the permissions of the role. For more information, see Grant Function Compute permissions to access other Alibaba Cloud services.
AliyunFCDefaultRole
VPC Access
Specifies whether to allow functions to access resources in a VPC. For more information, see Configure network settings.
Yes
VPC
This parameter is required if you set VPC Access to Yes. Create a new VPC or select the ID of an existing VPC that you want to access from the drop-down list.
fc.auto.create.vpc.1632317****
VSwitch
This parameter is required if you set VPC Access to Yes. Create a new vSwitch or select the ID of an existing vSwitch from the drop-down list.
fc.auto.create.vswitch.vpc-bp1p8248****
Security Group
This parameter is required if you set VPC Access to Yes. Create a new security group or select an existing security group from the drop-down list.
fc.auto.create.SecurityGroup.vsw-bp15ftbbbbd****
Allow Internet Access for Functions
Specifies whether to allow functions to access the Internet. If this feature is disabled, functions in the service cannot access the Internet through the default network interface card of Function Compute.
ImportantTo use a static public IP address, you must disable Internet Access. Otherwise, the configured static public IP address does not take effect. For more information, see Configure a static public IP address.
Yes
After the service is created, you can view the service and its configuration information in the service list on the Services & Functions page.
Update a service
Log on to the Function Compute console. In the left-side navigation pane, click Services & Functions.
In the top navigation bar, select a region. On the Services page, find the desired service and click Configure in the Actions column.
On the Modify Service page, configure the parameters based on your business requirements and click Save.
Optional:Basic Settings
Configure basic information for the service. You can modify only the service description.
Parameter
Description
Reference
Description
Enter a description for the service. The description helps you identify the purpose of the service.
None
Optional:Other configurations
Parameter
Description
Reference
Role Settings
Configure the role for the functions in the service so that the functions can obtain the permissions of the role.
Grant Function Compute permissions to access other Alibaba Cloud services
Logging Settings
Configure the logging feature for the service. After the logging feature is enabled, you can view the function execution logs. This allows you to perform code debugging, fault analysis, and data analysis.
Tracing Analysis Settings
Enable: After you enable Tracing Analysis, you can use Jaeger to upload trace information. This allows you to view the traces of functions. You can also analyze and diagnose performance bottlenecks in a serverless architecture.
Network Settings
Configure network settings for functions in the service. For example, you can configure whether the functions can access the Internet and the resources in VPC.
Storage Configuration
Configure the File Storage NAS (NAS) file system and Object Storage Service (OSS) file system used by functions in the service. This allows your functions to access files in the NAS file system or OSS file system as they do in the on-premises file system.
You can delete services that you no longer need. Before you delete a service, make sure it has no functions, provisioned instances, versions, or aliases. Otherwise, the service cannot be deleted.
More information
In addition to the Function Compute console, you can also use Serverless Devs or call API operations to manage services. For more information, see:
References
Function Compute lets you set versions and aliases for a service. You can use versions and aliases to implement phased releases. For more information, see Use versions and aliases to implement phased release.
After you create a service, you must also create functions to implement your business logic. Functions are the smallest resource unit in Function Compute. For more information, see Manage functions.