cuddly-jewelry-42389
12/31/2023, 2:28 PMreading Service Discovery test.svc.cluster.local Namespace (DNS_PRIVATE): couldn't find resource
during pulumi preview
. Because the call to getDnsNamespaceOutput
uses the output of new aws.servicediscovery.PrivateDnsNamespace
as input, I would've expected the code to work, because the call to the get method should only be executed after the resource has been created and its name is available.
Code:
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const vpc = new aws.ec2.Vpc("vpc");
const serviceDiscoveryDnsNamespace = new aws.servicediscovery.PrivateDnsNamespace("services", {
name: `test.svc.cluster.local`,
vpc: vpc.id
});
const serviceDiscoveryNamespace = aws.servicediscovery.getDnsNamespaceOutput({
name: serviceDiscoveryDnsNamespace.name,
type: "DNS_PRIVATE"
});
What am I missing here?dry-keyboard-94795
12/31/2023, 2:45 PMname: serviceDiscoveryDnsNamespace.id.apply(_ => serviceDiscoveryDnsNamespace.name),
cuddly-jewelry-42389
12/31/2023, 2:55 PMpulumi.Output<string>
dry-keyboard-94795
12/31/2023, 2:57 PMcuddly-jewelry-42389
12/31/2023, 2:59 PMbillowy-army-68599
getDnsNamespace
on a resource you just created?cuddly-jewelry-42389
12/31/2023, 3:35 PMbillowy-army-68599
cuddly-jewelry-42389
12/31/2023, 3:38 PMdry-keyboard-94795
12/31/2023, 3:39 PMcuddly-jewelry-42389
12/31/2023, 3:40 PMbillowy-army-68599
cuddly-jewelry-42389
12/31/2023, 3:44 PMdry-keyboard-94795
12/31/2023, 4:22 PMcuddly-jewelry-42389
12/31/2023, 4:47 PMdry-keyboard-94795
12/31/2023, 4:48 PM