Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions jfrog-token/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,26 @@ module "jfrog" {
}
```

### Add a custom token description

```tf
data "coder_workspace" "me" {}

module "jfrog" {
source = "registry.coder.com/modules/jfrog-token/coder"
version = "1.0.5"
agent_id = coder_agent.example.id
jfrog_url = "https://XXXX.jfrog.io"
artifactory_access_token = var.artifactory_access_token
token_description = "Token for Coder workspace: ${data.coder_workspace.me.owner}/${data.coder_workspace.me.name}"
package_managers = {
"npm" : "npm",
"go" : "go",
"pypi" : "pypi"
}
}
```

### Using the access token in other terraform resources

JFrog Access token is also available as a terraform output. You can use it in other terraform resources. For example, you can use it to configure an [Artifactory docker registry](https://jfrog.com/help/r/jfrog-artifactory-documentation/docker-registry) with the [docker terraform provider](https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs).
Expand Down
7 changes: 7 additions & 0 deletions jfrog-token/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ variable "artifactory_access_token" {
description = "The admin-level access token to use for JFrog."
}

variable "token_description" {
type = string
description = "Free text token description. Useful for filtering and managing tokens."
default = "Token for Coder workspace"
}

variable "check_license" {
type = bool
description = "Toggle for pre-flight checking of Artifactory license. Default to `true`."
Expand Down Expand Up @@ -107,6 +113,7 @@ resource "artifactory_scoped_token" "me" {
scopes = ["applied-permissions/user"]
refreshable = var.refreshable
expires_in = var.expires_in
description = var.token_description
}

data "coder_workspace" "me" {}
Expand Down