https://pulumi.com logo
#google-cloud
Title
# google-cloud
a

aloof-leather-66267

10/03/2022, 3:21 AM
How can I import a
gcp:serviceAccount/key:Key
with the
serviceAccountId
? When I run
pulumi import
with the
name
and
id
, I get a warning that
serviceAccountId
is missing, even if I add it to the JSON file. I can still complete the import, but the state is created without the
serviceAccountId
, and if I add it to the code, Pulumi thinks it's a different resource and wants to replace the imported one.
Running
pulumi refresh
doesn't update anything.
f

fast-easter-23401

10/10/2022, 1:37 PM
I ran into the same problem a few months ago as I was migrating from terraform. I believe this is somehow related to the resource lifecycle: updates trigger a resource replacement, which makes sense given that
Key
resource contains sensitive data. Have you tried using aliases?
a

aloof-leather-66267

10/13/2022, 5:59 AM
TIL about aliases. I'll try that.