From 0a8dabf2a2468ac75f2fac776f61df705e30f5c2 Mon Sep 17 00:00:00 2001 From: Shawn S <30486892+YakShavingCatHerder@users.noreply.github.com> Date: Thu, 9 Sep 2021 16:36:15 -0700 Subject: [PATCH 1/2] Update arguments for `codefresh_api_key` resource `user_id` is a required parameter to use this resource; considering the diffs between on-prem & SaaS, I didn't feel the need to complicate the examples anymore by adding data call for user, but that is important. It should probably be noted that the majority of the [currently documented resources|https://registry.terraform.io/providers/codefresh-io/codefresh/latest/docs/resources/user] do not play well with self-hosted deployments. I'm testing getting this resource working with a self-hosted deployment and will update as needed if I'm able to get a working model going. --- docs/resources/api-key.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/resources/api-key.md b/docs/resources/api-key.md index 0417f5b9..c17ebf99 100644 --- a/docs/resources/api-key.md +++ b/docs/resources/api-key.md @@ -23,7 +23,7 @@ resource "random_string" "random" { resource "codefresh_api_key" "new" { account_id = codefresh_account.test.id - + user_id = data.codefresh_account.test_account_user.user_id name = "tfkey_${random_string.random.result}" scopes = [ @@ -66,7 +66,8 @@ resource "codefresh_team" "team_1" { ## Argument Reference - `name` - (Required) The display name for the API key. -- `account_id` - (Required) The ID of account than should own the new API key. +- `account_id` - (Required) The ID of account in which the API key will be created. +- `user_id` - (Required) The ID of a user within the above account that will own the API key. - `scopes` - (Optional) A list of access scopes, that can be targeted. The possible values: - `agent` - `agents` From eae7f2d01118bfb8f9bf960e465c597c31e0c086 Mon Sep 17 00:00:00 2001 From: Shawn S Date: Sun, 12 Sep 2021 02:49:50 -0400 Subject: [PATCH 2/2] add clarity to user_id auth ownership --- docs/resources/api-key.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/resources/api-key.md b/docs/resources/api-key.md index c17ebf99..75d314d2 100644 --- a/docs/resources/api-key.md +++ b/docs/resources/api-key.md @@ -67,7 +67,7 @@ resource "codefresh_team" "team_1" { - `name` - (Required) The display name for the API key. - `account_id` - (Required) The ID of account in which the API key will be created. -- `user_id` - (Required) The ID of a user within the above account that will own the API key. +- `user_id` - (Required) The ID of a user within the referenced `account_id` that will own the API key. - `scopes` - (Optional) A list of access scopes, that can be targeted. The possible values: - `agent` - `agents`