Class SshKey
Uploads an SSH public key and associates it with the specified IAM user.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var userUser = new Aws.Iam.User("userUser", new Aws.Iam.UserArgs
{
Path = "/",
});
var userSshKey = new Aws.Iam.SshKey("userSshKey", new Aws.Iam.SshKeyArgs
{
Encoding = "SSH",
PublicKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 mytest@mydomain.com",
Username = userUser.Name,
});
}
}
Inherited Members
Namespace: Pulumi.Aws.Iam
Assembly: Pulumi.Aws.dll
Syntax
public class SshKey : CustomResource
Constructors
View SourceSshKey(String, SshKeyArgs, CustomResourceOptions)
Create a SshKey resource with the given unique name, arguments, and options.
Declaration
public SshKey(string name, SshKeyArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| SshKeyArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceEncoding
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.
Declaration
public Output<string> Encoding { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Fingerprint
The MD5 message digest of the SSH public key.
Declaration
public Output<string> Fingerprint { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
PublicKey
The SSH public key. The public key must be encoded in ssh-rsa format or PEM format.
Declaration
public Output<string> PublicKey { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SshPublicKeyId
The unique identifier for the SSH public key.
Declaration
public Output<string> SshPublicKeyId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Status
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.
Declaration
public Output<string> Status { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Username
The name of the IAM user to associate the SSH public key with.
Declaration
public Output<string> Username { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, SshKeyState, CustomResourceOptions)
Get an existing SshKey resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static SshKey Get(string name, Input<string> id, SshKeyState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| SshKeyState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| SshKey |