Resource: aws_osis_pipeline

Terraform resource for managing an AWS OpenSearch Ingestion Pipeline.

Example Usage

Basic Usage

data "aws_region" "current" {}

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"
        }
      },
    ]
  })
}

resource "aws_osis_pipeline" "example" {
  pipeline_name               = "example"
  pipeline_configuration_body = <<-EOT
            version: "2"
            example-pipeline:
              source:
                http:
                  path: "/example"
              sink:
                - s3:
                    aws:
                      sts_role_arn: "${aws_iam_role.example.arn}"
                      region: "${data.aws_region.current.name}"
                    bucket: "example"
                    threshold:
                      event_collect_timeout: "60s"
                    codec:
                      ndjson:
        EOT
  max_units                   = 1
  min_units                   = 1
}

Using file function

resource "aws_osis_pipeline" "example" {
  pipeline_name               = "example"
  pipeline_configuration_body = file("example.yaml")
  max_units                   = 1
  min_units                   = 1
}

Argument Reference

The following arguments are required:

The following arguments are optional:

buffer_options

encryption_at_rest_options

log_publishing_options

cloudwatch_log_destination

vpc_options

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Timeouts

Configuration options:

Import

In Terraform v1.5.0 and later, use an import block to import OpenSearch Ingestion Pipeline using the id. For example:

import {
  to = aws_osis_pipeline.example
  id = "example"
}

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

% terraform import aws_osis_pipeline.example example