flaky-flower-13459
02/14/2021, 12:25 PMpulumi import aws:ec2/keyPair:KeyPair deployer deployer-key
as documented here: https://www.pulumi.com/docs/reference/pkg/aws/ec2/keypair/#import
but it fails with:
Diagnostics:
pulumi:pulumi:Stack (myproject_name-mystackname_dev):
error: preview failed
aws:ec2:KeyPair (dev_keypair):
error: aws:ec2/keyPair:KeyPair resource 'dev_keypair' has a problem: Required attribute is not set
error: Preview failed: one or more inputs failed to validate
pulumi -C .\pulumi\myproject\ -s mystackname_dev--provider provider-us-west-2=urn:pulumi:mystackname_dev::myproject::pulumi:providers:aws::provider-us-west-2 import aws:ec2/keyPair:KeyPair dev_keypair dev_keypair
little-cartoon-10569
02/14/2021, 7:49 PMpulumi import
, or update the code with the correct publicKey and add the import opt.flaky-flower-13459
02/15/2021, 9:32 AMimport: dev_keypair
to the pulumi options on the resource, but now it says my public-key is mis-matched with the resource that already exists in AWS,
Although I confirmed the saved (MD5) fingerprint in AWS console, matches exactly the same fingerprint I generated locally using the private\public key filesssh-rsa
form, do I need to convert it to -----BEGIN PUBLIC KEY-----
form?little-cartoon-10569
02/16/2021, 8:38 PMpulumi state delete <urn>
to delete the "wrong" keypair from the state. You should probably do that before adding the code you get from pulumi import
.