modern-zebra-45309
08/20/2024, 10:47 AMget_eips
allows you to fetch a list of IPs based on conditions/tags/filters, while Eip.get()
is used to fetch one specific IP by ID.
Also note that the get()
method is common across Pulumi resources while get_eips()
is a specialized utility function that only exists for Elastic IPs.brave-cartoon-40872
08/20/2024, 3:53 PMget()
also creates a Pulumi resource in my stack which get_eips()
does not do. For data sources, why would I want a Pulumi resource in my stack?modern-zebra-45309
08/20/2024, 4:04 PM.get()
methods are there to have a resource in the stack without controlling the resource in the stack. For example, you could have the user provide an externally managed EIP, or you create one yourself. The downstream code can be the same in both cases. With the resource in the stack, you can track and inspect changes, just as you would with a "regular" resource.