https://pulumi.com logo
Title
f

fancy-egg-38667

12/21/2021, 8:46 PM
In Terraform there is a
data
type that I can use to refer to and verify external ( unmanaged ) resources Is there an equivalent in Pulumi?
g

green-stone-37839

12/21/2021, 8:51 PM
There is. Generally, this would be accomplished with a SDK such as the AWS SDK for node/go/python/csharp. You'd import that SDK into your Pulumi project and are free to use the full scope.
l

little-cartoon-10569

12/21/2021, 8:53 PM
All the resources have a
get
function that creates a read-only, unmanaged version of the resource.
And there are SDK wrappers in most modules.
For example, the AWS EC2 module has GetAmi, GetNetworkInterfaces, GetRoute, etc. https://www.pulumi.com/registry/packages/aws/api-docs/ec2/ (scroll half-way down the page).
g

green-stone-37839

12/21/2021, 8:55 PM
Yep, that's also a great solution. Generally, the more complex the lookup, the more likely you'll need to use an external SDK. Eg- if you have the AWS ARN/ID of the resource use the
get
functions.
f

fancy-egg-38667

12/21/2021, 9:02 PM
❤️ thanks!