Pipeline class

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 exampleRole = 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 example = new aws.opensearchingest.Pipeline("example", {
    pipelineName: "example",
    pipelineConfigurationBody: pulumi.all([exampleRole.arn, current]).apply(([arn, current]) => `version: \"2\"
example-pipeline:
  source:
    http:
      path: \"/example\"
  sink:
    - s3:
        aws:
          sts_role_arn: \"${arn}\"
          region: \"${current.region}\"
        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_role = 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 = aws.opensearchingest.Pipeline("example",
    pipeline_name="example",
    pipeline_configuration_body=example_role.arn.apply(lambda arn: f"""version: \"2\"
example-pipeline:
  source:
    http:
      path: \"/example\"
  sink:
    - s3:
        aws:
          sts_role_arn: \"{arn}\"
          region: \"{current.region}\"
        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 exampleRole = 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 example = new Aws.OpenSearchIngest.Pipeline("example", new()
    {
        PipelineName = "example",
        PipelineConfigurationBody = Output.Tuple(exampleRole.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.Region)}\""
        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/v7/go/aws"
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/iam"
	"github.com/pulumi/pulumi-aws/sdk/v7/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]string{
						"Service": "osis-pipelines.amazonaws.com",
					},
				},
			},
		})
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		exampleRole, 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: exampleRole.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.Region), nil
			}).(pulumi.StringOutput),
			MaxUnits: pulumi.Int(1),
			MinUnits: pulumi.Int(1),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

data "aws_getregion" "current" {
}

resource "aws_opensearchingest_pipeline" "example" {
  pipeline_name               = "example"
  pipeline_configuration_body ="version: \"2\"
example-pipeline:
  source:
    http:
      path: \"/example\"
  sink:
    - s3:
        aws:
          sts_role_arn: \"${aws_iam_role.example.arn}\"
          region: \"${data.aws_getregion.current.region}\"
        bucket: \"example\"
        threshold:
          event_collect_timeout: \"60s\"
        codec:
          ndjson:
"
  max_units                   = 1
  min_units                   = 1
}
resource "aws_iam_role" "example" {
  assume_role_policy = jsonencode({
    "Version" = "2012-10-17"
    "Statement" = [{
      "Action" = "sts:AssumeRole"
      "Effect" = "Allow"
      "Sid"    = ""
      "Principal" = {
        "Service" = "osis-pipelines.amazonaws.com"
      }
    }]
  })
}
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.ArrayList;
import java.util.Arrays;
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 exampleRole = new Role("exampleRole", 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 example = new Pipeline("example", PipelineArgs.builder()
            .pipelineName("example")
            .pipelineConfigurationBody(exampleRole.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.region())))
            .maxUnits(1)
            .minUnits(1)
            .build());

    }
}
resources:
  example:
    type: aws:opensearchingest:Pipeline
    properties:
      pipelineName: example
      pipelineConfigurationBody: |
        version: \"2\"
        example-pipeline:
          source:
            http:
              path: \"/example\"
          sink:
            - s3:
                aws:
                  sts_role_arn: \"${exampleRole.arn}\"
                  region: \"${current.region}\"
                bucket: \"example\"
                threshold:
                  event_collect_timeout: \"60s\"
                codec:
                  ndjson:
      maxUnits: 1
      minUnits: 1
  exampleRole:
    type: aws:iam:Role
    name: example
    properties:
      assumeRolePolicy:
        fn::toJSON:
          Version: 2012-10-17
          Statement:
            - Action: sts:AssumeRole
              Effect: Allow
              Sid: ""
              Principal:
                Service: osis-pipelines.amazonaws.com
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/v7/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
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
    std = {
      source = "pulumi/std"
    }
  }
}

resource "aws_opensearchingest_pipeline" "example" {
  pipeline_name               = "example"
  pipeline_configuration_body = file("example.yaml")
  max_units                   = 1
  min_units                   = 1
}
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.ArrayList;
import java.util.Arrays;
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

Identity Schema

Required

  • name (String) Name of the pipeline.

Optional

  • accountId (String) AWS Account where this resource is managed.
  • region (String) Region where this resource is managed.

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

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

Constructors

Pipeline(String name, {PipelineArgs? args, CustomResourceOptions? options})
Creates a new Pipeline. name The Pulumi resource name. args Arguments used to configure this Pipeline. The set of arguments for Pipeline. options Resource options controlling this resource's behavior.
Pipeline.reference(String urn)
Creates a typed reference to an existing Pipeline resource.

Properties

bufferOptions ↔ Output<PipelineBufferOptions?>
Key-value pairs to configure persistent buffering for the pipeline. See bufferOptions below.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
encryptionAtRestOptions ↔ Output<PipelineEncryptionAtRestOptions?>
Key-value pairs to configure encryption for data that is written to a persistent buffer. See encryptionAtRestOptions below.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
ingestEndpointUrls ↔ Output<List<String>>
The list of ingestion endpoints for the pipeline, which you can send data to.
latefinal
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
logPublishingOptions ↔ Output<PipelineLogPublishingOptions?>
Key-value pairs to configure log publishing. See logPublishingOptions below.
latefinal
maxUnits ↔ Output<int>
The maximum pipeline capacity, in Ingestion Compute Units (ICUs).
latefinal
minUnits ↔ Output<int>
The minimum pipeline capacity, in Ingestion Compute Units (ICUs).
latefinal
pipelineArn ↔ Output<String>
ARN of the pipeline.
latefinal
pipelineConfigurationBody ↔ Output<String>
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.
latefinal
pipelineName ↔ Output<String>
Name of the pipeline. Pipeline names are unique across the pipelines owned by an account within an AWS Region.
latefinal
pipelineRoleArn ↔ Output<String>
ARN of the IAM role that grants the pipeline permission to access AWS resources.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tags ↔ Output<Map<String, String>?>
A map of tags to assign to the pipeline. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
latefinal
tagsAll ↔ Output<Map<String, String>>
latefinal
timeouts ↔ Output<PipelineTimeouts?>
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited
vpcOptions ↔ Output<PipelineVpcOptions?>
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 vpcOptions below.
latefinal

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {PipelineState? state, CustomResourceOptions? options}) → Pipeline
Gets an existing Pipeline resource's state with the given name and id.