UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

129 lines (128 loc) 5.36 kB
import * as pulumi from "@pulumi/pulumi"; /** * Uploads an SSH public key and associates it with the specified IAM user. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const user = new aws.iam.User("user", { * name: "test-user", * path: "/", * }); * const userSshKey = new aws.iam.SshKey("user", { * username: user.name, * encoding: "SSH", * publicKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 mytest@mydomain.com", * }); * ``` * * ## Import * * Using `pulumi import`, import SSH public keys using the `username`, `ssh_public_key_id`, and `encoding`. For example: * * ```sh * $ pulumi import aws:iam/sshKey:SshKey user user:APKAJNCNNJICVN7CFKCA:SSH * ``` */ export declare class SshKey extends pulumi.CustomResource { /** * Get an existing SshKey resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: SshKeyState, opts?: pulumi.CustomResourceOptions): SshKey; /** * Returns true if the given object is an instance of SshKey. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is SshKey; /** * 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`. */ readonly encoding: pulumi.Output<string>; /** * The MD5 message digest of the SSH public key. */ readonly fingerprint: pulumi.Output<string>; /** * The SSH public key. The public key must be encoded in ssh-rsa format or PEM format. */ readonly publicKey: pulumi.Output<string>; /** * The unique identifier for the SSH public key. */ readonly sshPublicKeyId: pulumi.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`. */ readonly status: pulumi.Output<string>; /** * The name of the IAM user to associate the SSH public key with. */ readonly username: pulumi.Output<string>; /** * Create a SshKey resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: SshKeyArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering SshKey resources. */ export interface SshKeyState { /** * 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`. */ encoding?: pulumi.Input<string>; /** * The MD5 message digest of the SSH public key. */ fingerprint?: pulumi.Input<string>; /** * The SSH public key. The public key must be encoded in ssh-rsa format or PEM format. */ publicKey?: pulumi.Input<string>; /** * The unique identifier for the SSH public key. */ sshPublicKeyId?: pulumi.Input<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`. */ status?: pulumi.Input<string>; /** * The name of the IAM user to associate the SSH public key with. */ username?: pulumi.Input<string>; } /** * The set of arguments for constructing a SshKey resource. */ export interface SshKeyArgs { /** * 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`. */ encoding: pulumi.Input<string>; /** * The SSH public key. The public key must be encoded in ssh-rsa format or PEM format. */ publicKey: pulumi.Input<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`. */ status?: pulumi.Input<string>; /** * The name of the IAM user to associate the SSH public key with. */ username: pulumi.Input<string>; }