internal MadStack(Construct scope, string id, Vpc vpc, string domainName, string edition, SecretStack secret, IStackProps props = null) : base(scope, id, props) { AD = new CfnMicrosoftAD(this, "MAD", new CfnMicrosoftADProps { VpcSettings = new CfnMicrosoftAD.VpcSettingsProperty { SubnetIds = vpc.SelectSubnets(new SubnetSelection { SubnetType = SubnetType.PRIVATE }).SubnetIds, VpcId = vpc.VpcId }, Name = domainName, Password = secret.ClearTextSecret, Edition = edition }); var mad_dns_ip1 = Fn.Select(0, AD.AttrDnsIpAddresses); var mad_dns_ip2 = Fn.Select(1, AD.AttrDnsIpAddresses); new CfnOutput(this, "mad-dns1", new CfnOutputProps { Value = mad_dns_ip1, ExportName = "mad-dns1" }); new CfnOutput(this, "mad-dns2", new CfnOutputProps { Value = mad_dns_ip2, ExportName = "mad-dns2" }); }
internal DHCPOption(Construct scope, string id, CfnMicrosoftAD directory, Vpc vpc, IStackProps props = null) : base(scope, id, props) { DhcpOptions = new CfnDHCPOptions(this, id, new CfnDHCPOptionsProps { DomainName = directory.Name, DomainNameServers = new string[] { Fn.ImportValue("mad-dns1"), Fn.ImportValue("mad-dns2") }, NtpServers = new[] { "169.254.169.123" } }); }