02/28/2022, 9:30 AM
Hi, anyone trying out Pulumi with GCP data catalog? I've have troubles importing existing datacatalog entries but getting a reference using getEntry() works just fine. As an example, I have a pubsub topic created by pulumi that is automatically picked up by datacatalog. I can get a reference to that topic using getEnty resulting in:
get-o40-entry-export         : {
        integrated_system          : "CLOUD_PUBSUB"
        linked_resource            : "//"
        name                       : "projects/mathem-m-test/locations/global/entryGroups/@pubsub/entries/cHJvamVjdHMvbWF0aGVtLW0tdGVzdC90b3BpY3MvbzQwLXRvcGlj"
        source_system_timestamps   : {
            create_time: "2022-02-25T17:08:36.192Z"
            update_time: "2022-02-25T17:08:36.192Z"
        type                       : "DATA_STREAM"
Since that datacatalog entry already exists, I want to import it to Pulumi but then I get a response that the resource doesn't exist.
pulumi import google-native:datacatalog/v1:Entry o40-entry projects/mathem-m-test/locations/global/entryGroups/@pubsub/entries/cHJvamVjdHMvbWF0aGVtLW0tdGVzdC90b3BpY3MvbzQwLXRvcGlj

 Type                                   Name                Plan       Info
     pulumi:pulumi:Stack                    datapipelines-prod             1 error
 =   └─ google-native:datacatalog/v1:Entry  o40-entry           import     1 error
  google-native:datacatalog/v1:Entry (o40-entry):
    error: Preview failed: resource 'projects/mathem-m-test/locations/global/entryGroups/@pubsub/entries/cHJvamVjdHMvbWF0aGVtLW0tdGVzdC90b3BpY3MvbzQwLXRvcGlj' does not exist
Should I use a different resource name for the entry? The Entry resource seems to be referenced by a combination of an entry_group_id and an entry_id when using the getEntry function or when creating a custom Entry. Running gcloud data-catalog also returns that entry:
gcloud data-catalog entries describe cHJvamVjdHMvbWF0aGVtLW0tdGVzdC90b3BpY3MvbzQwLXRvcGlj --location=global --entry-group=@pubsub

integratedSystem: CLOUD_PUBSUB
linkedResource: //
name: projects/mathem-m-test/locations/global/entryGroups/@pubsub/entries/cHJvamVjdHMvbWF0aGVtLW0tdGVzdC90b3BpY3MvbzQwLXRvcGlj
  createTime: '2022-02-25T17:08:36.192Z'
  updateTime: '2022-02-25T17:08:36.192Z'


02/28/2022, 3:53 PM
Sorry for this one, but we don't support imports with google-native just yet as it's still in public preview (see the note in; that's why there's no import section in the API docs. Mainly the issue in these cases is the API discovery is still changing rapidly enough that development priority is on native creation rather than import. That being said, you can mix google native and google classic just fine, so I'd try importing with classic:
pulumi import gcp:datacatalog/entry:Entry o40-entry <name>
Generally, if there's an import section like this in the API docs, you can import it.


02/28/2022, 6:02 PM
Thanks @great-queen-39697