Hi everyone! Pulumi noob here. I have an existing ...
# general
j
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 gcpcompute/sSLCertificateSSLCertificate test_cert my_gcp_project/test_cert Any help appreciated. https://www.pulumi.com/registry/packages/gcp/api-docs/compute/sslcertificate/ Error:
Copy code
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
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
Hi, I'm using pulumi import from the gcp self managed cert instructions.
l
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
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?
Copy code
terraform import google_compute_ssl_certificate.default {{project}}/{{name}}
l
Not sure... maybe share the question over to #gcp? Someone with more specific knowledge might be able to help.
j
ok thanks for looking into it!