Ingestion
Log service ingestion, this service provides the function of importing logs of various data sources(OSS, MaxCompute) into logstore. Refer to details.
NOTE: Available in 1.161.0+
Example Usage
Basic Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.RandomInteger;
import com.pulumi.random.RandomIntegerArgs;
import com.pulumi.alicloud.log.Project;
import com.pulumi.alicloud.log.ProjectArgs;
import com.pulumi.alicloud.log.Store;
import com.pulumi.alicloud.log.StoreArgs;
import com.pulumi.alicloud.log.Ingestion;
import com.pulumi.alicloud.log.IngestionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var default_ = new RandomInteger("default", RandomIntegerArgs.builder()
.max(99999)
.min(10000)
.build());
var exampleProject = new Project("exampleProject", ProjectArgs.builder()
.description("terraform-example")
.tags(Map.ofEntries(
Map.entry("Created", "TF"),
Map.entry("For", "example")
))
.build());
var exampleStore = new Store("exampleStore", StoreArgs.builder()
.project(exampleProject.name())
.retentionPeriod(3650)
.shardCount(3)
.autoSplit(true)
.maxSplitShardCount(60)
.appendMeta(true)
.build());
var exampleIngestion = new Ingestion("exampleIngestion", IngestionArgs.builder()
.project(exampleProject.name())
.logstore(exampleStore.name())
.ingestionName("terraform-example")
.displayName("terraform-example")
.description("terraform-example")
.interval("30m")
.runImmediately(true)
.timeZone("+0800")
.source("""
{
"bucket": "bucket_name",
"compressionCodec": "none",
"encoding": "UTF-8",
"endpoint": "oss-cn-hangzhou-internal.aliyuncs.com",
"format": {
"escapeChar": "\\",
"fieldDelimiter": ",",
"fieldNames": [],
"firstRowAsHeader": true,
"maxLines": 1,
"quoteChar": "\"",
"skipLeadingRows": 0,
"timeField": "",
"type": "DelimitedText"
},
"pattern": "",
"prefix": "test-prefix/",
"restoreObjectEnabled": false,
"roleARN": "acs:ram::1049446484210612:role/aliyunlogimportossrole",
"type": "AliyunOSS"
}
""")
.build());
}
}
Content copied to clipboard
Import
Log ingestion can be imported using the id or name, e.g.
$ pulumi import alicloud:log/ingestion:Ingestion example tf-log-project:tf-log-logstore:ingestion_name
Content copied to clipboard