- VPCにDHCP Options Setを作成
- Domain Name, Domain name serversを設定
- VPCに適用
- EC2起動時、User Dataに下記を設定
<powershell>
$password = ConvertTo-SecureString -AsPlainText -Force "Password"
$credential = New-Object System.Management.Automation.PSCredential "Administrator",$password
Add-Computer -DomainName mydomain.org -OUPath "OU=myOU,DC=mydomain,DC=org" -Credential $credential
</powershell>