Skip to main content

ssh_keys

Creates, updates, deletes, gets or lists a ssh_keys resource.

Overview

Namessh_keys
TypeResource
Idgoogle.baremetalsolution.ssh_keys

Fields

NameDatatypeDescription
namestringOutput only. The name of this SSH key. Currently, the only valid value for the location is "global".
publicKeystringThe public SSH key. This must be in OpenSSH .authorized_keys format.

Methods

NameAccessible byRequired ParamsDescription
listSELECTlocationsId, projectsIdLists the public SSH keys registered for the specified project. These SSH keys are used only for the interactive serial console feature.
createINSERTlocationsId, projectsIdRegister a public SSH key in the specified project for use with the interactive serial console feature.
deleteDELETElocationsId, projectsId, sshKeysIdDeletes a public SSH key registered in the specified project.

SELECT examples

Lists the public SSH keys registered for the specified project. These SSH keys are used only for the interactive serial console feature.

SELECT
name,
publicKey
FROM google.baremetalsolution.ssh_keys
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new ssh_keys resource.

/*+ create */
INSERT INTO google.baremetalsolution.ssh_keys (
locationsId,
projectsId,
publicKey
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ publicKey }}'
;

DELETE example

Deletes the specified ssh_keys resource.

/*+ delete */
DELETE FROM google.baremetalsolution.ssh_keys
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND sshKeysId = '{{ sshKeysId }}';