Use this data source to get information about a SSH public key associated with the specified IAM user.
data "aws_iam_user_ssh_key" "example" {
encoding = "SSH"
ssh_public_key_id = "APKARUZ32GUTKIGARLXE"
username = "test-user"
}
encoding
- (Required) 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
.ssh_public_key_id
- (Required) Unique identifier for the SSH public key.username
- (Required) Name of the IAM user associated with the SSH public key.This data source exports the following attributes in addition to the arguments above:
fingerprint
- MD5 message digest of the SSH public key.public_key
- SSH public key.status
- 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.