Skip to content
GitHubXDiscord

MicrosoftAD

The MicrosoftAD resource lets you create and manage AWS DirectoryService MicrosoftADs for your applications. This resource enables you to set up a fully managed, cloud-based Microsoft Active Directory.

Create a basic MicrosoftAD with the required properties and one optional property.

import AWS from "alchemy/aws/control";
const basicMicrosoftAd = await AWS.DirectoryService.MicrosoftAD("basicMicrosoftAd", {
Name: "mycompany.com",
Password: "StrongPassword123!",
VpcSettings: {
VpcId: "vpc-0abcd1234efgh5678",
SubnetIds: [
"subnet-0abcd1234efgh5678",
"subnet-1abcd1234efgh5678"
]
},
EnableSso: true
});

Configure a MicrosoftAD with additional settings such as alias creation and a specific edition.

const advancedMicrosoftAd = await AWS.DirectoryService.MicrosoftAD("advancedMicrosoftAd", {
Name: "mycompany.com",
Password: "AnotherStrongPassword456!",
VpcSettings: {
VpcId: "vpc-0abcd1234efgh5678",
SubnetIds: [
"subnet-0abcd1234efgh5678",
"subnet-1abcd1234efgh5678"
]
},
CreateAlias: true,
Edition: "Enterprise" // Options: "Standard", "Enterprise"
});

If you have an existing directory that you want to adopt, you can use the adopt property.

const adoptedMicrosoftAd = await AWS.DirectoryService.MicrosoftAD("adoptedMicrosoftAd", {
Name: "existingcompany.com",
Password: "SecurePassword789!",
VpcSettings: {
VpcId: "vpc-0abcd1234efgh5678",
SubnetIds: [
"subnet-0abcd1234efgh5678",
"subnet-1abcd1234efgh5678"
]
},
adopt: true
});