# Managing Elastic Security Detection Rules with Terraform

DevFeed: [Managing Elastic Security Detection Rules with Terraform](<https://devfeed.tech/articles/managing-elastic-security-detection-rules-with-terraform-48919.md>)

Original publisher: [Read original article](<https://www.elastic.co/security-labs/blog/managing-rules-with-terraform>)

Author: Kseniia Ignatovych,Omer Kushmaro,Stuart Moorhouse,Marc-Antoine Leclercq

Published: 2026-03-13T00:00:00Z

Content type: tutorial

Language: en

Sources: [Elastic Security Labs](<https://devfeed.tech/sources/elastic-security-labs.md>)

Topics: [Terraform](<https://devfeed.tech/topics/terraform.md>), [Security](<https://devfeed.tech/topics/security.md>), [Deployment](<https://devfeed.tech/topics/deployment.md>), [configuration](<https://devfeed.tech/topics/configuration.md>)

Tags: [deploy](<https://devfeed.tech/tags/deploy.md>), [deployment](<https://devfeed.tech/tags/deployment.md>), [devops](<https://devfeed.tech/tags/devops.md>), [exceptions](<https://devfeed.tech/tags/exceptions.md>), [hcl](<https://devfeed.tech/tags/hcl.md>), [infrastructure](<https://devfeed.tech/tags/infrastructure.md>), [integrations-tools](<https://devfeed.tech/tags/integrations-tools.md>), [security](<https://devfeed.tech/tags/security.md>), [terraform](<https://devfeed.tech/tags/terraform.md>)

## AI overview

A tutorial on managing Elastic Security detection rules and exceptions as code with the Elastic Stack Terraform Provider. It explains how to define and deploy detection artifacts, compares the provider with the detection-rules repository, and shows how Elastic's AI Agent can help create Terraform configuration.

## Source excerpt

Learn to define and deploy Elastic Security detection rules and exceptions using the Elastic Stack Terraform Provider vs detection-rules repository DaC capabilities.