ModifyInstanceKeypair
GET /?Action=ModifyInstanceKeypair
Description
Modifies the keypair associated with a specified instance.
This action only updates the public key reported by the metadata of the instance. To complete the replacement, you need to manually replace the old public key with the new public key in the ~/.ssh/authorized_keys file located inside the instance. You then need to restart the instance to apply the change.
You can also use this action to assign a keypair to an instance for which you did not initially specify a keypair.
Body parameter
Required: false
Name: ModifyInstanceKeypairRequest
Name | Description | Required | Schema | Default | Example |
---|---|---|---|---|---|
InstanceId |
The ID of the instance. |
true |
string |
||
KeyName |
The name of the keypair. |
true |
string |
Responses
HTTP Code 200
HTTP Code | Description | Schema |
---|---|---|
200 |
ModifyInstanceKeypair |
Response 200
Name | Description | Required | Schema | Default | Example |
---|---|---|---|---|---|
requestId |
The ID of the request. |
false |
string |