Skip to content

Commit

Permalink
Adding OSI blueprint.
Browse files Browse the repository at this point in the history
Signed-off-by: jzonthemtn <[email protected]>
  • Loading branch information
jzonthemtn committed Jan 20, 2025
1 parent 5966e15 commit a65fd1d
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 12 deletions.
51 changes: 51 additions & 0 deletions osi/blueprint-terraform.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
version: "2"
ubi-pipeline:
source:
http:
path: "/ubi"
processor:
- date:
from_time_received: true
destination: "@timestamp"
route:
- ubi-events: '/type == "event"'
- ubi-queries: '/type == "query"'
sink:
- opensearch:
hosts: ["https://${aws_opensearch_domain.opensearch_ubi.endpoint}"]
index: "ubi_events"
aws:
sts_role_arn: "${aws_iam_role.ubi.arn}"
region: "${data.aws_region.current.name}"
routes: [ubi-events]
- s3:
aws:
sts_role_arn: "${aws_iam_role.ubi.arn}"
region: "${data.aws_region.current.name}"
bucket: "${aws_s3_bucket.ubi_queries_events_bucket.id}"
object_key:
path_prefix: ubi_events/
threshold:
event_collect_timeout: "60s"
codec:
ndjson:
routes: [ubi-events]
- opensearch:
hosts: ["https://${aws_opensearch_domain.opensearch_ubi.endpoint}"]
index: "ubi_queries"
aws:
sts_role_arn: "${aws_iam_role.ubi.arn}"
region: "${data.aws_region.current.name}"
routes: [ubi-queries]
- s3:
aws:
sts_role_arn: "${aws_iam_role.ubi.arn}"
region: "${data.aws_region.current.name}"
bucket: "${aws_s3_bucket.ubi_queries_events_bucket.id}"
object_key:
path_prefix: ubi_queries/
threshold:
event_collect_timeout: "60s"
codec:
ndjson:
routes: [ubi-queries]
33 changes: 22 additions & 11 deletions osi/blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,24 @@ ubi-pipeline:
- ubi-queries: '/type == "query"'
sink:
- opensearch:
hosts: ["https://${aws_opensearch_domain.opensearch_ubi.endpoint}"]
# Provide an AWS OpenSearch Service domain endpoint
hosts: [ "<<https://search-mydomain-1a2a3a4a5a6a7a8a9a0a9a8a7a.us-east-1.es.amazonaws.com>>" ]
index: "ubi_events"
aws:
sts_role_arn: "${aws_iam_role.ubi.arn}"
region: "${data.aws_region.current.name}"
# Enable the 'serverless' flag if the sink is an Amazon OpenSearch Serverless collection
serverless: false
# Provide a Role ARN with access to the domain. This role should have a trust relationship with osis-pipelines.amazonaws.com
sts_role_arn: "<<arn:aws:iam::123456789012:role/Example-Role>>"
# Provide the region of the domain.
region: "<<us-east-1>>"
routes: [ubi-events]
- s3:
aws:
sts_role_arn: "${aws_iam_role.ubi.arn}"
region: "${data.aws_region.current.name}"
bucket: "${aws_s3_bucket.ubi_queries_events_bucket.id}"
# Provide a Role ARN with access to the bucket. This role should have a trust relationship with osis-pipelines.amazonaws.com
sts_role_arn: "<<arn:aws:iam::123456789012:role/Example-Role>>"
# Provide the region of the domain.
region: "<<us-east-1>>"
bucket: "<<bucket-name>>"
object_key:
path_prefix: ubi_events/
threshold:
Expand All @@ -34,14 +41,18 @@ ubi-pipeline:
hosts: ["https://${aws_opensearch_domain.opensearch_ubi.endpoint}"]
index: "ubi_queries"
aws:
sts_role_arn: "${aws_iam_role.ubi.arn}"
region: "${data.aws_region.current.name}"
# Provide a Role ARN with access to the bucket. This role should have a trust relationship with osis-pipelines.amazonaws.com
sts_role_arn: "<<arn:aws:iam::123456789012:role/Example-Role>>"
# Provide the region of the domain.
region: "<<us-east-1>>"
routes: [ubi-queries]
- s3:
aws:
sts_role_arn: "${aws_iam_role.ubi.arn}"
region: "${data.aws_region.current.name}"
bucket: "${aws_s3_bucket.ubi_queries_events_bucket.id}"
# Provide a Role ARN with access to the bucket. This role should have a trust relationship with osis-pipelines.amazonaws.com
sts_role_arn: "<<arn:aws:iam::123456789012:role/Example-Role>>"
# Provide the region of the domain.
region: "<<us-east-1>>"
bucket: "<<bucket-name>>"
object_key:
path_prefix: ubi_queries/
threshold:
Expand Down
2 changes: 1 addition & 1 deletion osi/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ resource "aws_s3_bucket" "ubi_queries_events_bucket" {

resource "aws_osis_pipeline" "ubi_events_pipeline" {
pipeline_name = "ubi-pipeline"
pipeline_configuration_body = file("blueprint.yaml")
pipeline_configuration_body = file("blueprint-terraform.yaml")
max_units = 1
min_units = 1
log_publishing_options {
Expand Down

0 comments on commit a65fd1d

Please sign in to comment.