1. Packages
  2. Gitlab Provider
  3. API Docs
  4. getUserSshkeys
GitLab v8.10.0 published on Friday, Mar 21, 2025 by Pulumi

gitlab.getUserSshkeys

Explore with Pulumi AI

GitLab v8.10.0 published on Friday, Mar 21, 2025 by Pulumi

The gitlab.getUserSshkeys data source allows a list of SSH keys to be retrieved by either the user ID or username.

Upstream API: GitLab REST API docs

Using getUserSshkeys

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getUserSshkeys(args: GetUserSshkeysArgs, opts?: InvokeOptions): Promise<GetUserSshkeysResult>
function getUserSshkeysOutput(args: GetUserSshkeysOutputArgs, opts?: InvokeOptions): Output<GetUserSshkeysResult>
Copy
def get_user_sshkeys(user_id: Optional[int] = None,
                     username: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetUserSshkeysResult
def get_user_sshkeys_output(user_id: Optional[pulumi.Input[int]] = None,
                     username: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetUserSshkeysResult]
Copy
func GetUserSshkeys(ctx *Context, args *GetUserSshkeysArgs, opts ...InvokeOption) (*GetUserSshkeysResult, error)
func GetUserSshkeysOutput(ctx *Context, args *GetUserSshkeysOutputArgs, opts ...InvokeOption) GetUserSshkeysResultOutput
Copy

> Note: This function is named GetUserSshkeys in the Go SDK.

public static class GetUserSshkeys 
{
    public static Task<GetUserSshkeysResult> InvokeAsync(GetUserSshkeysArgs args, InvokeOptions? opts = null)
    public static Output<GetUserSshkeysResult> Invoke(GetUserSshkeysInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetUserSshkeysResult> getUserSshkeys(GetUserSshkeysArgs args, InvokeOptions options)
public static Output<GetUserSshkeysResult> getUserSshkeys(GetUserSshkeysArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gitlab:index/getUserSshkeys:getUserSshkeys
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

UserId int
ID of the user to get the SSH keys for.
Username string
Username of the user to get the SSH keys for.
UserId int
ID of the user to get the SSH keys for.
Username string
Username of the user to get the SSH keys for.
userId Integer
ID of the user to get the SSH keys for.
username String
Username of the user to get the SSH keys for.
userId number
ID of the user to get the SSH keys for.
username string
Username of the user to get the SSH keys for.
user_id int
ID of the user to get the SSH keys for.
username str
Username of the user to get the SSH keys for.
userId Number
ID of the user to get the SSH keys for.
username String
Username of the user to get the SSH keys for.

getUserSshkeys Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Keys List<Pulumi.GitLab.Outputs.GetUserSshkeysKey>
The user's keys.
UserId int
ID of the user to get the SSH keys for.
Username string
Username of the user to get the SSH keys for.
Id string
The provider-assigned unique ID for this managed resource.
Keys []GetUserSshkeysKey
The user's keys.
UserId int
ID of the user to get the SSH keys for.
Username string
Username of the user to get the SSH keys for.
id String
The provider-assigned unique ID for this managed resource.
keys List<GetUserSshkeysKey>
The user's keys.
userId Integer
ID of the user to get the SSH keys for.
username String
Username of the user to get the SSH keys for.
id string
The provider-assigned unique ID for this managed resource.
keys GetUserSshkeysKey[]
The user's keys.
userId number
ID of the user to get the SSH keys for.
username string
Username of the user to get the SSH keys for.
id str
The provider-assigned unique ID for this managed resource.
keys Sequence[GetUserSshkeysKey]
The user's keys.
user_id int
ID of the user to get the SSH keys for.
username str
Username of the user to get the SSH keys for.
id String
The provider-assigned unique ID for this managed resource.
keys List<Property Map>
The user's keys.
userId Number
ID of the user to get the SSH keys for.
username String
Username of the user to get the SSH keys for.

Supporting Types

GetUserSshkeysKey

CreatedAt This property is required. string
The time when this key was created in GitLab.
ExpiresAt This property is required. string
The expiration date of the SSH key in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ)
Key This property is required. string
The ssh key. The SSH key comment (trailing part) is optional and ignored for diffing, because GitLab overrides it with the username and GitLab hostname.
KeyId This property is required. int
The ID of the ssh key.
Title This property is required. string
The title of the ssh key.
UserId This property is required. int
The ID or username of the user. If this field is omitted, this resource manages a SSH key for the current user. Otherwise, this resource manages a SSH key for the specified user, and an admin token is required.
CreatedAt This property is required. string
The time when this key was created in GitLab.
ExpiresAt This property is required. string
The expiration date of the SSH key in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ)
Key This property is required. string
The ssh key. The SSH key comment (trailing part) is optional and ignored for diffing, because GitLab overrides it with the username and GitLab hostname.
KeyId This property is required. int
The ID of the ssh key.
Title This property is required. string
The title of the ssh key.
UserId This property is required. int
The ID or username of the user. If this field is omitted, this resource manages a SSH key for the current user. Otherwise, this resource manages a SSH key for the specified user, and an admin token is required.
createdAt This property is required. String
The time when this key was created in GitLab.
expiresAt This property is required. String
The expiration date of the SSH key in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ)
key This property is required. String
The ssh key. The SSH key comment (trailing part) is optional and ignored for diffing, because GitLab overrides it with the username and GitLab hostname.
keyId This property is required. Integer
The ID of the ssh key.
title This property is required. String
The title of the ssh key.
userId This property is required. Integer
The ID or username of the user. If this field is omitted, this resource manages a SSH key for the current user. Otherwise, this resource manages a SSH key for the specified user, and an admin token is required.
createdAt This property is required. string
The time when this key was created in GitLab.
expiresAt This property is required. string
The expiration date of the SSH key in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ)
key This property is required. string
The ssh key. The SSH key comment (trailing part) is optional and ignored for diffing, because GitLab overrides it with the username and GitLab hostname.
keyId This property is required. number
The ID of the ssh key.
title This property is required. string
The title of the ssh key.
userId This property is required. number
The ID or username of the user. If this field is omitted, this resource manages a SSH key for the current user. Otherwise, this resource manages a SSH key for the specified user, and an admin token is required.
created_at This property is required. str
The time when this key was created in GitLab.
expires_at This property is required. str
The expiration date of the SSH key in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ)
key This property is required. str
The ssh key. The SSH key comment (trailing part) is optional and ignored for diffing, because GitLab overrides it with the username and GitLab hostname.
key_id This property is required. int
The ID of the ssh key.
title This property is required. str
The title of the ssh key.
user_id This property is required. int
The ID or username of the user. If this field is omitted, this resource manages a SSH key for the current user. Otherwise, this resource manages a SSH key for the specified user, and an admin token is required.
createdAt This property is required. String
The time when this key was created in GitLab.
expiresAt This property is required. String
The expiration date of the SSH key in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ)
key This property is required. String
The ssh key. The SSH key comment (trailing part) is optional and ignored for diffing, because GitLab overrides it with the username and GitLab hostname.
keyId This property is required. Number
The ID of the ssh key.
title This property is required. String
The title of the ssh key.
userId This property is required. Number
The ID or username of the user. If this field is omitted, this resource manages a SSH key for the current user. Otherwise, this resource manages a SSH key for the specified user, and an admin token is required.

Package Details

Repository
GitLab pulumi/pulumi-gitlab
License
Apache-2.0
Notes
This Pulumi package is based on the gitlab Terraform Provider.
GitLab v8.10.0 published on Friday, Mar 21, 2025 by Pulumi