https://pulumi.com logo
Title
f

fierce-engine-31599

11/02/2021, 7:36 AM
Once I import an existing resource, is it possible to generate the equivalent typescript code for this resource's current state?
b

brave-nightfall-19158

11/02/2021, 8:51 AM
@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

fierce-engine-31599

11/02/2021, 9:04 AM
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
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

brave-nightfall-19158

11/02/2021, 10:05 AM
tbh, I don't actually know where Pulumi gets its types, but this is an AWS type
aws:s3/bucket:Bucket
ah ok great!
What were you missing?
f

fierce-engine-31599

11/02/2021, 10:34 AM
gcp:container/cluster:Cluster Apparently this is the long form that should be used
b

brave-nightfall-19158

11/02/2021, 10:40 AM
Well found 🙂