Pipeline

class Pipeline : KotlinCustomResource

Resource for managing an AWS OpenSearch Ingestion Pipeline.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const current = aws.getRegion({});
const example = new aws.iam.Role("example", {assumeRolePolicy: JSON.stringify({
Version: "2012-10-17",
Statement: [{
Action: "sts:AssumeRole",
Effect: "Allow",
Sid: "",
Principal: {
Service: "osis-pipelines.amazonaws.com",
},
}],
})});
const examplePipeline = new aws.opensearchingest.Pipeline("example", {
pipelineName: "example",
pipelineConfigurationBody: pulumi.all([example.arn, current]).apply(([arn, current]) => `version: "2"
example-pipeline:
source:
http:
path: "/example"
sink:
- s3:
aws:
sts_role_arn: "${arn}"
region: "${current.name}"
bucket: "example"
threshold:
event_collect_timeout: "60s"
codec:
ndjson:
`),
maxUnits: 1,
minUnits: 1,
});
import pulumi
import json
import pulumi_aws as aws
current = aws.get_region()
example = aws.iam.Role("example", assume_role_policy=json.dumps({
"Version": "2012-10-17",
"Statement": [{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Sid": "",
"Principal": {
"Service": "osis-pipelines.amazonaws.com",
},
}],
}))
example_pipeline = aws.opensearchingest.Pipeline("example",
pipeline_name="example",
pipeline_configuration_body=example.arn.apply(lambda arn: f"""version: "2"
example-pipeline:
source:
http:
path: "/example"
sink:
- s3:
aws:
sts_role_arn: "{arn}"
region: "{current.name}"
bucket: "example"
threshold:
event_collect_timeout: "60s"
codec:
ndjson:
"""),
max_units=1,
min_units=1)
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var current = Aws.GetRegion.Invoke();
var example = new Aws.Iam.Role("example", new()
{
AssumeRolePolicy = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["Version"] = "2012-10-17",
["Statement"] = new[]
{
new Dictionary<string, object?>
{
["Action"] = "sts:AssumeRole",
["Effect"] = "Allow",
["Sid"] = "",
["Principal"] = new Dictionary<string, object?>
{
["Service"] = "osis-pipelines.amazonaws.com",
},
},
},
}),
});
var examplePipeline = new Aws.OpenSearchIngest.Pipeline("example", new()
{
PipelineName = "example",
PipelineConfigurationBody = Output.Tuple(example.Arn, current).Apply(values =>
{
var arn = values.Item1;
var current = values.Item2;
return @$"version: ""2""
example-pipeline:
source:
http:
path: ""/example""
sink:
- s3:
aws:
sts_role_arn: ""{arn}""
region: ""{current.Apply(getRegionResult => getRegionResult.Name)}""
bucket: ""example""
threshold:
event_collect_timeout: ""60s""
codec:
ndjson:
";
}),
MaxUnits = 1,
MinUnits = 1,
});
});
package main
import (
"encoding/json"
"fmt"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/opensearchingest"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
current, err := aws.GetRegion(ctx, &aws.GetRegionArgs{}, nil)
if err != nil {
return err
}
tmpJSON0, err := json.Marshal(map[string]interface{}{
"Version": "2012-10-17",
"Statement": []map[string]interface{}{
map[string]interface{}{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Sid": "",
"Principal": map[string]interface{}{
"Service": "osis-pipelines.amazonaws.com",
},
},
},
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
example, err := iam.NewRole(ctx, "example", &iam.RoleArgs{
AssumeRolePolicy: pulumi.String(json0),
})
if err != nil {
return err
}
_, err = opensearchingest.NewPipeline(ctx, "example", &opensearchingest.PipelineArgs{
PipelineName: pulumi.String("example"),
PipelineConfigurationBody: example.Arn.ApplyT(func(arn string) (string, error) {
return fmt.Sprintf(`version: "2"
example-pipeline:
source:
http:
path: "/example"
sink:
- s3:
aws:
sts_role_arn: "%v"
region: "%v"
bucket: "example"
threshold:
event_collect_timeout: "60s"
codec:
ndjson:
`, arn, current.Name), nil
}).(pulumi.StringOutput),
MaxUnits: pulumi.Int(1),
MinUnits: pulumi.Int(1),
})
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.aws.AwsFunctions;
import com.pulumi.aws.inputs.GetRegionArgs;
import com.pulumi.aws.iam.Role;
import com.pulumi.aws.iam.RoleArgs;
import com.pulumi.aws.opensearchingest.Pipeline;
import com.pulumi.aws.opensearchingest.PipelineArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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) {
final var current = AwsFunctions.getRegion(GetRegionArgs.builder()
.build());
var example = new Role("example", RoleArgs.builder()
.assumeRolePolicy(serializeJson(
jsonObject(
jsonProperty("Version", "2012-10-17"),
jsonProperty("Statement", jsonArray(jsonObject(
jsonProperty("Action", "sts:AssumeRole"),
jsonProperty("Effect", "Allow"),
jsonProperty("Sid", ""),
jsonProperty("Principal", jsonObject(
jsonProperty("Service", "osis-pipelines.amazonaws.com")
))
)))
)))
.build());
var examplePipeline = new Pipeline("examplePipeline", PipelineArgs.builder()
.pipelineName("example")
.pipelineConfigurationBody(example.arn().applyValue(_arn -> """
version: "2"
example-pipeline:
source:
http:
path: "/example"
sink:
- s3:
aws:
sts_role_arn: "%s"
region: "%s"
bucket: "example"
threshold:
event_collect_timeout: "60s"
codec:
ndjson:
", _arn,current.name())))
.maxUnits(1)
.minUnits(1)
.build());
}
}
resources:
example:
type: aws:iam:Role
properties:
assumeRolePolicy:
fn::toJSON:
Version: 2012-10-17
Statement:
- Action: sts:AssumeRole
Effect: Allow
Sid: ""
Principal:
Service: osis-pipelines.amazonaws.com
examplePipeline:
type: aws:opensearchingest:Pipeline
name: example
properties:
pipelineName: example
pipelineConfigurationBody: |
version: "2"
example-pipeline:
source:
http:
path: "/example"
sink:
- s3:
aws:
sts_role_arn: "${example.arn}"
region: "${current.name}"
bucket: "example"
threshold:
event_collect_timeout: "60s"
codec:
ndjson:
maxUnits: 1
minUnits: 1
variables:
current:
fn::invoke:
function: aws:getRegion
arguments: {}

Using file function

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as std from "@pulumi/std";
const example = new aws.opensearchingest.Pipeline("example", {
pipelineName: "example",
pipelineConfigurationBody: std.file({
input: "example.yaml",
}).then(invoke => invoke.result),
maxUnits: 1,
minUnits: 1,
});
import pulumi
import pulumi_aws as aws
import pulumi_std as std
example = aws.opensearchingest.Pipeline("example",
pipeline_name="example",
pipeline_configuration_body=std.file(input="example.yaml").result,
max_units=1,
min_units=1)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
using Std = Pulumi.Std;
return await Deployment.RunAsync(() =>
{
var example = new Aws.OpenSearchIngest.Pipeline("example", new()
{
PipelineName = "example",
PipelineConfigurationBody = Std.File.Invoke(new()
{
Input = "example.yaml",
}).Apply(invoke => invoke.Result),
MaxUnits = 1,
MinUnits = 1,
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/opensearchingest"
"github.com/pulumi/pulumi-std/sdk/go/std"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
invokeFile, err := std.File(ctx, &std.FileArgs{
Input: "example.yaml",
}, nil)
if err != nil {
return err
}
_, err = opensearchingest.NewPipeline(ctx, "example", &opensearchingest.PipelineArgs{
PipelineName: pulumi.String("example"),
PipelineConfigurationBody: pulumi.String(invokeFile.Result),
MaxUnits: pulumi.Int(1),
MinUnits: pulumi.Int(1),
})
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.aws.opensearchingest.Pipeline;
import com.pulumi.aws.opensearchingest.PipelineArgs;
import com.pulumi.std.StdFunctions;
import com.pulumi.std.inputs.FileArgs;
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 example = new Pipeline("example", PipelineArgs.builder()
.pipelineName("example")
.pipelineConfigurationBody(StdFunctions.file(FileArgs.builder()
.input("example.yaml")
.build()).result())
.maxUnits(1)
.minUnits(1)
.build());
}
}
resources:
example:
type: aws:opensearchingest:Pipeline
properties:
pipelineName: example
pipelineConfigurationBody:
fn::invoke:
function: std:file
arguments:
input: example.yaml
return: result
maxUnits: 1
minUnits: 1

Import

Using pulumi import, import OpenSearch Ingestion Pipeline using the id. For example:

$ pulumi import aws:opensearchingest/pipeline:Pipeline example example

Properties

Link copied to clipboard

Key-value pairs to configure persistent buffering for the pipeline. See buffer_options below.

Link copied to clipboard

Key-value pairs to configure encryption for data that is written to a persistent buffer. See encryption_at_rest_options below.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

The list of ingestion endpoints for the pipeline, which you can send data to.

Link copied to clipboard

Key-value pairs to configure log publishing. See log_publishing_options below.

Link copied to clipboard
val maxUnits: Output<Int>

The maximum pipeline capacity, in Ingestion Compute Units (ICUs).

Link copied to clipboard
val minUnits: Output<Int>

The minimum pipeline capacity, in Ingestion Compute Units (ICUs).

Link copied to clipboard
val pipelineArn: Output<String>

Amazon Resource Name (ARN) of the pipeline.

Link copied to clipboard

The pipeline configuration in YAML format. This argument accepts the pipeline configuration as a string or within a .yaml file. If you provide the configuration as a string, each new line must be escaped with \n.

Link copied to clipboard
val pipelineName: Output<String>

The name of the OpenSearch Ingestion pipeline to create. Pipeline names are unique across the pipelines owned by an account within an AWS Region. The following arguments are optional:

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val tags: Output<Map<String, String>>?

A map of tags to assign to the pipeline. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard
val tagsAll: Output<Map<String, String>>
Link copied to clipboard
Link copied to clipboard
val urn: Output<String>
Link copied to clipboard

Container for the values required to configure VPC access for the pipeline. If you don't specify these values, OpenSearch Ingestion creates the pipeline with a public endpoint. See vpc_options below.