> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jacobpevans.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Splunk on AWS

> Plain OpenTofu for an on-demand Splunk and/or Cribl environment on AWS. Both workloads are independently optional, the whole stack auto-stops on a schedule, and it starts and stops again through a credential-less GitHub Actions "summon" workflow.

export const RepoFit = ({children}) => <Tip>{children}</Tip>;

export const RepoMeta = ({language, status, lastActive, repoUrl}) => <Info>
    Language: <b>{language}</b>  ·  Status: <b>{status}</b>  ·  Last active: <b>{lastActive}</b>  ·  <a href={repoUrl}>Source on GitHub</a>
  </Info>;

> Splunk on AWS without the enterprise sticker shock — and without it running when nobody's using it.

<RepoMeta language="HCL" status="active" lastActive="this week" repoUrl="https://github.com/dryvist/tofu-splunk-aws" />

`tofu-splunk-aws` provisions an on-demand data-ingest environment on AWS: a VPC with a cost-optimized NAT instance, and two independently-toggleable workloads — Splunk Enterprise (on by default) and Cribl Stream + Cribl Edge (off by default). It uses plain OpenTofu.

## What it does

* Builds an isolated VPC with public/private subnets and a t4g.nano NAT instance in place of a managed NAT Gateway
* Deploys Splunk Enterprise and/or Cribl Stream/Edge, each behind its own `enable_*` toggle so a run can bring up either, both, or neither
* Stops every tagged instance on a nightly schedule via an EventBridge Scheduler invoking AWS's built-in stop runbook — no custom Lambda
* Starts or stops the whole environment on demand through a GitHub Actions "summon" workflow, authenticated by OIDC — no AWS credentials held by the operator
* State locking uses S3's native conditional-write lockfile; there is no DynamoDB table

## How it fits

| Provisions                                                                        | Hands off to                                                                                               |
| --------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| AWS VPC, NAT instance, Splunk and/or Cribl EC2 instances, IAM, SSM-stored secrets | [Splunk install (Ansible)](/observability/repos/ansible-splunk) configures Splunk further where applicable |

<RepoFit>
  The AWS infrastructure side of Splunk and Cribl, sized to run only when it's needed. Pair with `ansible-splunk` for deeper Splunk configuration.
</RepoFit>

## Getting started

<Steps>
  <Step title="Clone and enter the dev shell">
    `git clone https://github.com/dryvist/tofu-splunk-aws && cd tofu-splunk-aws && nix develop`
  </Step>

  <Step title="Provide AWS credentials">
    Any standard AWS credential source (env vars, SSO, aws-vault) works for the initial `tofu apply`.
  </Step>

  <Step title="Apply">
    `tofu init -backend-config=envs/dev.s3.tfbackend && tofu apply -var-file=envs/dev.tfvars`. Toggle `enable_splunk` / `enable_cribl` to choose which workload(s) come up.
  </Step>

  <Step title="Summon it later without credentials">
    Once `enable_github_summon = true` is applied, start or stop the whole environment from the repo's Actions tab — no AWS credentials needed for that step.
  </Step>
</Steps>

## Related repos

<CardGroup cols={2}>
  <Card title="ansible-splunk" icon="screwdriver-wrench" href="/observability/repos/ansible-splunk">
    Configures the Splunk Enterprise install on what this provisions.
  </Card>

  <Card title="Observability overview" icon="chart-line" href="/observability/overview">
    Where this fits in the OTEL → Cribl → Splunk pipeline.
  </Card>

  <Card title="tofu-aws" icon="aws" href="https://github.com/dryvist/tofu-aws">
    The broader AWS DR footprint repo this complements.
  </Card>

  <Card title="Source on GitHub" icon="github" href="https://github.com/dryvist/tofu-splunk-aws">
    Modules, env folders, full README.
  </Card>
</CardGroup>
