pulumi / pulumi-cloud-import

Import infrastructure managed outside of Pulumi IaC into Pulumi Insights
Apache License 2.0
9 stars 2 forks source link

Create utilities that can be shared between import programs #16

Open EvanBoyle opened 1 year ago

EvanBoyle commented 1 year ago

Each import program roughly does the same thing:

  1. iterates through a cloud provider's list API, typically with some concurrency (ie carve up resource types into N buckets and start N workers)
  2. whenever a resource is encountered, it is converted to an import spec and piped into a channel
  3. the channel listening for resources will call ctx.ReadResource, this can happen in parallel to the workers that are listing resources

In addition, there we have issues open for some functionality that would be shared across all import programs:

Kind of makes me wonder if having some shared utility that each import program utilized would:

  1. make it easier to maintain all of these and provide a uniform set of functionality
  2. speed up the process of adding a new import program (and enable easier community contributions)
  3. enable writing a mock importer that we could use to write tests over core functionality like #8 and #9.