From e0f3ea1d0a3b5dbb1289672c23328c6ae9f7e178 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Wed, 1 May 2024 15:46:10 -0400 Subject: [PATCH 1/4] only deployer for env_type --- internal/provider/resource_environment_type_user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/resource_environment_type_user.go b/internal/provider/resource_environment_type_user.go index 8ccf98d..6ecdbbd 100644 --- a/internal/provider/resource_environment_type_user.go +++ b/internal/provider/resource_environment_type_user.go @@ -79,7 +79,7 @@ func (r *ResourceEnvironmentTypeUser) Schema(ctx context.Context, req resource.S }, }, "role": schema.StringAttribute{ - MarkdownDescription: "The role that this user holds. Could be `developer` (default) or `owner`.", + MarkdownDescription: "The role that this user holds. At this time, only `deployer` is supported.", Required: true, }, "timeouts": timeouts.Attributes(ctx, timeouts.Opts{ From 76b54daa0a105cc684e8b3ce3b9928389d28ddfd Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Wed, 1 May 2024 15:48:04 -0400 Subject: [PATCH 2/4] only deployer for env_type --- docs/resources/environment_type_user.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/resources/environment_type_user.md b/docs/resources/environment_type_user.md index 741af2c..9a8a5da 100644 --- a/docs/resources/environment_type_user.md +++ b/docs/resources/environment_type_user.md @@ -26,7 +26,7 @@ resource "humanitec_environment_type_user" "another_deployer" { ### Required - `env_type_id` (String) The Environment Type. -- `role` (String) The role that this user holds. Could be `developer` (default) or `owner`. +- `role` (String) The role that this user holds. At this time, only `deployer` is supported. - `user_id` (String) The user ID that hold the role ### Optional From e2277d782853a79971ea7d0f91df33c298ed2cc1 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Wed, 1 May 2024 15:54:39 -0400 Subject: [PATCH 3/4] Fix member role formatting in docs --- docs/resources/user.md | 2 +- internal/provider/resource_user.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/resources/user.md b/docs/resources/user.md index 88b141a..5e82cf5 100644 --- a/docs/resources/user.md +++ b/docs/resources/user.md @@ -18,7 +18,7 @@ An entity or individual who has access to the Humanitec platform. ### Required - `name` (String) The name the user goes by. -- `role` (String) The role that the service user should have on the organization it is created in. Could be member`, `artefactContributor`, `manager` or `administrator`. +- `role` (String) The role that the service user should have on the organization it is created in. Could be `member`, `artefactContributor`, `manager` or `administrator`. - `type` (String) The type of the account. Could be `user`, `service` or `system`. ### Optional diff --git a/internal/provider/resource_user.go b/internal/provider/resource_user.go index 6f13495..01efa5f 100644 --- a/internal/provider/resource_user.go +++ b/internal/provider/resource_user.go @@ -58,7 +58,7 @@ func (r *ResourceUser) Schema(ctx context.Context, req resource.SchemaRequest, r }, }, "role": schema.StringAttribute{ - MarkdownDescription: "The role that the service user should have on the organization it is created in. Could be member`, `artefactContributor`, `manager` or `administrator`.", + MarkdownDescription: "The role that the service user should have on the organization it is created in. Could be `member`, `artefactContributor`, `manager` or `administrator`.", Required: true, }, "type": schema.StringAttribute{ From b65eb5672b99ad069a900a26344d40607f4e0af5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20W=C3=BCrbach?= Date: Sat, 4 May 2024 11:26:59 +0200 Subject: [PATCH 4/4] chore: fix e2e tests and bump deps --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- .../resource_definition_resource_test.go | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 5f58a79..f341cfc 100644 --- a/go.mod +++ b/go.mod @@ -5,14 +5,14 @@ go 1.22 toolchain go1.22.0 require ( - github.com/hashicorp/terraform-plugin-docs v0.19.0 - github.com/hashicorp/terraform-plugin-framework v1.7.0 + github.com/hashicorp/terraform-plugin-docs v0.19.2 + github.com/hashicorp/terraform-plugin-framework v1.8.0 github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1 github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 - github.com/hashicorp/terraform-plugin-go v0.22.1 + github.com/hashicorp/terraform-plugin-go v0.22.2 github.com/hashicorp/terraform-plugin-log v0.9.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 - github.com/humanitec/humanitec-go-autogen v0.0.0-20240409130502-cfb171fe9dc4 + github.com/humanitec/humanitec-go-autogen v0.0.0-20240429100802-283cee98d746 github.com/stretchr/testify v1.9.0 ) diff --git a/go.sum b/go.sum index a092829..c3dcc13 100644 --- a/go.sum +++ b/go.sum @@ -102,16 +102,16 @@ github.com/hashicorp/terraform-exec v0.20.0 h1:DIZnPsqzPGuUnq6cH8jWcPunBfY+C+M8J github.com/hashicorp/terraform-exec v0.20.0/go.mod h1:ckKGkJWbsNqFKV1itgMnE0hY9IYf1HoiekpuN0eWoDw= github.com/hashicorp/terraform-json v0.21.0 h1:9NQxbLNqPbEMze+S6+YluEdXgJmhQykRyRNd+zTI05U= github.com/hashicorp/terraform-json v0.21.0/go.mod h1:qdeBs11ovMzo5puhrRibdD6d2Dq6TyE/28JiU4tIQxk= -github.com/hashicorp/terraform-plugin-docs v0.19.0 h1:ufXLte5Kx20LazYmGN2UZG2bN4aF0PmlDyuS1iKWSXo= -github.com/hashicorp/terraform-plugin-docs v0.19.0/go.mod h1:NPfKCSfzTtq+YCFHr2qTAMknWUxR8C4KgTbGkHULSV8= -github.com/hashicorp/terraform-plugin-framework v1.7.0 h1:wOULbVmfONnJo9iq7/q+iBOBJul5vRovaYJIu2cY/Pw= -github.com/hashicorp/terraform-plugin-framework v1.7.0/go.mod h1:jY9Id+3KbZ17OMpulgnWLSfwxNVYSoYBQFTgsx044CI= +github.com/hashicorp/terraform-plugin-docs v0.19.2 h1:YjdKa1vuqt9EnPYkkrv9HnGZz175HhSJ7Vsn8yZeWus= +github.com/hashicorp/terraform-plugin-docs v0.19.2/go.mod h1:gad2aP6uObFKhgNE8DR9nsEuEQnibp7il0jZYYOunWY= +github.com/hashicorp/terraform-plugin-framework v1.8.0 h1:P07qy8RKLcoBkCrY2RHJer5AEvJnDuXomBgou6fD8kI= +github.com/hashicorp/terraform-plugin-framework v1.8.0/go.mod h1:/CpTukO88PcL/62noU7cuyaSJ4Rsim+A/pa+3rUVufY= github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1 h1:gm5b1kHgFFhaKFhm4h2TgvMUlNzFAtUqlcOWnWPm+9E= github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1/go.mod h1:MsjL1sQ9L7wGwzJ5RjcI6FzEMdyoBnw+XK8ZnOvQOLY= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 h1:HOjBuMbOEzl7snOdOoUfE2Jgeto6JOjLVQ39Ls2nksc= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0/go.mod h1:jfHGE/gzjxYz6XoUwi/aYiiKrJDeutQNUtGQXkaHklg= -github.com/hashicorp/terraform-plugin-go v0.22.1 h1:iTS7WHNVrn7uhe3cojtvWWn83cm2Z6ryIUDTRO0EV7w= -github.com/hashicorp/terraform-plugin-go v0.22.1/go.mod h1:qrjnqRghvQ6KnDbB12XeZ4FluclYwptntoWCr9QaXTI= +github.com/hashicorp/terraform-plugin-go v0.22.2 h1:5o8uveu6eZUf5J7xGPV0eY0TPXg3qpmwX9sce03Bxnc= +github.com/hashicorp/terraform-plugin-go v0.22.2/go.mod h1:drq8Snexp9HsbFZddvyLHN6LuWHHndSQg+gV+FPkcIM= github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 h1:qHprzXy/As0rxedphECBEQAh3R4yp6pKksKHcqZx5G8= @@ -125,8 +125,8 @@ github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbg github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU= github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/humanitec/humanitec-go-autogen v0.0.0-20240409130502-cfb171fe9dc4 h1:5Axj0K5JH9YGaKohz8GqL+BcLLBwV5nn16l42p8PnMM= -github.com/humanitec/humanitec-go-autogen v0.0.0-20240409130502-cfb171fe9dc4/go.mod h1:WqItJ/MhAHcjP7LIhIt2/NrgXeXRbLuxvXlin7qY0j4= +github.com/humanitec/humanitec-go-autogen v0.0.0-20240429100802-283cee98d746 h1:im9qs2bH2xPz8zoCC/yUUrXqhN5wDVv/TbFgQZZD8MQ= +github.com/humanitec/humanitec-go-autogen v0.0.0-20240429100802-283cee98d746/go.mod h1:WqItJ/MhAHcjP7LIhIt2/NrgXeXRbLuxvXlin7qY0j4= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= diff --git a/internal/provider/resource_definition_resource_test.go b/internal/provider/resource_definition_resource_test.go index bcaac41..635740b 100644 --- a/internal/provider/resource_definition_resource_test.go +++ b/internal/provider/resource_definition_resource_test.go @@ -152,12 +152,12 @@ func TestAccResourceDefinition(t *testing.T) { }, resourceAttrNameIDValue: "s3-test-with-secrets", resourceAttrNameUpdateKey: "driver_inputs.secret_refs", - resourceAttrNameUpdateValue1: fmt.Sprintf("{\"aws_access_key_id\":{\"ref\":\"%s/aws_access_key_id/.value\",\"store\":\"humanitec\"},\"aws_secret_access_key\":{\"ref\":\"%s/aws_secret_access_key/.value\",\"store\":\"humanitec\"}}", getDefinitionSecretPath("s3-test-with-secrets"), getDefinitionSecretPath("s3-test-with-secrets")), + resourceAttrNameUpdateValue1: fmt.Sprintf("{\"aws_access_key_id\":{\"ref\":\"%s/aws_access_key_id/.value\",\"store\":\"humanitec\",\"version\":\"1\"},\"aws_secret_access_key\":{\"ref\":\"%s/aws_secret_access_key/.value\",\"store\":\"humanitec\",\"version\":\"1\"}}", getDefinitionSecretPath("s3-test-with-secrets"), getDefinitionSecretPath("s3-test-with-secrets")), resourceAttrName: "humanitec_resource_definition.s3_test_with_secrets", configUpdate: func() string { return testAccResourceDefinitionS3taticResourceWithSecrets("accessKeyId2", "secretAccessKey2") }, - resourceAttrNameUpdateValue2: fmt.Sprintf("{\"aws_access_key_id\":{\"ref\":\"%s/aws_access_key_id/.value\",\"store\":\"humanitec\"},\"aws_secret_access_key\":{\"ref\":\"%s/aws_secret_access_key/.value\",\"store\":\"humanitec\"}}", getDefinitionSecretPath("s3-test-with-secrets"), getDefinitionSecretPath("s3-test-with-secrets")), + resourceAttrNameUpdateValue2: fmt.Sprintf("{\"aws_access_key_id\":{\"ref\":\"%s/aws_access_key_id/.value\",\"store\":\"humanitec\",\"version\":\"2\"},\"aws_secret_access_key\":{\"ref\":\"%s/aws_secret_access_key/.value\",\"store\":\"humanitec\",\"version\":\"2\"}}", getDefinitionSecretPath("s3-test-with-secrets"), getDefinitionSecretPath("s3-test-with-secrets")), }, }