get User Ssh Key
Use this data source to get information about a SSH public key associated with the specified IAM user.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.iam.getUserSshKey({
encoding: "SSH",
sshPublicKeyId: "APKARUZ32GUTKIGARLXE",
username: "test-user",
});
Content copied to clipboard
import pulumi
import pulumi_aws as aws
example = aws.iam.get_user_ssh_key(encoding="SSH",
ssh_public_key_id="APKARUZ32GUTKIGARLXE",
username="test-user")
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = Aws.Iam.GetUserSshKey.Invoke(new()
{
Encoding = "SSH",
SshPublicKeyId = "APKARUZ32GUTKIGARLXE",
Username = "test-user",
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := iam.GetUserSshKey(ctx, &iam.GetUserSshKeyArgs{
Encoding: "SSH",
SshPublicKeyId: "APKARUZ32GUTKIGARLXE",
Username: "test-user",
}, nil)
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetUserSshKeyArgs;
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) {
final var example = IamFunctions.getUserSshKey(GetUserSshKeyArgs.builder()
.encoding("SSH")
.sshPublicKeyId("APKARUZ32GUTKIGARLXE")
.username("test-user")
.build());
}
}
Content copied to clipboard
variables:
example:
fn::invoke:
function: aws:iam:getUserSshKey
arguments:
encoding: SSH
sshPublicKeyId: APKARUZ32GUTKIGARLXE
username: test-user
Content copied to clipboard
Return
A collection of values returned by getUserSshKey.
Parameters
argument
A collection of arguments for invoking getUserSshKey.
suspend fun getUserSshKey(encoding: String, sshPublicKeyId: String, username: String): GetUserSshKeyResult
Return
A collection of values returned by getUserSshKey.
Parameters
encoding
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
Unique identifier for the SSH public key.
username
Name of the IAM user associated with the SSH public key.
See also
suspend fun getUserSshKey(argument: suspend GetUserSshKeyPlainArgsBuilder.() -> Unit): GetUserSshKeyResult
Return
A collection of values returned by getUserSshKey.
Parameters
argument
Builder for com.pulumi.aws.iam.kotlin.inputs.GetUserSshKeyPlainArgs.