pulumi / pulumi-cloud-import

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

Resource import misses several (many?) AWS resource categories #22

Closed pgavlin closed 1 month ago

pgavlin commented 1 month ago

Determining the AWS CCAPI resource type from the C# namespace mapping is not reliable. This approach misses several resource categories, most notably EC2 (which the C# mappings case as Ec2). We need to fix this so we don't rely on those mappings and instead use a more reliable mechanism.

cleverguy25 commented 1 month ago

Added to epic https://github.com/pulumi/pulumi-service/issues/20861

pgavlin commented 1 month ago

I addressed this for a different tool using the was-native provider's resource metadata document: https://github.com/pulumi/pulumi-aws-native/blob/master/provider/cmd/pulumi-resource-aws-native/metadata.json

This document is a mapping from Pulumi type token to resource metadata. This metadata includes a cf field that contains the CF/CCAPI type. We can use this to generate a table that maps Pulumi type tokens to CF/CCAPI types.

Unfortunately this isn't available from the provider at runtime. Its mappings should be relatively static, though, so it is likely safe to pull it from the source repo at a particular version and then update it on a regular cadence.