UserSshKey

class UserSshKey : KotlinCustomResource

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

Properties

Link copied to clipboard
val createdAt: Output<String>

The time when this key was created in GitLab.

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

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

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val key: Output<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.

Link copied to clipboard
val keyId: Output<Int>

The ID of the ssh key.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val title: Output<String>

The title of the ssh key.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val userId: Output<Int>

The ID or username of the user.