Update documentation (#298)

* Update documentation

* Update stackit/internal/services/redis/credential/resource.go

Co-authored-by: João Palet <joao.palet@outlook.com>

* Add more info

* Update datasource

---------

Co-authored-by: João Palet <joao.palet@outlook.com>
This commit is contained in:
Vicente Pinto 2024-03-11 15:55:05 +00:00 committed by GitHub
parent 3ea0f81900
commit b79c88e858
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 15 additions and 9 deletions

View file

@ -38,5 +38,5 @@ data "stackit_redis_credential" "example" {
- `name` (String)
- `password` (String, Sensitive)
- `port` (Number)
- `uri` (String)
- `uri` (String) Connection URI. Currently the returned uri doesn't support SSL, but you can enable it by using `rediss://` instead of `redis://`. We will provide the SSL connection in a future release
- `username` (String)

View file

@ -37,5 +37,5 @@ resource "stackit_redis_credential" "example" {
- `name` (String)
- `password` (String, Sensitive)
- `port` (Number)
- `uri` (String)
- `uri` (String) Connection URI. Currently the returned uri doesn't support SSL, but you can enable it by using `rediss://` instead of `redis://`. We will provide the SSL connection in a future release
- `username` (String)

View file

@ -3,12 +3,12 @@
page_title: "stackit_ske_project Resource - stackit"
subcategory: ""
description: |-
SKE project resource schema. Must have a region specified in the provider configuration.
SKE project resource schema. Must have a region specified in the provider configuration. This resource allows you to enable the SKE service and you can only have one per project. Deleting this resource will destroy any SKE clusters associated to the project
---
# stackit_ske_project (Resource)
SKE project resource schema. Must have a `region` specified in the provider configuration.
SKE project resource schema. Must have a `region` specified in the provider configuration. This resource allows you to enable the SKE service and you can only have one per project. Deleting this resource will destroy any SKE clusters associated to the project
## Example Usage

View file

@ -80,6 +80,7 @@ func (r *credentialDataSource) Schema(_ context.Context, _ datasource.SchemaRequ
"credential_id": "The credential's ID.",
"instance_id": "ID of the Redis instance.",
"project_id": "STACKIT project ID to which the instance is associated.",
"uri": "Connection URI. Currently the returned uri doesn't support SSL, but you can enable it by using `rediss://` instead of `redis://`. We will provide the SSL connection in a future release",
}
resp.Schema = schema.Schema{
@ -134,7 +135,8 @@ func (r *credentialDataSource) Schema(_ context.Context, _ datasource.SchemaRequ
Computed: true,
},
"uri": schema.StringAttribute{
Computed: true,
Description: descriptions["uri"],
Computed: true,
},
"username": schema.StringAttribute{
Computed: true,

View file

@ -103,6 +103,7 @@ func (r *credentialResource) Schema(_ context.Context, _ resource.SchemaRequest,
"credential_id": "The credential's ID.",
"instance_id": "ID of the Redis instance.",
"project_id": "STACKIT Project ID to which the instance is associated.",
"uri": "Connection URI. Currently the returned uri doesn't support SSL, but you can enable it by using `rediss://` instead of `redis://`. We will provide the SSL connection in a future release",
}
resp.Schema = schema.Schema{
@ -171,7 +172,8 @@ func (r *credentialResource) Schema(_ context.Context, _ resource.SchemaRequest,
Computed: true,
},
"uri": schema.StringAttribute{
Computed: true,
Description: descriptions["uri"],
Computed: true,
},
"username": schema.StringAttribute{
Computed: true,

View file

@ -86,7 +86,7 @@ func (r *projectResource) Configure(ctx context.Context, req resource.ConfigureR
// Schema returns the Terraform schema structure
func (r *projectResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = schema.Schema{
Description: "SKE project resource schema. Must have a `region` specified in the provider configuration.",
Description: "SKE project resource schema. Must have a `region` specified in the provider configuration. This resource allows you to enable the SKE service and you can only have one per project. Deleting this resource will destroy any SKE clusters associated to the project",
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Description: "Terraform's internal resource ID. It is structured as \"`project_id`\".",
@ -171,6 +171,8 @@ func (r *projectResource) Update(ctx context.Context, _ resource.UpdateRequest,
// Delete deletes the resource and removes the Terraform state on success.
func (r *projectResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { // nolint:gocritic // function signature required by Terraform
core.LogAndAddWarning(ctx, &resp.Diagnostics, "Deleting project", "Deleting this resource will destroy any existing clusters under the project")
var model Model
resp.Diagnostics.Append(req.State.Get(ctx, &model)...)
if resp.Diagnostics.HasError() {
@ -182,12 +184,12 @@ func (r *projectResource) Delete(ctx context.Context, req resource.DeleteRequest
c := r.client
_, err := c.DisableService(ctx, projectId).Execute()
if err != nil {
core.LogAndAddError(ctx, &resp.Diagnostics, "Error deleting credential", fmt.Sprintf("Calling API: %v", err))
core.LogAndAddError(ctx, &resp.Diagnostics, "Error deleting project", fmt.Sprintf("Calling API: %v", err))
return
}
_, err = wait.DisableServiceWaitHandler(ctx, r.client, projectId).WaitWithContext(ctx)
if err != nil {
core.LogAndAddError(ctx, &resp.Diagnostics, "Error deleting credential", fmt.Sprintf("Project deletion waiting: %v", err))
core.LogAndAddError(ctx, &resp.Diagnostics, "Error deleting project", fmt.Sprintf("Project deletion waiting: %v", err))
return
}
tflog.Info(ctx, "SKE project deleted")