Once I import an existing resource, is it possible...
# general
f
Once I import an existing resource, is it possible to generate the equivalent typescript code for this resource's current state?
b
@fierce-engine-31599 In order to import, your state has to match the existing state anyway which means you have to have the code already written. Otherwise if you use the CLI, it provides the code. I only imported inline, not using the CLI, but if the docs say it, I'm sure its good
f
Oh I missed it. I'll look into the CLI. Thanks a lot
👍 1
Any reason why this would fail?
pulumi import gcp:container:Cluster k8s-cluster prod
Copy code
gcp:container:Cluster (k8s-cluster):
    error: Preview failed: unrecognized resource type (Read): gcp:container:Cluster
This seems like the right type but the logs claim otherwise
Managed to solve it. Thanks 🙂
b
tbh, I don't actually know where Pulumi gets its types, but this is an AWS type
Copy code
aws:s3/bucket:Bucket
ah ok great!
What were you missing?
f
gcpcontainer/clusterCluster Apparently this is the long form that should be used
b
Well found 🙂