Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 98a428a

Browse files
authored
chore(jfrog-token): set token description (#198)
1 parent dd072e2 commit 98a428a

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

jfrog-token/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,26 @@ module "jfrog" {
8787
}
8888
```
8989

90+
### Add a custom token description
91+
92+
```tf
93+
data "coder_workspace" "me" {}
94+
95+
module "jfrog" {
96+
source = "registry.coder.com/modules/jfrog-token/coder"
97+
version = "1.0.5"
98+
agent_id = coder_agent.example.id
99+
jfrog_url = "https://XXXX.jfrog.io"
100+
artifactory_access_token = var.artifactory_access_token
101+
token_description = "Token for Coder workspace: ${data.coder_workspace.me.owner}/${data.coder_workspace.me.name}"
102+
package_managers = {
103+
"npm" : "npm",
104+
"go" : "go",
105+
"pypi" : "pypi"
106+
}
107+
}
108+
```
109+
90110
### Using the access token in other terraform resources
91111

92112
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).

jfrog-token/main.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ variable "artifactory_access_token" {
3434
description = "The admin-level access token to use for JFrog."
3535
}
3636

37+
variable "token_description" {
38+
type = string
39+
description = "Free text token description. Useful for filtering and managing tokens."
40+
default = "Token for Coder workspace"
41+
}
42+
3743
variable "check_license" {
3844
type = bool
3945
description = "Toggle for pre-flight checking of Artifactory license. Default to `true`."
@@ -107,6 +113,7 @@ resource "artifactory_scoped_token" "me" {
107113
scopes = ["applied-permissions/user"]
108114
refreshable = var.refreshable
109115
expires_in = var.expires_in
116+
description = var.token_description
110117
}
111118

112119
data "coder_workspace" "me" {}

0 commit comments

Comments
 (0)