ALIYUN::SLS::Logstore creates a Logstore in a Simple Log Service (SLS) project.
Syntax
{
"Type": "ALIYUN::SLS::Logstore",
"Properties": {
"ProjectName": String,
"ShardCount": Integer,
"AutoSplit": Boolean,
"MaxSplitShard": Integer,
"LogstoreName": String,
"AppendMeta": Boolean,
"TTL": Integer,
"EnableTracking": Boolean,
"PreserveStorage": Boolean,
"EncryptConf": Map,
"Mode": String
}
}
Properties
|
Property |
Type |
Required |
Editable |
Description |
Constraint |
|
ProjectName |
String |
Yes |
No |
The SLS project in which to create the Logstore. |
3 to 63 characters. Can contain lowercase letters, digits, hyphens (-), and underscores (_). Must start and end with a lowercase letter or digit. |
|
ShardCount |
Integer |
No |
Yes |
The number of shards. |
Valid values: 1 to 100. Default value: 2.
|
|
MaxSplitShard |
Integer |
No |
Yes |
The maximum number of shards for automatic splitting. |
Valid values: 1 to 64. Required when AutoSplit is set to true. |
|
LogstoreName |
String |
Yes |
No |
The Logstore name. |
Must be unique within the SLS project.
|
|
AutoSplit |
Boolean |
No |
Yes |
Whether to automatically split shards. |
Valid values:
|
|
TTL |
Integer |
No |
Yes |
The data retention period. |
Valid values: 1 to 3600. Default value: 30. Unit: day. |
|
EnableTracking |
Boolean |
No |
Yes |
Whether to enable web tracking. |
Web tracking collects data from web browsers, iOS apps, and Android apps. Valid values:
|
|
PreserveStorage |
Boolean |
No |
Yes |
Whether to retain logs permanently. |
Valid values:
|
|
Mode |
String |
No |
Yes |
The Logstore type. |
Valid values:
|
|
AppendMeta |
Boolean |
No |
Yes |
Whether to append the client public IP address and log arrival time after receiving a log. |
Valid values:
|
|
EncryptConf |
Map |
No |
No |
The data encryption configuration. |
EncryptConf syntax
"EncryptConf": {
"Enable": Boolean,
"EncryptType": String,
"UserCmkInfo": Map
}
EncryptConf properties
|
Property |
Type |
Required |
Editable |
Description |
Constraint |
|
Enable |
Boolean |
Yes |
No |
Whether to enable data encryption. |
Valid values:
|
|
EncryptType |
String |
Yes |
No |
The encryption algorithm. |
Valid values:
Note
|
|
UserCmkInfo |
Map |
No |
No |
The BYOK method for data encryption and decryption. If empty, the SLS service key is used. |
UserCmkInfo syntax
"UserCmkInfo": {
"CmkKeyId": String,
"Arn": String,
"RegionId": String
}
UserCmkInfo properties
|
Property |
Type |
Required |
Editable |
Description |
Constraint |
|
CmkKeyId |
String |
Yes |
No |
The ID of the customer master key (CMK) for BYOK encryption. |
None. |
|
RegionId |
String |
Yes |
No |
The region ID of the CMK. |
None. |
|
Arn |
String |
Yes |
No |
The Alibaba Cloud Resource Name (ARN) of the RAM role. |
To query the ARN of a RAM role, see Ship log data from Simple Log Service to OSS. |
Return values
Fn::GetAtt
-
LogstoreName: the Logstore name.
-
ProjectName: the SLS project name.
Examples
YAML format
ROSTemplateFormatVersion: '2015-09-01'
Description: Test SLS Logstore
Parameters: {}
Resources:
SlsLogStore:
Type: ALIYUN::SLS::Logstore
Properties:
LogstoreName: mytest
PreserveStorage: true
ProjectName: TestProject
AppendMeta: true
MaxSplitShard: 64
AutoSplit: true
EnableTracking: false
ShardCount: 2
Outputs: {}
JSON format
{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": "Test SLS Logstore",
"Parameters": {
},
"Resources": {
"SlsLogStore": {
"Type": "ALIYUN::SLS::Logstore",
"Properties": {
"LogstoreName": "mytest",
"PreserveStorage": true,
"ProjectName": "TestProject",
"AppendMeta": true,
"MaxSplitShard": 64,
"AutoSplit": true,
"EnableTracking": false,
"ShardCount": 2
}
}
},
"Outputs": {
}
}
For more examples, visit sls.yml. The following resource types are used: ALIYUN::SLS::Project, ALIYUN::SLS::Logstore, ALIYUN::SLS::Index, ALIYUN::SLS::LogtailConfig, ALIYUN::SLS::MachineGroup, ALIYUN::SLS::ApplyConfigToMachineGroup, ALIYUN::ApiGateway::LogConfig, ALIYUN::SLS::Savedsearch, and ALIYUN::SLS::Alert.