Creates a Microsoft Active Directory in AWS and shares it with another AWS account.

Terraform Template

resource "aws_directory_service_directory" "example" {
  edition = "Standard"
  name = "tf-example"
  password = "SuperSecretPassw0rd"
  type = "MicrosoftAD"

  vpc_settings {
    subnet_ids = aws_subnet.example[*].id
    vpc_id = "aws_vpc.example.id"
  }
}

resource "aws_directory_service_shared_directory" "example" {
  directory_id = aws_directory_service_directory.example.id
  notes = "You wanna have a catch?"

  target {
    id = "data.aws_caller_identity.receiver.account_id"
  }
}