Skip to content

Commit

Permalink
Update LogMe to v2 (#151)
Browse files Browse the repository at this point in the history
* update tests and examples

* Automated docs update

---------

Co-authored-by: Dean Oren <deangili.oren@mail.schwarz>
Co-authored-by: do87 <do87@users.noreply.github.com>
  • Loading branch information
3 people authored Jun 20, 2023
1 parent d1f6fe4 commit 83bb9a5
Show file tree
Hide file tree
Showing 20 changed files with 50 additions and 47 deletions.
4 changes: 1 addition & 3 deletions docs/resources/elasticsearch_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ Manages ElasticSearch instances

```terraform
resource "stackit_elasticsearch_instance" "example" {
name = "some_name_2"
name = "example"
project_id = var.project_id
version = "7"
plan = "stackit-elasticsearch-single-medium"
}
```

Expand Down
8 changes: 3 additions & 5 deletions docs/resources/logme_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ Manages LogMe instances
```terraform
resource "stackit_logme_instance" "example" {
name = "example"
project_id = "example"
version = "LogMe"
plan = "stackit-logme-single-small-non-ssl"
project_id = var.project_id
}
```

Expand All @@ -48,9 +46,9 @@ resource "stackit_logme_instance" "example" {
### Optional

- `acl` (List of String) Access Control rules to whitelist IP addresses
- `plan` (String) The LogMe Plan. Default is `stackit-logme-1.4.10-single`
- `plan` (String) The LogMe Plan. Default is `stackit-logme2-1.4.10-single`
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))
- `version` (String) LogMe version. Default is LogMe
- `version` (String) LogMe version. Default is 2

### Read-Only

Expand Down
4 changes: 1 addition & 3 deletions docs/resources/mariadb_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ Manages MariaDB instances
```terraform
resource "stackit_mariadb_instance" "example" {
name = "example"
project_id = "example"
version = "10.4"
plan = "stackit-mariadb-single-small"
project_id = var.project_id
}
```

