ssh_public_keys
Creates, updates, deletes, gets or lists a ssh_public_keys resource.
Overview
| Name | ssh_public_keys |
| Type | Resource |
| Id | aws.iam.ssh_public_keys |
Fields
The following fields are returned by SELECT queries:
- get_ssh_public_key
- list_ssh_public_keys
| Name | Datatype | Description |
|---|---|---|
fingerprint | string | The MD5 message digest of the SSH public key. |
ssh_public_key_body | string | The SSH public key. |
ssh_public_key_id | string | The unique identifier for the SSH public key. |
status | string | The status of the SSH public key. Active means that the key can be used for authentication with an CodeCommit repository. Inactive means that the key cannot be used. |
upload_date | string | The date and time, in ISO 8601 date-time format, when the SSH public key was uploaded. |
user_name | string | The name of the IAM user associated with the SSH public key. |
| Name | Datatype | Description |
|---|---|---|
ssh_public_key_id | string | The unique identifier for the SSH public key. |
status | string | The status of the SSH public key. Active means that the key can be used for authentication with an CodeCommit repository. Inactive means that the key cannot be used. |
upload_date | string | The date and time, in ISO 8601 date-time format, when the SSH public key was uploaded. |
user_name | string | The name of the IAM user associated with the SSH public key. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_ssh_public_key | select | UserName, SSHPublicKeyId, Encoding, region | Retrieves the specified SSH public key, including metadata about the key. The SSH public key retrieved by this operation is used only for authenticating the associated IAM user to an CodeCommit repository. For more information about using SSH keys to authenticate to an CodeCommit repository, see Set up CodeCommit for SSH connections in the CodeCommit User Guide. | |
list_ssh_public_keys | select | region | UserName, Marker, MaxItems | Returns information about the SSH public keys associated with the specified IAM user. If none exists, the operation returns an empty list. The SSH public keys returned by this operation are used only for authenticating the IAM user to an CodeCommit repository. For more information about using SSH keys to authenticate to an CodeCommit repository, see Set up CodeCommit for SSH connections in the CodeCommit User Guide. Although each user is limited to a small number of keys, you can still paginate the results using the MaxItems and Marker parameters. |
update_ssh_public_key | update | UserName, SSHPublicKeyId, region | Status | Sets the status of an IAM user's SSH public key to active or inactive. SSH public keys that are inactive cannot be used for authentication. This operation can be used to disable a user's SSH public key as part of a key rotation work flow. The SSH public key affected by this operation is used only for authenticating the associated IAM user to an CodeCommit repository. For more information about using SSH keys to authenticate to an CodeCommit repository, see Set up CodeCommit for SSH connections in the CodeCommit User Guide. |
delete_ssh_public_key | delete | UserName, SSHPublicKeyId, region | Deletes the specified SSH public key. The SSH public key deleted by this operation is used only for authenticating the associated IAM user to an CodeCommit repository. For more information about using SSH keys to authenticate to an CodeCommit repository, see Set up CodeCommit for SSH connections in the CodeCommit User Guide. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
Encoding | string | Specifies the public key encoding format to use in the response. To retrieve the public key in ssh-rsa format, use SSH. To retrieve the public key in PEM format, use PEM. |
SSHPublicKeyId | string | The unique identifier for the SSH public key. This parameter allows (through its regex pattern) a string of characters that can consist of any upper or lowercased letter or digit. |
UserName | string | The name of the IAM user associated with the SSH public key. This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@- |
region | string | AWS region (default: us-east-1) |
Marker | string | Use this parameter only when paginating results and only after you receive a response indicating that the results are truncated. Set it to the value of the Marker element in the response that you received to indicate where the next call should start. |
MaxItems | integer | Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true. If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true, and Marker contains a value to include in the subsequent call that tells the service where to continue from. |
Status | string | The status to assign to the SSH public key. Active means that the key can be used for authentication with an CodeCommit repository. Inactive means that the key cannot be used. |
UserName | string | The name of the IAM user to list SSH public keys for. If none is specified, the UserName field is determined implicitly based on the Amazon Web Services access key used to sign the request. This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@- |
SELECT examples
- get_ssh_public_key
- list_ssh_public_keys
Retrieves the specified SSH public key, including metadata about the key. The SSH public key retrieved by this operation is used only for authenticating the associated IAM user to an CodeCommit repository. For more information about using SSH keys to authenticate to an CodeCommit repository, see Set up CodeCommit for SSH connections in the CodeCommit User Guide.
SELECT
fingerprint,
ssh_public_key_body,
ssh_public_key_id,
status,
upload_date,
user_name
FROM aws.iam.ssh_public_keys
WHERE UserName = '{{ UserName }}' -- required
AND SSHPublicKeyId = '{{ SSHPublicKeyId }}' -- required
AND Encoding = '{{ Encoding }}' -- required
AND region = '{{ region }}' -- required
;
Returns information about the SSH public keys associated with the specified IAM user. If none exists, the operation returns an empty list. The SSH public keys returned by this operation are used only for authenticating the IAM user to an CodeCommit repository. For more information about using SSH keys to authenticate to an CodeCommit repository, see Set up CodeCommit for SSH connections in the CodeCommit User Guide. Although each user is limited to a small number of keys, you can still paginate the results using the MaxItems and Marker parameters.
SELECT
ssh_public_key_id,
status,
upload_date,
user_name
FROM aws.iam.ssh_public_keys
WHERE region = '{{ region }}' -- required
AND UserName = '{{ UserName }}'
AND Marker = '{{ Marker }}'
AND MaxItems = '{{ MaxItems }}'
;
UPDATE examples
- update_ssh_public_key
Sets the status of an IAM user's SSH public key to active or inactive. SSH public keys that are inactive cannot be used for authentication. This operation can be used to disable a user's SSH public key as part of a key rotation work flow. The SSH public key affected by this operation is used only for authenticating the associated IAM user to an CodeCommit repository. For more information about using SSH keys to authenticate to an CodeCommit repository, see Set up CodeCommit for SSH connections in the CodeCommit User Guide.
UPDATE aws.iam.ssh_public_keys
SET
-- No updatable properties
WHERE
UserName = '{{ UserName }}' --required
AND SSHPublicKeyId = '{{ SSHPublicKeyId }}' --required
AND region = '{{ region }}' --required
AND Status = '{{ Status}}';
DELETE examples
- delete_ssh_public_key
Deletes the specified SSH public key. The SSH public key deleted by this operation is used only for authenticating the associated IAM user to an CodeCommit repository. For more information about using SSH keys to authenticate to an CodeCommit repository, see Set up CodeCommit for SSH connections in the CodeCommit User Guide.
DELETE FROM aws.iam.ssh_public_keys
WHERE UserName = '{{ UserName }}' --required
AND SSHPublicKeyId = '{{ SSHPublicKeyId }}' --required
AND region = '{{ region }}' --required
;