You can use Function Compute to deliver logs that you want to persist to Object Storage Service (OSS). You can view and analyze persisted logs based on your business requirements. This topic describes how to use Function Compute to deliver logs to OSS.
Prerequisites
- OSS is activated. To activate OSS, go to the OSS product page. An OSS bucket in which logs can be persisted is created.
- Function Compute is activated. To activate Function Compute, go to the Function Compute console.
Note
- You cannot deliver logs as a Security Token Service (STS) role. We recommend that you deliver logs with an Alibaba Cloud account or as a RAM user.
- Log on to the Function Compute console and use an existing Function Compute service to deliver log data.
Background information
- Alibaba Cloud CDN allows you to use Function Compute to deliver logs to OSS. When you enable this feature, the system creates the AliyunCDNEventNotificationRole service-linked role and assigns the role to Alibaba Cloud CDN. Alibaba Cloud CDN can assume this role to access Function Compute and automate log delivery.
- Alibaba Cloud CDN is integrated with Function Compute. This allows you to configure functions for common events and filter events by parameter. For example, you can filter events by domain name to collect data from specific domain names. After Alibaba Cloud CDN receives events that meet the filter conditions, it automatically calls functions to process the events and deliver logs to OSS.
Scenarios
The log storage feature of Alibaba Cloud CDN retains log data for 30 days free of charge. To persist log data, you can deliver log data to OSS. This facilitates log storage and analytics.
Billing rules
You are not charged by Alibaba Cloud CDN when you use Function Compute to deliver logs. You are charged by OSS and Function Compute based on the following rules:
- For more information about the billing rules of OSS, see OSS Pricing.
- Function Compute resources are consumed during the log delivery process. Function Compute provides a free quota each month. You are charged for Function Compute resources that exceed the free quota. For more information, see Function Compute billing methods.
Enable Function Compute for log storage
Disable Function Compute for log storage
To disable Function Compute for log storage, perform the following steps. You are no longer charged after Function Compute for log storage is disabled.