SshKeyArgs

data class SshKeyArgs(val encoding: Output<String>? = null, val publicKey: Output<String>? = null, val status: Output<String>? = null, val username: Output<String>? = null) : ConvertibleToJava<SshKeyArgs>

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

Constructors

Link copied to clipboard
constructor(encoding: Output<String>? = null, publicKey: Output<String>? = null, status: Output<String>? = null, username: Output<String>? = null)

Properties

Link copied to clipboard
val encoding: Output<String>? = null

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 publicKey: Output<String>? = null

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

Link copied to clipboard
val status: Output<String>? = null

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 username: Output<String>? = null

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

Functions

Link copied to clipboard
open override fun toJava(): SshKeyArgs