From 3b778d947bcd174de24ec7c0495c74474613a2e8 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 26 Sep 2023 15:46:22 +0300 Subject: [PATCH] cleanup --- jfrog/main.tf | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/jfrog/main.tf b/jfrog/main.tf index 5b0e7b6..5b0313d 100644 --- a/jfrog/main.tf +++ b/jfrog/main.tf @@ -28,6 +28,11 @@ provider "artifactory" { url = "https://${var.jfrog_host}/artifactory" access_token = var.artifactory_access_token } +resource "artifactory_scoped_token" "me" { + # This is hacky, but on terraform plan the data source gives empty strings, + # which fails validation. + username = length(local.artifactory_username) > 0 ? local.artifactory_username : "plan" +} variable "agent_id" { type = string @@ -46,19 +51,6 @@ For example: } EOF } - -# Configure the Artifactory provider -provider "artifactory" { - url = "https://${var.jfrog_host}/artifactory" - access_token = var.artifactory_access_token -} - -resource "artifactory_scoped_token" "me" { - # This is hacky, but on terraform plan the data source gives empty strings, - # which fails validation. - username = length(local.artifactory_username) > 0 ? local.artifactory_username : "plan" -} - resource "coder_script" "jfrog" { agent_id = var.agent_id display_name = "jfrog"