Alibaba Cloud

v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

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

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleProject = new AliCloud.Log.Project("exampleProject", new AliCloud.Log.ProjectArgs
        {
            Description = "created by terraform",
            Tags = 
            {
                { "test", "test" },
            },
        });
        var exampleStore = new AliCloud.Log.Store("exampleStore", new AliCloud.Log.StoreArgs
        {
            Project = exampleProject.Name,
            RetentionPeriod = 3650,
            ShardCount = 3,
            AutoSplit = true,
            MaxSplitShardCount = 60,
            AppendMeta = true,
        });
        var exampleIngestion = new AliCloud.Log.Ingestion("exampleIngestion", new AliCloud.Log.IngestionArgs
        {
            Project = exampleProject.Name,
            Logstore = exampleStore.Name,
            IngestionName = "ingestion_name",
            DisplayName = "display_name",
            Description = "oss2sls",
            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""
        }
",
        });
    }

}
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/log"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleProject, err := log.NewProject(ctx, "exampleProject", &log.ProjectArgs{
			Description: pulumi.String("created by terraform"),
			Tags: pulumi.AnyMap{
				"test": pulumi.Any("test"),
			},
		})
		if err != nil {
			return err
		}
		exampleStore, err := log.NewStore(ctx, "exampleStore", &log.StoreArgs{
			Project:            exampleProject.Name,
			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, "exampleIngestion", &log.IngestionArgs{
			Project:        exampleProject.Name,
			Logstore:       exampleStore.Name,
			IngestionName:  pulumi.String("ingestion_name"),
			DisplayName:    pulumi.String("display_name"),
			Description:    pulumi.String("oss2sls"),
			Interval:       pulumi.String("30m"),
			RunImmediately: pulumi.Bool(true),
			TimeZone:       pulumi.String("+0800"),
			Source: pulumi.String(fmt.Sprintf(`        {
          "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
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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 exampleProject = new Project("exampleProject", ProjectArgs.builder()        
            .description("created by terraform")
            .tags(Map.of("test", "test"))
            .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("ingestion_name")
            .displayName("display_name")
            .description("oss2sls")
            .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());

    }
}
import pulumi
import pulumi_alicloud as alicloud

example_project = alicloud.log.Project("exampleProject",
    description="created by terraform",
    tags={
        "test": "test",
    })
example_store = alicloud.log.Store("exampleStore",
    project=example_project.name,
    retention_period=3650,
    shard_count=3,
    auto_split=True,
    max_split_shard_count=60,
    append_meta=True)
example_ingestion = alicloud.log.Ingestion("exampleIngestion",
    project=example_project.name,
    logstore=example_store.name,
    ingestion_name="ingestion_name",
    display_name="display_name",
    description="oss2sls",
    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"
        }
""")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const exampleProject = new alicloud.log.Project("exampleProject", {
    description: "created by terraform",
    tags: {
        test: "test",
    },
});
const exampleStore = new alicloud.log.Store("exampleStore", {
    project: exampleProject.name,
    retentionPeriod: 3650,
    shardCount: 3,
    autoSplit: true,
    maxSplitShardCount: 60,
    appendMeta: true,
});
const exampleIngestion = new alicloud.log.Ingestion("exampleIngestion", {
    project: exampleProject.name,
    logstore: exampleStore.name,
    ingestionName: "ingestion_name",
    displayName: "display_name",
    description: "oss2sls",
    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"
        }
`,
});
resources:
  exampleProject:
    type: alicloud:log:Project
    properties:
      description: created by terraform
      tags:
        test: test
  exampleStore:
    type: alicloud:log:Store
    properties:
      project: ${exampleProject.name}
      retentionPeriod: 3650
      shardCount: 3
      autoSplit: true
      maxSplitShardCount: 60
      appendMeta: true
  exampleIngestion:
    type: alicloud:log:Ingestion
    properties:
      project: ${exampleProject.name}
      logstore: ${exampleStore.name}
      ingestionName: ingestion_name
      displayName: display_name
      description: oss2sls
      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"
                }

Create Ingestion Resource

new Ingestion(name: string, args: IngestionArgs, opts?: CustomResourceOptions);
@overload
def Ingestion(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              description: Optional[str] = None,
              display_name: Optional[str] = None,
              ingestion_name: Optional[str] = None,
              interval: Optional[str] = None,
              logstore: Optional[str] = None,
              project: Optional[str] = None,
              run_immediately: Optional[bool] = None,
              source: Optional[str] = None,
              time_zone: Optional[str] = None)
@overload
def Ingestion(resource_name: str,
              args: IngestionArgs,
              opts: Optional[ResourceOptions] = None)
func NewIngestion(ctx *Context, name string, args IngestionArgs, opts ...ResourceOption) (*Ingestion, error)
public Ingestion(string name, IngestionArgs args, CustomResourceOptions? opts = null)
public Ingestion(String name, IngestionArgs args)
public Ingestion(String name, IngestionArgs args, CustomResourceOptions options)
type: alicloud:log:Ingestion
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args IngestionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args IngestionArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args IngestionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args IngestionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args IngestionArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Ingestion Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Ingestion resource accepts the following input properties:

DisplayName string

The name displayed on the web page.

IngestionName string

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.

Interval string

Task execution interval, support minute m, hour h, day d, for example 30 minutes 30m.

Logstore string

The name of the target logstore.

Project string

The name of the log project. It is the only in one Alicloud account.

RunImmediately bool

Whether to run the ingestion job immediately, if false, wait for an interval before starting the ingestion.

Source string

Data source and data format details. Refer to details.

Description string

Ingestion job description.

TimeZone string

Which time zone is the log time imported in, e.g. +0800.

DisplayName string

The name displayed on the web page.

IngestionName string

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.

Interval string

Task execution interval, support minute m, hour h, day d, for example 30 minutes 30m.

Logstore string

The name of the target logstore.

Project string

The name of the log project. It is the only in one Alicloud account.

RunImmediately bool

Whether to run the ingestion job immediately, if false, wait for an interval before starting the ingestion.

Source string

Data source and data format details. Refer to details.

Description string

Ingestion job description.

TimeZone string

Which time zone is the log time imported in, e.g. +0800.

displayName String

The name displayed on the web page.

ingestionName String

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.

interval String

Task execution interval, support minute m, hour h, day d, for example 30 minutes 30m.

logstore String

The name of the target logstore.

project String

The name of the log project. It is the only in one Alicloud account.

runImmediately Boolean

Whether to run the ingestion job immediately, if false, wait for an interval before starting the ingestion.

source String

Data source and data format details. Refer to details.

description String

Ingestion job description.

timeZone String

Which time zone is the log time imported in, e.g. +0800.

displayName string

The name displayed on the web page.

ingestionName string

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.

interval string

Task execution interval, support minute m, hour h, day d, for example 30 minutes 30m.

logstore string

The name of the target logstore.

project string

The name of the log project. It is the only in one Alicloud account.

runImmediately boolean

Whether to run the ingestion job immediately, if false, wait for an interval before starting the ingestion.

source string

Data source and data format details. Refer to details.

description string

Ingestion job description.

timeZone string

Which time zone is the log time imported in, e.g. +0800.

display_name str

The name displayed on the web page.

ingestion_name str

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.

interval str

Task execution interval, support minute m, hour h, day d, for example 30 minutes 30m.

logstore str

The name of the target logstore.

project str

The name of the log project. It is the only in one Alicloud account.

run_immediately bool

Whether to run the ingestion job immediately, if false, wait for an interval before starting the ingestion.

source str

Data source and data format details. Refer to details.

description str

Ingestion job description.

time_zone str

Which time zone is the log time imported in, e.g. +0800.

displayName String

The name displayed on the web page.

ingestionName String

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.

interval String

Task execution interval, support minute m, hour h, day d, for example 30 minutes 30m.

logstore String

The name of the target logstore.

project String

The name of the log project. It is the only in one Alicloud account.

runImmediately Boolean

Whether to run the ingestion job immediately, if false, wait for an interval before starting the ingestion.

source String

Data source and data format details. Refer to details.

description String

Ingestion job description.

timeZone String

Which time zone is the log time imported in, e.g. +0800.

Outputs

All input properties are implicitly available as output properties. Additionally, the Ingestion resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing Ingestion Resource

Get an existing Ingestion resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: IngestionState, opts?: CustomResourceOptions): Ingestion
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        display_name: Optional[str] = None,
        ingestion_name: Optional[str] = None,
        interval: Optional[str] = None,
        logstore: Optional[str] = None,
        project: Optional[str] = None,
        run_immediately: Optional[bool] = None,
        source: Optional[str] = None,
        time_zone: Optional[str] = None) -> Ingestion