Expand Down
5 changes: 5 additions & 0 deletions docs/resources/mongodb_flex_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ resource "stackit_mongodb_flex_instance" "example" {
name = "example"
project_id = "example"
machine_type = "1.1"
acl = [
"193.148.160.0/19",
"45.129.40.0/21",
"45.135.244.0/22"
]
}
```

Expand Down
9 changes: 8 additions & 1 deletion docs/resources/opensearch_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ Manages Opensearch instances
</table><br />
<small style='margin-left: 24px; margin-top: -5px; display: inline-block;'><a href="https://registry.terraform.io/providers/SchwarzIT/stackit/latest/docs#environment">By default</a>, production is used.<br />To set a custom URL, set an environment variable <code>STACKIT_REDIS_BASEURL</code></small>


## Example Usage

```terraform
resource "stackit_opensearch_instance" "example" {
name = "example"
project_id = var.project_id
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
5 changes: 5 additions & 0 deletions docs/resources/postgres_flex_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ resource "stackit_postgres_flex_instance" "example" {
name = "example"
project_id = "example"
machine_type = "2.4"
acl = [
"193.148.160.0/19",
"45.129.40.0/21",
"45.135.244.0/22"
]
}
```

Expand Down
4 changes: 1 addition & 3 deletions docs/resources/postgres_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ Manages Postgres instances
```terraform
resource "stackit_postgres_instance" "example" {
name = "example"
project_id = "example"
version = "11"
plan = "stackit-postgresql-single-small"
project_id = var.project_id
}
```

Expand Down
4 changes: 1 addition & 3 deletions docs/resources/rabbitmq_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ Manages RabbitMQ instances
```terraform
resource "stackit_rabbitmq_instance" "example" {
name = "example"
project_id = "example"
version = "3.7"
plan = "stackit-rabbitmq-single-small"
project_id = var.project_id
}
```

Expand Down
4 changes: 1 addition & 3 deletions docs/resources/redis_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ Manages Redis instances
```terraform
resource "stackit_redis_instance" "example" {
name = "example"
project_id = "example"
version = "6"
plan = "stackit-redis-single-small"
project_id = var.project_id
}
```

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
resource "stackit_elasticsearch_instance" "example" {
name = "some_name_2"
name = "example"
project_id = var.project_id
version = "7"
plan = "stackit-elasticsearch-single-medium"
}
4 changes: 1 addition & 3 deletions examples/resources/stackit_logme_instance/resource.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
resource "stackit_logme_instance" "example" {
name = "example"
project_id = "example"
version = "LogMe"
plan = "stackit-logme-single-small-non-ssl"
project_id = var.project_id
}
4 changes: 1 addition & 3 deletions examples/resources/stackit_mariadb_instance/resource.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
resource "stackit_mariadb_instance" "example" {
name = "example"
project_id = "example"
version = "10.4"
plan = "stackit-mariadb-single-small"
project_id = var.project_id
}
5 changes: 5 additions & 0 deletions examples/resources/stackit_mongodb_flex_instance/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@ resource "stackit_mongodb_flex_instance" "example" {
name = "example"
project_id = "example"
machine_type = "1.1"
acl = [
"193.148.160.0/19",
"45.129.40.0/21",
"45.135.244.0/22"
]
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resource "stackit_opensearch_instance" "example" {
name = "example"
project_id = "example"
project_id = var.project_id
}
5 changes: 5 additions & 0 deletions examples/resources/stackit_postgres_flex_instance/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@ resource "stackit_postgres_flex_instance" "example" {
name = "example"
project_id = "example"
machine_type = "2.4"
acl = [
"193.148.160.0/19",
"45.129.40.0/21",
"45.135.244.0/22"
]
}
4 changes: 1 addition & 3 deletions examples/resources/stackit_postgres_instance/resource.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
resource "stackit_postgres_instance" "example" {
name = "example"
project_id = "example"
version = "11"
plan = "stackit-postgresql-single-small"
project_id = var.project_id
}
4 changes: 1 addition & 3 deletions examples/resources/stackit_rabbitmq_instance/resource.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
resource "stackit_rabbitmq_instance" "example" {
name = "example"
project_id = "example"
version = "3.7"
plan = "stackit-rabbitmq-single-small"
project_id = var.project_id
}
4 changes: 1 addition & 3 deletions examples/resources/stackit_redis_instance/resource.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
resource "stackit_redis_instance" "example" {
name = "example"
project_id = "example"
version = "6"
plan = "stackit-redis-single-small"
project_id = var.project_id
}
4 changes: 2 additions & 2 deletions stackit/internal/resources/data-services/instance/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func (r Resource) getDefaultVersion() string {
case ElasticSearch:
return "7"
case LogMe:
return "LogMe"
return "2"
case MariaDB:
return "10.6"
case Opensearch:
Expand All @@ -38,7 +38,7 @@ func (r Resource) getDefaultPlan() string {
case ElasticSearch:
return "stackit-elasticsearch-1.4.10-single"
case LogMe:
return "stackit-logme-1.4.10-single"
return "stackit-logme2-1.4.10-single"
case MariaDB:
return "stackit-mariadb-1.4.10-single"
case Opensearch:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ func TestAcc_ResourceLogMeInstanceJob(t *testing.T) {
}

name := "odjtest-" + acctest.RandStringFromCharSet(7, acctest.CharSetAlpha)
plan1 := "stackit-logme-single-small-non-ssl"
planID1 := "839695A3-6943-4F55-8FB0-9469143178DE"
plan2 := "stackit-logme-single-medium-non-ssl"
planID2 := "84beabaf-605d-4f00-8a9b-272bd009ad76"
version := "LogMe"
plan1 := "stackit-logme2-1.4.10-single"
planID1 := "7a54492c-8a2e-4d3c-b6c2-a4f20cb65912"
plan2 := "stackit-logme2-2.8.50-single"
planID2 := "6147ee05-3a78-461a-b6e7-af65e65f1ce6"
version := "2"

resource.ParallelTest(t, resource.TestCase{
ProtoV6ProviderFactories: map[string]func() (tfprotov6.ProviderServer, error){
Expand Down

0 comments on commit 83bb9a5

Please sign in to comment.