Elastic Terraform provider lets you version and deploy security rules, ML jobs, and AI connectors as code
The Elastic Stack Terraform provider enables management of detection rules, exception lists, prebuilt rules, ML anomaly detection jobs, and AI connectors as code, providing version control and auditability across environments.
Security & privacy Elastic Security Labs 27 Feb 2026 Tooling Deployed evidence
Published as “Manage your Elastic security stack as code with the Elastic Stack Terraform provider”
Why it matters
Treating security rules, ML jobs, and AI connectors as version-controlled code reduces drift, improves auditability, and streamlines multi-environment deployments.
Summary
The blog announces that starting with provider version 0.13.1, Elastic security artifacts-including detection rules, exception lists, prebuilt rules, ML anomaly detection jobs, cross-cluster API keys, and AI connectors-can be defined and managed via Terraform resources. This brings these configurations into a version-controlled, peer-reviewed workflow, eliminating manual UI steps and reducing configuration drift. The evidence consists of example HCL snippets and feature descriptions; no quantitative evaluation is provided.
What they found 4
- Detection rules can be managed as Terraform resources
“The elasticstack_kibana_security_detection_rule resource lets you define, version, and deploy detection rules in the HashiCorp Configuration Language (HCL) format:”
- ML anomaly detection jobs can be defined and deployed via Terraform
“The elasticstack_elasticsearch_ml_anomaly_detection_job resource changes that. You can now define the full configuration of an anomaly detection job in HCL”
- Cross-cluster API keys are supported as Terraform resources
“The provider now supports cluster API keys for cross-cluster search (CCS) and cross-cluster replication (CCR).”
- AI connectors (Bedrock, OpenAI) can be managed as code
“The provider now supports .bedrock and .gen-ai connectors, bringing AI infrastructure into your Terraform workflows.”
What’s new here 4
- elasticstack_kibana_security_detection_rule resource for managing detection rules
- Resources for exception lists and items (elasticstack_kibana_security_exception_list, _item, etc.)
- elasticstack_elasticsearch_ml_anomaly_detection_job for defining ML jobs as code
- Support for cross-cluster API keys via elasticstack_elasticsearch_security_api_key