SshKey

class SshKey : KotlinCustomResource

Uploads an SSH public key and associates it with the specified IAM user.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.User;
import com.pulumi.aws.iam.UserArgs;
import com.pulumi.aws.iam.SshKey;
import com.pulumi.aws.iam.SshKeyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var userUser = new User("userUser", UserArgs.builder()
.path("/")
.build());
var userSshKey = new SshKey("userSshKey", SshKeyArgs.builder()
.username(userUser.name())
.encoding("SSH")
.publicKey("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 mytest@mydomain.com")
.build());
}
}

Import

SSH public keys can be imported using the username, ssh_public_key_id, and encoding e.g.,

$ pulumi import aws:iam/sshKey:SshKey user user:APKAJNCNNJICVN7CFKCA:SSH

Properties

Link copied to clipboard
val encoding: Output<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.

Link copied to clipboard
val fingerprint: Output<String>

The MD5 message digest of the SSH public key.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val publicKey: Output<String>

The SSH public key. The public key must be encoded in ssh-rsa format or PEM format.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val sshPublicKeyId: Output<String>

The unique identifier for the SSH public key.

Link copied to clipboard
val status: Output<String>

The status to assign to the SSH public key. Active means the key can be used for authentication with an AWS CodeCommit repository. Inactive means the key cannot be used. Default is active.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val username: Output<String>

The name of the IAM user to associate the SSH public key with.