docs: clarify example usage
@@ -8,6 +8,7 @@ state](https://www.terraform.io/docs/state/sensitive-data.html).
## Example Usages
### Create a new Artifactory Access Token for an existing user
+
```hcl
resource "artifactory_access_token" "exising_user" {
username = "existing-user"
@@ -15,10 +16,30 @@ resource "artifactory_access_token" "exising_user" {
}
```
-### Creates a new token for groups
+Note: This assumes that the user `existing-user` has already been created in Artifactory by different means, i.e. manually or in a separate terraform apply.
+
+### Create a new Artifactory User and Access token
```hcl
+resource "artifactory_user" "new_user" {
+ name = "new_user"
+ email = "new_user@somewhere.com"
+
+ groups = [
+ "readers",
+ ]
+}
+
resource "artifactory_access_token" "new_user" {
- username = "new-user"
+ username = artifactory_user.new_user.name
+ end_date_relative = "5m"
+}
+```
+
+### Creates a new token for groups
+This creates a transient user called `temporary-user`.
+```hcl
+resource "artifactory_access_token" "temporary_user" {
+ username = "temporary-user"
end_date_relative = "1h"
groups = [
