Skip to content

Instantly share code, notes, and snippets.

@nobuhikosekiya
nobuhikosekiya / Elastic-IaC-Examples.md
Last active October 7, 2025 04:15
My Elasticsearch IaC examples

All scripts intend to send data to Elasticsearch (creating Elasticsearch is not part of the script)

Terraform scripts

architecture Github repo Test Status
CloudTrail -> S3 -> Elastic agent on EC2 https://github.com/nobuhikosekiya/tf-cloudtrail-s3-elasticagent
S3 Acesss logs -> S3 -> SQS -> Elastic agent on EC2 https://github.com/nobuhikosekiya/tf-s3accesslog-s3-sqs-elasticagent
WAF logs -> S3 -> SQS -> Elastic agent on EC2 https://github.com/nobuhikosekiya/tf-waf-s3-sqs-elasticagent ![](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/nobuhikosekiya/0c60644e60f6f1b6de284d95c9e4a7a6/raw/ci-ba
from langchain.chat_models import ChatOpenAI
from langchain.prompts import ChatPromptTemplate
from langchain.schema.output_parser import StrOutputParser
import requests
from bs4 import BeautifulSoup
from langchain.schema.runnable import RunnablePassthrough, RunnableLambda
from langchain.utilities import DuckDuckGoSearchAPIWrapper
import json
RESULTS_PER_QUESTION = 3