https://pulumi.com logo
Title
j

jolly-addition-88642

10/18/2022, 9:39 PM
Hi everyone! Pulumi noob here. I have an existing cert in GCP and I'm trying to do an import of a self managed cert but I always get warnings about a missing private_key. I figure I am running the command incorrectly. Do I need to specify a private key file during the import? pulumi import gcp:compute/sSLCertificate:SSLCertificate test_cert my_gcp_project/test_cert Any help appreciated. https://www.pulumi.com/registry/packages/gcp/api-docs/compute/sslcertificate/ Error:
warning: One or more imported inputs failed to validate. This is almost certainly a bug in the `gcp` provider. The import will still proceed, but you will need to edit the generated code after copying it into your program.
    warning: gcp:compute/sSLCertificate:SSLCertificate resource 'test_cert' has a problem: Missing required argument: The argument "private_key" is required, but no definition was found.. Examine values at 'SSLCertificate.PrivateKey'.
l

little-cartoon-10569

10/18/2022, 9:47 PM
Yes. Are you usnig
pulumi import
, or
pulumi up
with the
import:
opt?
pulumi import
should generate that for you...
Though.. maybe not, I know in AWS, the service deliberately forgets about the private key. You have to retain that yourself.
j

jolly-addition-88642

10/18/2022, 9:52 PM
Hi, I'm using pulumi import from the gcp self managed cert instructions.
l

little-cartoon-10569

10/18/2022, 9:59 PM
And it's not generating code for the private key.. then I guess you need to provide it yourself. It's inconvenient, but it makes sense: there's probably no API that Pulumi can use to get the private key from GCP. That's what makes it private...
j

jolly-addition-88642

10/18/2022, 10:16 PM
It's odd though because when doing an import with terraform it works fine with just a reference to the existing certificate name in gcp. The private key and cert exist in gcp so I guess just a reference to the resource is enough?
terraform import google_compute_ssl_certificate.default {{project}}/{{name}}
l

little-cartoon-10569

10/18/2022, 10:24 PM
Not sure... maybe share the question over to #gcp? Someone with more specific knowledge might be able to help.
j

jolly-addition-88642

10/18/2022, 10:25 PM
ok thanks for looking into it!