Ingestion Args
data class IngestionArgs(val description: Output<String>? = null, val displayName: Output<String>? = null, val ingestionName: Output<String>? = null, val interval: Output<String>? = null, val logstore: Output<String>? = null, val project: Output<String>? = null, val runImmediately: Output<Boolean>? = null, val source: Output<String>? = null, val timeZone: Output<String>? = null) : ConvertibleToJava<IngestionArgs>
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
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
import * as random from "@pulumi/random";
const _default = new random.index.Integer("default", {
max: 99999,
min: 10000,
});
const example = new alicloud.log.Project("example", {
projectName: `terraform-example-${_default.result}`,
description: "terraform-example",
tags: {
Created: "TF",
For: "example",
},
});
const exampleStore = new alicloud.log.Store("example", {
projectName: example.projectName,
logstoreName: "example-store",
retentionPeriod: 3650,
shardCount: 3,
autoSplit: true,
maxSplitShardCount: 60,
appendMeta: true,
});
const exampleIngestion = new alicloud.log.Ingestion("example", {
project: example.projectName,
logstore: exampleStore.logstoreName,
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"
}
`,
});
Content copied to clipboard
import pulumi
import pulumi_alicloud as alicloud
import pulumi_random as random
default = random.index.Integer("default",
max=99999,
min=10000)
example = alicloud.log.Project("example",
project_name=f"terraform-example-{default['result']}",
description="terraform-example",
tags={
"Created": "TF",
"For": "example",
})
example_store = alicloud.log.Store("example",
project_name=example.project_name,
logstore_name="example-store",
retention_period=3650,
shard_count=3,
auto_split=True,
max_split_shard_count=60,
append_meta=True)
example_ingestion = alicloud.log.Ingestion("example",
project=example.project_name,
logstore=example_store.logstore_name,
ingestion_name="terraform-example",
display_name="terraform-example",
description="terraform-example",
interval="30m",
run_immediately=True,
time_zone="+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"
}
""")
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
using Random = Pulumi.Random;
return await Deployment.RunAsync(() =>
{
var @default = new Random.Index.Integer("default", new()
{
Max = 99999,
Min = 10000,
});
var example = new AliCloud.Log.Project("example", new()
{
ProjectName = $"terraform-example-{@default.Result}",
Description = "terraform-example",
Tags =
{
{ "Created", "TF" },
{ "For", "example" },
},
});
var exampleStore = new AliCloud.Log.Store("example", new()
{
ProjectName = example.ProjectName,
LogstoreName = "example-store",
RetentionPeriod = 3650,
ShardCount = 3,
AutoSplit = true,
MaxSplitShardCount = 60,
AppendMeta = true,
});
var exampleIngestion = new AliCloud.Log.Ingestion("example", new()
{
Project = example.ProjectName,
Logstore = exampleStore.LogstoreName,
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""
}
",
});
});
Content copied to clipboard
package main
import (
"fmt"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/log"
"github.com/pulumi/pulumi-random/sdk/v4/go/random"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_default, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
Max: 99999,
Min: 10000,
})
if err != nil {
return err
}
example, err := log.NewProject(ctx, "example", &log.ProjectArgs{
ProjectName: pulumi.Sprintf("terraform-example-%v", _default.Result),
Description: pulumi.String("terraform-example"),
Tags: pulumi.StringMap{
"Created": pulumi.String("TF"),
"For": pulumi.String("example"),
},
})
if err != nil {
return err
}
exampleStore, err := log.NewStore(ctx, "example", &log.StoreArgs{
ProjectName: example.ProjectName,
LogstoreName: pulumi.String("example-store"),
RetentionPeriod: pulumi.Int(3650),
ShardCount: pulumi.Int(3),
AutoSplit: pulumi.Bool(true),
MaxSplitShardCount: pulumi.Int(60),
AppendMeta: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = log.NewIngestion(ctx, "example", &log.IngestionArgs{
Project: example.ProjectName,
Logstore: exampleStore.LogstoreName,
IngestionName: pulumi.String("terraform-example"),
DisplayName: pulumi.String("terraform-example"),
Description: pulumi.String("terraform-example"),
Interval: pulumi.String("30m"),
RunImmediately: pulumi.Bool(true),
TimeZone: pulumi.String("+0800"),
Source: pulumi.String(` {
"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"
}
`),
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.integer;
import com.pulumi.random.IntegerArgs;
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 Integer("default", IntegerArgs.builder()
.max(99999)
.min(10000)
.build());
var example = new Project("example", ProjectArgs.builder()
.projectName(String.format("terraform-example-%s", default_.result()))
.description("terraform-example")
.tags(Map.ofEntries(
Map.entry("Created", "TF"),
Map.entry("For", "example")
))
.build());
var exampleStore = new Store("exampleStore", StoreArgs.builder()
.projectName(example.projectName())
.logstoreName("example-store")
.retentionPeriod(3650)
.shardCount(3)
.autoSplit(true)
.maxSplitShardCount(60)
.appendMeta(true)
.build());
var exampleIngestion = new Ingestion("exampleIngestion", IngestionArgs.builder()
.project(example.projectName())
.logstore(exampleStore.logstoreName())
.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
resources:
default:
type: random:integer
properties:
max: 99999
min: 10000
example:
type: alicloud:log:Project
properties:
projectName: terraform-example-${default.result}
description: terraform-example
tags:
Created: TF
For: example
exampleStore:
type: alicloud:log:Store
name: example
properties:
projectName: ${example.projectName}
logstoreName: example-store
retentionPeriod: 3650
shardCount: 3
autoSplit: true
maxSplitShardCount: 60
appendMeta: true
exampleIngestion:
type: alicloud:log:Ingestion
name: example
properties:
project: ${example.projectName}
logstore: ${exampleStore.logstoreName}
ingestionName: terraform-example
displayName: terraform-example
description: terraform-example
interval: 30m
runImmediately: true
timeZone: '+0800'
source: |2
{
"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"
}
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
Constructors
Link copied to clipboard
constructor(description: Output<String>? = null, displayName: Output<String>? = null, ingestionName: Output<String>? = null, interval: Output<String>? = null, logstore: Output<String>? = null, project: Output<String>? = null, runImmediately: Output<Boolean>? = null, source: Output<String>? = null, timeZone: Output<String>? = null)
Properties
Link copied to clipboard
Ingestion job description.
Link copied to clipboard
The name displayed on the web page.
Link copied to clipboard
Ingestion job name, it can only contain lowercase letters, numbers, dashes -
and underscores _
. It must start and end with lowercase letters or numbers, and the name must be 2 to 128 characters long.
Link copied to clipboard
Whether to run the ingestion job immediately, if false, wait for an interval before starting the ingestion.
Link copied to clipboard
Data source and data format details. Refer to details.