pulumi / pulumi-cloud-import

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

Change AWS import to use Resource Explorer to generate AWS Classic resources #21

Open jkodroff opened 9 months ago

jkodroff commented 9 months ago

I believe the AWS Resource Explorer can be used to query resources: https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/resourceexplorer2

From messing around with Resource Explorer in the console and exporting results to CSV, it looks like most of the time there's a simple mapping from AWS type to Pulumi type in the AWS Classic provider, and it also looks like the ID is the same ID for import:

image

If I'm right, I think that would give us several advantages over the current approach:

  1. AWS maintains an index of all resources on its end (asynchronously updated, I'm guessing), so it should be faster than querying type-by-type (which is what I think the current code does?)
  2. We'd be returning AWS Classic resources instead of AWS Native. Since the former is more popular, this should deliver more value to the customer.