func GetIngestion(ctx *Context, name string, id IDInput, state *IngestionState, opts ...ResourceOption) (*Ingestion, error)
public static Ingestion Get(string name, Input<string> id, IngestionState? state, CustomResourceOptions? opts = null)
public static Ingestion get(String name, Output<String> id, IngestionState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Description string

Ingestion job description.

DisplayName string

The name displayed on the web page.

IngestionName string

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.

Interval string

Task execution interval, support minute m, hour h, day d, for example 30 minutes 30m.

Logstore string

The name of the target logstore.

Project string

The name of the log project. It is the only in one Alicloud account.

RunImmediately bool

Whether to run the ingestion job immediately, if false, wait for an interval before starting the ingestion.

Source string

Data source and data format details. Refer to details.

TimeZone string

Which time zone is the log time imported in, e.g. +0800.

Description string

Ingestion job description.

DisplayName string

The name displayed on the web page.

IngestionName string

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.

Interval string

Task execution interval, support minute m, hour h, day d, for example 30 minutes 30m.

Logstore string

The name of the target logstore.

Project string

The name of the log project. It is the only in one Alicloud account.

RunImmediately bool

Whether to run the ingestion job immediately, if false, wait for an interval before starting the ingestion.

Source string

Data source and data format details. Refer to details.

TimeZone string

Which time zone is the log time imported in, e.g. +0800.

description String

Ingestion job description.

displayName String

The name displayed on the web page.

ingestionName String

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.

interval String

Task execution interval, support minute m, hour h, day d, for example 30 minutes 30m.

logstore String

The name of the target logstore.

project String

The name of the log project. It is the only in one Alicloud account.

runImmediately Boolean

Whether to run the ingestion job immediately, if false, wait for an interval before starting the ingestion.

source String

Data source and data format details. Refer to details.

timeZone String

Which time zone is the log time imported in, e.g. +0800.

description string

Ingestion job description.

displayName string

The name displayed on the web page.

ingestionName string

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.

interval string

Task execution interval, support minute m, hour h, day d, for example 30 minutes 30m.

logstore string

The name of the target logstore.

project string

The name of the log project. It is the only in one Alicloud account.

runImmediately boolean

Whether to run the ingestion job immediately, if false, wait for an interval before starting the ingestion.

source string

Data source and data format details. Refer to details.

timeZone string

Which time zone is the log time imported in, e.g. +0800.

description str

Ingestion job description.

display_name str

The name displayed on the web page.

ingestion_name str

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.

interval str

Task execution interval, support minute m, hour h, day d, for example 30 minutes 30m.

logstore str

The name of the target logstore.

project str

The name of the log project. It is the only in one Alicloud account.

run_immediately bool

Whether to run the ingestion job immediately, if false, wait for an interval before starting the ingestion.

source str

Data source and data format details. Refer to details.

time_zone str

Which time zone is the log time imported in, e.g. +0800.

description String

Ingestion job description.

displayName String

The name displayed on the web page.

ingestionName String

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.

interval String

Task execution interval, support minute m, hour h, day d, for example 30 minutes 30m.

logstore String

The name of the target logstore.

project String

The name of the log project. It is the only in one Alicloud account.

runImmediately Boolean

Whether to run the ingestion job immediately, if false, wait for an interval before starting the ingestion.

source String

Data source and data format details. Refer to details.

timeZone String

Which time zone is the log time imported in, e.g. +0800.

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

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.