Is there a way to get the dnsIpAddresses of a Micr...
# aws
Is there a way to get the dnsIpAddresses of a MicrosoftAD instance in the same run as it is being created? The Terraform module provides them on the DirectoryService resource, but the only thing in the Pulumi equivalent is its ID. If I
the ID, I can use getDirectory which returns the dnsIPAddresses, but I can't create a new resource from within an
. So I can't create my VpcDhcpOptions from those IP addresses 😞
Found it. The example code from the
function was a good start. This is passing tests:
Copy code
const dnsIpAddresses = (directoryId) => {
      const result = await aws.directoryservice.getDirectory({ directoryId: directoryId }, { async: true });
      return result.dnsIpAddresses;
(It's not deployed yet, so I might be back later for more help 🙂 )
I wonder if it's possible to have async dynamic properties in TypeScript... having that code in the
object would be handy..
is an output of
- You should be able to export/output this directly or use this as an input to other resources. So you should not need to use
after the fact. Is this not working for you?
I don't think so. I'm having a lot of issues with dnsIpAddress fields all over the place. I used this workaround because those fields weren't being populated. I can't use them in VpcDhcpOptions either, they're not even getting into that. If I pass the the dnsIpAddresses returned as outputs (that I can see in my test breakpoints) into VpcDhcpOptions
input args, they're not there when I break in
with type = "awsec2/vpcDhcpOptionsVpcDhcpOptions". The other args fields are there, like
, but the 3 servers fields are gone.
I'll review my test code, I'm actively working on it right now. Maybe I've missed something fundamental...
I've got dnsIpAddresses working in my test stub code.. I'd tied myself into so many little knots...
Thanks for pointing out the output property, that was a basic mistake on my part.
Plus the issue is when I run with Mocha CLI. It's actually all good with Pulumi...