UserSshKeyArgs

data class UserSshKeyArgs(val expiresAt: Output<String>? = null, val key: Output<String>? = null, val title: Output<String>? = null, val userId: Output<Int>? = null) : ConvertibleToJava<UserSshKeyArgs>

The gitlab.UserSshKey resource allows to manage the lifecycle of an SSH key assigned to a user. Upstream API: GitLab API docs

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.GitlabFunctions;
import com.pulumi.gitlab.inputs.GetUserArgs;
import com.pulumi.gitlab.UserSshKey;
import com.pulumi.gitlab.UserSshKeyArgs;
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 exampleUser = GitlabFunctions.getUser(GetUserArgs.builder()
.username("example-user")
.build());
var exampleUserSshKey = new UserSshKey("exampleUserSshKey", UserSshKeyArgs.builder()
.userId(data.gitlab_user().id())
.title("example-key")
.key("ssh-rsa AAAA...")
.expiresAt("2016-01-21T00:00:00.000Z")
.build());
}
}

Import

You can import a user ssh key using an id made up of {user-id}:{key}, e.g.

$ pulumi import gitlab:index/userSshKey:UserSshKey example 42:1

Constructors

Link copied to clipboard
constructor(expiresAt: Output<String>? = null, key: Output<String>? = null, title: Output<String>? = null, userId: Output<Int>? = null)

Properties

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

The expiration date of the SSH key in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ)

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

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.

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

The title of the ssh key.

Link copied to clipboard
val userId: Output<Int>? = null

The ID or username of the user.

Functions

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