AWS Directory Service Directory

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


Fix issues in your cloud & app configurations

Test for misconfigurations of this resource in your cloud.


Terraform Example (aws_directory_service_directory)

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.


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 =

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.