AWS Directory Service Directory

This page shows how to write Terraform for AWS Directory Service Directory and write them securely.

aws_directory_service_directory (Terraform)

The Directory in AWS Directory Service can be configured in Terraform with the resource name aws_directory_service_directory. The following sections describe 4 examples of how to use the resource and its parameters.

Example Usage from GitHub
resource "aws_directory_service_directory" "simple_ad_small" {
  name     = "simplead-small-123456"
  type     = "SimpleAD"
  password = "SuperSecretPassw0rd"
  size     = "Small"
resource "aws_directory_service_directory" "microsoft_ad" {
  count = local.ms_ad_count

  name     = var.ad_domain_fqdn
  password = var.ad_admin_password
resource "aws_directory_service_directory" "this" {
  name        =
  short_name  =
  type        = lookup(, "type", null)
  edition     = lookup(, "edition", null)
  description =
resource "aws_directory_service_directory" "myapp_ad" {
  name     = var.dir_domain_name
  password = var.dir_admin_password
  size     = "Large"
  vpc_settings {
    vpc_id =

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).


Explanation in Terraform Registry

Provides a Simple or Managed Microsoft directory in AWS Directory Service.

Note: All arguments including the password and customer username will be stored in the raw state as plain-text. Read more about sensitive data in state.

CloudFormation Example

CloudFormation code does not have the related resource.

Frequently asked questions

What is AWS Directory Service Directory?

AWS Directory Service Directory is a resource for Directory Service of Amazon Web Service. Settings can be wrote in Terraform.

Where can I find the example code for the AWS Directory Service Directory?

For Terraform, the infracost/infracost, RaduLupan/terraform-rdgateway-aws and santiagowork/Terraform source code examples are useful. See the Terraform Example section for further details.


Automate config file reviews on your commits

Fix issues in your infrastructure as code with auto-generated patches.