Skip to content
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
4 changes: 2 additions & 2 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ import {
}

import {
id = "project_id,instance_id,credentials_id"
id = "project_id,instance_id,credential_id"
to = stackit_logme_credential.example-credential
}
```
Expand All @@ -119,7 +119,7 @@ resource "stackit_logme_instance" "example-instance" {
version = null
}

# __generated__ by Terraform from "project_id,instance_id,credentials_id"
# __generated__ by Terraform from "project_id,instance_id,credential_id"
resource "stackit_logme_credential" "example-credential" {
instance_id = "instance_id"
project_id = "project_id"
Expand Down
10 changes: 5 additions & 5 deletions docs/data-sources/logme_credential.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ LogMe credential data source schema.

```terraform
data "stackit_logme_credential" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
credentials_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
credential_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```

Expand All @@ -25,7 +25,7 @@ data "stackit_logme_credential" "example" {

### Required

- `credentials_id` (String) The credentials ID.
- `credential_id` (String) The credential's ID.
- `instance_id` (String) ID of the LogMe instance.
- `project_id` (String) STACKIT project ID to which the instance is associated.

Expand All @@ -34,7 +34,7 @@ data "stackit_logme_credential" "example" {
- `host` (String)
- `hosts` (List of String)
- `http_api_uri` (String)
- `id` (String) Terraform's internal data source. identifier. It is structured as "`project_id`,`instance_id`,`credentials_id`".
- `id` (String) Terraform's internal data source. identifier. It is structured as "`project_id`,`instance_id`,`credential_id`".
- `name` (String)
- `password` (String, Sensitive)
- `port` (Number)
Expand Down
10 changes: 5 additions & 5 deletions docs/data-sources/mariadb_credential.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ MariaDB credential data source schema.

```terraform
data "stackit_mariadb_credential" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
credentials_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
credential_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```

Expand All @@ -25,7 +25,7 @@ data "stackit_mariadb_credential" "example" {

### Required

- `credentials_id` (String) The credentials ID.
- `credential_id` (String) The credential's ID.
- `instance_id` (String) ID of the MariaDB instance.
- `project_id` (String) STACKIT project ID to which the instance is associated.

Expand All @@ -34,7 +34,7 @@ data "stackit_mariadb_credential" "example" {
- `host` (String)
- `hosts` (List of String)
- `http_api_uri` (String)
- `id` (String) Terraform's internal data source. identifier. It is structured as "`project_id`,`instance_id`,`credentials_id`".
- `id` (String) Terraform's internal data source. identifier. It is structured as "`project_id`,`instance_id`,`credential_id`".
- `name` (String)
- `password` (String, Sensitive)
- `port` (Number)
Expand Down
10 changes: 5 additions & 5 deletions docs/data-sources/opensearch_credential.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ OpenSearch credential data source schema.

```terraform
data "stackit_opensearch_credential" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
credentials_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
credential_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```

Expand All @@ -25,7 +25,7 @@ data "stackit_opensearch_credential" "example" {

### Required

- `credentials_id` (String) The credentials ID.
- `credential_id` (String) The credential's ID.
- `instance_id` (String) ID of the OpenSearch instance.
- `project_id` (String) STACKIT project ID to which the instance is associated.

Expand All @@ -34,7 +34,7 @@ data "stackit_opensearch_credential" "example" {
- `host` (String)
- `hosts` (List of String)
- `http_api_uri` (String)
- `id` (String) Terraform's internal data source. identifier. It is structured as "`project_id`,`instance_id`,`credentials_id`".
- `id` (String) Terraform's internal data source. identifier. It is structured as "`project_id`,`instance_id`,`credential_id`".
- `name` (String)
- `password` (String, Sensitive)
- `port` (Number)
Expand Down
10 changes: 5 additions & 5 deletions docs/data-sources/postgresql_credential.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ PostgreSQL credential data source schema.

```terraform
data "stackit_postgresql_credential" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
credentials_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
credential_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```

Expand All @@ -25,7 +25,7 @@ data "stackit_postgresql_credential" "example" {

### Required

- `credentials_id` (String) The credentials ID.
- `credential_id` (String) The credential's ID.
- `instance_id` (String) ID of the PostgreSQL instance.
- `project_id` (String) STACKIT project ID to which the instance is associated.

Expand All @@ -34,7 +34,7 @@ data "stackit_postgresql_credential" "example" {
- `host` (String)
- `hosts` (List of String)
- `http_api_uri` (String)
- `id` (String) Terraform's internal data source. identifier. It is structured as "`project_id`,`instance_id`,`credentials_id`".
- `id` (String) Terraform's internal data source. identifier. It is structured as "`project_id`,`instance_id`,`credential_id`".
- `name` (String)
- `password` (String, Sensitive)
- `port` (Number)
Expand Down
10 changes: 5 additions & 5 deletions docs/data-sources/rabbitmq_credential.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ RabbitMQ credential data source schema.

```terraform
data "stackit_rabbitmq_credential" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
credentials_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
credential_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```

Expand All @@ -25,7 +25,7 @@ data "stackit_rabbitmq_credential" "example" {

### Required

- `credentials_id` (String) The credentials ID.
- `credential_id` (String) The credential's ID.
- `instance_id` (String) ID of the RabbitMQ instance.
- `project_id` (String) STACKIT project ID to which the instance is associated.

Expand All @@ -34,7 +34,7 @@ data "stackit_rabbitmq_credential" "example" {
- `host` (String)
- `hosts` (List of String)
- `http_api_uri` (String)
- `id` (String) Terraform's internal data source. identifier. It is structured as "`project_id`,`instance_id`,`credentials_id`".
- `id` (String) Terraform's internal data source. identifier. It is structured as "`project_id`,`instance_id`,`credential_id`".
- `name` (String)
- `password` (String, Sensitive)
- `port` (Number)
Expand Down
10 changes: 5 additions & 5 deletions docs/data-sources/redis_credential.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ Redis credential data source schema.

```terraform
data "stackit_redis_credential" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
credentials_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
credential_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```

Expand All @@ -25,7 +25,7 @@ data "stackit_redis_credential" "example" {

### Required

- `credentials_id` (String) The credentials ID.
- `credential_id` (String) The credential's ID.
- `instance_id` (String) ID of the Redis instance.
- `project_id` (String) STACKIT project ID to which the instance is associated.

Expand All @@ -34,7 +34,7 @@ data "stackit_redis_credential" "example" {
- `host` (String)
- `hosts` (List of String)
- `http_api_uri` (String)
- `id` (String) Terraform's internal data source. identifier. It is structured as "`project_id`,`instance_id`,`credentials_id`".
- `id` (String) Terraform's internal data source. identifier. It is structured as "`project_id`,`instance_id`,`credential_id`".
- `name` (String)
- `password` (String, Sensitive)
- `port` (Number)
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/logme_credential.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ resource "stackit_logme_credential" "example" {

### Read-Only

- `credentials_id` (String) The credentials ID.
- `credential_id` (String) The credential's ID.
- `host` (String)
- `hosts` (List of String)
- `http_api_uri` (String)
- `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`instance_id`,`credentials_id`".
- `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`instance_id`,`credential_id`".
- `name` (String)
- `password` (String, Sensitive)
- `port` (Number)
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/mariadb_credential.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ resource "stackit_mariadb_credential" "example" {

### Read-Only

- `credentials_id` (String) The credentials ID.
- `credential_id` (String) The credential's ID.
- `host` (String)
- `hosts` (List of String)
- `http_api_uri` (String)
- `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`instance_id`,`credentials_id`".
- `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`instance_id`,`credential_id`".
- `name` (String)
- `password` (String, Sensitive)
- `port` (Number)
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/opensearch_credential.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ resource "stackit_opensearch_credential" "example" {

### Read-Only

- `credentials_id` (String) The credentials ID.
- `credential_id` (String) The credential's ID.
- `host` (String)
- `hosts` (List of String)
- `http_api_uri` (String)
- `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`instance_id`,`credentials_id`".
- `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`instance_id`,`credential_id`".
- `name` (String)
- `password` (String, Sensitive)
- `port` (Number)
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/postgresql_credential.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ resource "stackit_postgresql_credential" "example" {

### Read-Only

- `credentials_id` (String) The credentials ID.
- `credential_id` (String) The credential's ID.
- `host` (String)
- `hosts` (List of String)
- `http_api_uri` (String)
- `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`instance_id`,`credentials_id`".
- `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`instance_id`,`credential_id`".
- `name` (String)
- `password` (String, Sensitive)
- `port` (Number)
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/rabbitmq_credential.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ resource "stackit_rabbitmq_credential" "example" {

### Read-Only

- `credentials_id` (String) The credentials ID.
- `credential_id` (String) The credential's ID.
- `host` (String)
- `hosts` (List of String)
- `http_api_uri` (String)
- `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`instance_id`,`credentials_id`".
- `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`instance_id`,`credential_id`".
- `name` (String)
- `password` (String, Sensitive)
- `port` (Number)
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/redis_credential.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ resource "stackit_redis_credential" "example" {

### Read-Only

- `credentials_id` (String) The credentials ID.
- `credential_id` (String) The credential's ID.
- `host` (String)
- `hosts` (List of String)
- `http_api_uri` (String)
- `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`instance_id`,`credentials_id`".
- `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`instance_id`,`credential_id`".
- `name` (String)
- `password` (String, Sensitive)
- `port` (Number)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
data "stackit_logme_credential" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
credentials_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
credential_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
data "stackit_mariadb_credential" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
credentials_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
credential_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
data "stackit_opensearch_credential" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
credentials_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
credential_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
data "stackit_postgresql_credential" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
credentials_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
credential_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
data "stackit_rabbitmq_credential" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
credentials_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
credential_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
data "stackit_redis_credential" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
credentials_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
credential_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
24 changes: 12 additions & 12 deletions stackit/internal/services/logme/credential/datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,17 @@ func (r *credentialDataSource) Configure(ctx context.Context, req datasource.Con
}

r.client = apiClient
tflog.Info(ctx, "LogMe credentials client configured")
tflog.Info(ctx, "LogMe credential client configured")
}

// Schema defines the schema for the data source.
func (r *credentialDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
descriptions := map[string]string{
"main": "LogMe credential data source schema.",
"id": "Terraform's internal data source. identifier. It is structured as \"`project_id`,`instance_id`,`credentials_id`\".",
"credentials_id": "The credentials ID.",
"instance_id": "ID of the LogMe instance.",
"project_id": "STACKIT project ID to which the instance is associated.",
"main": "LogMe credential data source schema.",
"id": "Terraform's internal data source. identifier. It is structured as \"`project_id`,`instance_id`,`credential_id`\".",
"credential_id": "The credential's ID.",
"instance_id": "ID of the LogMe instance.",
"project_id": "STACKIT project ID to which the instance is associated.",
}

resp.Schema = schema.Schema{
Expand All @@ -89,8 +89,8 @@ func (r *credentialDataSource) Schema(_ context.Context, _ datasource.SchemaRequ
Description: descriptions["id"],
Computed: true,
},
"credentials_id": schema.StringAttribute{
Description: descriptions["credentials_id"],
"credential_id": schema.StringAttribute{
Description: descriptions["credential_id"],
Required: true,
Validators: []validator.String{
validate.UUID(),
Expand Down Expand Up @@ -153,12 +153,12 @@ func (r *credentialDataSource) Read(ctx context.Context, req datasource.ReadRequ
}
projectId := model.ProjectId.ValueString()
instanceId := model.InstanceId.ValueString()
credentialsId := model.CredentialsId.ValueString()
credentialId := model.CredentialId.ValueString()
ctx = tflog.SetField(ctx, "project_id", projectId)
ctx = tflog.SetField(ctx, "instance_id", instanceId)
ctx = tflog.SetField(ctx, "credentials_id", credentialsId)
ctx = tflog.SetField(ctx, "credential_id", credentialId)

recordSetResp, err := r.client.GetCredentials(ctx, projectId, instanceId, credentialsId).Execute()
recordSetResp, err := r.client.GetCredentials(ctx, projectId, instanceId, credentialId).Execute()
if err != nil {
core.LogAndAddError(ctx, &resp.Diagnostics, "Error reading credential", fmt.Sprintf("Calling API: %v", err))
return
Expand All @@ -177,5 +177,5 @@ func (r *credentialDataSource) Read(ctx context.Context, req datasource.ReadRequ
if resp.Diagnostics.HasError() {
return
}
tflog.Info(ctx, "LogMe credentials read")
tflog.Info(ctx, "LogMe credential read")
}
Loading