Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: Add documentation details on role valid values and warning on application deletion #79

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/resources/application.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ resource "humanitec_application" "example" {

### Optional

- `env` (Attributes) Initial environment to create. Will be `development` by default. (see [below for nested schema](#nestedatt--env))
- `env` (Attributes) Initial environment to create. Will be `development` by default. **Warning**: Change `env` value after creation will force destroy this resource and his dependencies (include environments, values, webhook, workloads, etc.). (see [below for nested schema](#nestedatt--env))
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))

<a id="nestedatt--env"></a>
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/application_user.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ resource "humanitec_application_user" "another_owner" {
### Required

- `app_id` (String) The Application ID.
- `role` (String) The role that this user holds
- `role` (String) The role that this user holds. Could be `viewer`, `developer` or `owner`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs are auto-generated from markdown descriptions inside the code, could you update https://github.com/humanitec/terraform-provider-humanitec/blob/main/internal/provider/resource_application_user.go#L82 (and the other places you touched) and run go generate ./... afterwards?

- `user_id` (String) The user ID that hold the role

### Optional
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/environment_type_user.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
- `role` (String) The role that this user holds. Could be `developer` (default) or `owner`.
- `user_id` (String) The user ID that hold the role

### Optional
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ 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.
- `type` (String) The type of the account. Could be user, service or system.
- `role` (String) The role that the service user should have on the organization it is created in. Could be member`, `artefactcontributor`, `manager` or `administrator`.
mathieu-benoit marked this conversation as resolved.
Show resolved Hide resolved
- `type` (String) The type of the account. Could be `user`, `service` or `system`.

### Optional

Expand Down
2 changes: 1 addition & 1 deletion internal/provider/resource_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (r *ResourceApplication) Schema(ctx context.Context, req resource.SchemaReq
},
},
"env": schema.SingleNestedAttribute{
MarkdownDescription: "Initial environment to create. Will be `development` by default.",
MarkdownDescription: "Initial environment to create. Will be `development` by default. **Warning**: Change `env` value after creation will force destroy this resource and his dependencies (include environments, values, webhook, workloads, etc.).",
Optional: true,
PlanModifiers: []planmodifier.Object{
objectplanmodifier.RequiresReplace(),
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/resource_application_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (r *ResourceApplicationUser) Schema(ctx context.Context, req resource.Schem
},
},
"role": schema.StringAttribute{
MarkdownDescription: "The role that this user holds",
MarkdownDescription: "The role that this user holds. Could be `viewer`, `developer` or `owner`.",
Required: true,
},
"timeouts": timeouts.Attributes(ctx, timeouts.Opts{
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/resource_environment_type_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (r *ResourceEnvironmentTypeUser) Schema(ctx context.Context, req resource.S
},
},
"role": schema.StringAttribute{
MarkdownDescription: "The role that this user holds",
MarkdownDescription: "The role that this user holds. Could be `developer` (default) or `owner`.",
Required: true,
},
"timeouts": timeouts.Attributes(ctx, timeouts.Opts{
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/resource_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ 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.",
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{
MarkdownDescription: "The type of the account. Could be user, service or system.",
MarkdownDescription: "The type of the account. Could be `user`, `service` or `system`.",
Required: true,
Validators: []validator.String{
stringvalidator.OneOf("service"),
Expand Down