Skip to content

Commit ee1bee8

Browse files
feat: Implement Monitoring Service (#729)
1 parent 0ab8f6d commit ee1bee8

File tree

319 files changed

+22551
-6477
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

319 files changed

+22551
-6477
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
## 6.6.9
1+
## 6.6.9 -- upcoming release
2+
### Features
3+
- Add support for Monitoring Service: `ionoscloud_monitoring_pipeline` resource and data source.
24
### Docs
35
- Replace < and > with " in the docs
46
- Remove { and } from terraform imports
57
- Replace \_ with _ in resource names
8+
69
## 6.6.8
710
### Features
811
- Add `auto_scaling` attribute to `ionoscloud_dataplatform_node_pool` resource.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
subcategory: "Monitoring Service"
3+
layout: "ionoscloud"
4+
page_title: "IonosCloud: ionoscloud_monitoring_pipeline"
5+
sidebar_current: "docs-resource-monitoring_pipeline"
6+
description: |-
7+
Get information on a Monitoring pipeline.
8+
---
9+
10+
# ionoscloud_monitoring_pipeline
11+
12+
The **Monitoring pipeline** datasource can be used to search for and return an existing Monitoring pipeline.
13+
If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned.
14+
15+
> ⚠️ Only tokens are accepted for authorization in the **monitoring_pipeline** data source. Please ensure you are using tokens as other methods will not be valid.
16+
17+
## Example Usage
18+
19+
### By ID
20+
```hcl
21+
data "ionoscloud_monitoring_pipeline" "example" {
22+
location = "de/txl"
23+
id = "pipeline_id"
24+
}
25+
```
26+
27+
### By name
28+
```hcl
29+
data "ionoscloud_monitoring_pipeline" "example" {
30+
location = "de/txl"
31+
name = "pipeline_name"
32+
}
33+
```
34+
35+
## Argument reference
36+
* `location` - (Optional)[string] The location of the Monitoring pipeline. Default is `de/fra`. It can be one of `de/fra`, `de/txl`, `gb/lhr`, `es/vit`, `fr/par`. If this is not set and if no value is provided for the `IONOS_API_URL` env var, the default `location` will be: `de/fra`.
37+
* `id` - (Optional)[string] The ID of the Monitoring pipeline you want to search for.
38+
* `name` - (Optional)[string] The name of the Monitoring pipeline you want to search for.
39+
40+
Either `id` or `name` must be provided. If none, or both are provided, the datasource will return an error.
41+
42+
## Attributes Reference
43+
44+
The following attributes are returned by the datasource:
45+
46+
* `id` - The UUID of the Monitoring pipeline.
47+
* `name` - The name of the Monitoring pipeline.
48+
* `grafana_address` - The endpoint of the Grafana instance.
49+
* `http_endpoint`- The HTTP endpoint of the Monitoring instance.

docs/resources/monitoring_pipeline.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
subcategory: "Monitoring Service"
3+
layout: "ionoscloud"
4+
page_title: "IonosCloud: ionoscloud_monitoring_pipeline"
5+
sidebar_current: "docs-resource-monitoring_pipeline"
6+
description: |-
7+
Creates and manages Monitoring pipeline objects.
8+
---
9+
10+
# ionoscloud_monitoring_pipeline
11+
12+
Manages a **Monitoring pipeline**.
13+
14+
> ⚠️ Only tokens are accepted for authorization in the **monitoring_pipeline** resource. Please ensure you are using tokens as other methods will not be valid.
15+
16+
## Usage example
17+
18+
```hcl
19+
resource "ionoscloud_monitoring_pipeline" "example" {
20+
location = "es/vit"
21+
name = "pipelineExample"
22+
}
23+
```
24+
25+
**NOTE:** The default timeout for all operations is 60 minutes. If you want to change the default value, you can use `timeouts` attribute inside the resource:
26+
27+
```hcl
28+
resource "ionoscloud_monitoring_pipeline" "example" {
29+
location = "es/vit"
30+
name = "pipelineExample"
31+
timeouts {
32+
create = "20m"
33+
read = "30s"
34+
update = "10m"
35+
delete = "10m"
36+
}
37+
}
38+
```
39+
40+
## Argument reference
41+
42+
* `name` - (Required)[string] The name of the Monitoring pipeline.
43+
* `location` - (Optional)[string] The location of the Monitoring pipeline. Default is `de/fra`. It can be one of `de/fra`, `de/txl`, `gb/lhr`, `es/vit`, `fr/par`. If this is not set and if no value is provided for the `IONOS_API_URL_MONITORING` env var, the default `location` will be: `de/fra`.
44+
* `grafana_endpoint` - (Computed)[string] The endpoint of the Grafana instance.
45+
* `http_endpoint` - (Computed)[string] The HTTP endpoint of the monitoring instance.
46+
* `key` - (Computed)(Sensitive)[string] The key used to connect to the monitoring pipeline.
47+
48+
> **⚠ NOTE:** `IONOS_API_URL_MONITORING` can be used to set a custom API URL for the resource. `location` field needs to be empty, otherwise it will override the custom API URL.
49+
50+
## Import
51+
52+
In order to import a Monitoring pipeline, you can define an empty Monitoring pipeline resource in the plan:
53+
54+
```hcl
55+
resource "ionoscloud_monitoring_pipeline" "example" {
56+
}
57+
```
58+
59+
The resource can be imported using the `location` and `pipeline_id`, for example:
60+
61+
```shell
62+
terraform import ionoscloud_monitoring_pipeline.example location:pipeline_id
63+
```

gitbook_docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ See the [IonosCloud Provider documentation](https://registry.terraform.io/provid
4343
| `IONOS_API_URL_KAFKA` | Sets a custom API URL for the Event Streams product. `location` field needs to be empty, otherwise it will override the custom API URL. Setting `token` or `IONOS_API_URL` does not have any effect. |
4444
| `IONOS_API_URL_VPN` | Sets a custom API URL for the VPN product. `location` field needs to be empty, otherwise it will override the custom API URL. Setting `token` or `IONOS_API_URL` does not have any effect. |
4545
| `IONOS_API_URL_OBJECT_STORAGE` | Sets a custom API URL for the Object Storage product. `region` field needs to be empty, otherwise it will override the custom API URL. Setting `token` or `IONOS_API_URL` does not have any effect. |
46+
| `IONOS_API_URL_MONITORING` | Sets a custom API URL for the Monitoring product. `location` field needs to be empty, otherwise it will override the custom API URL. Setting `token` or `IONOS_API_URL` does not have any effect. |
4647

4748
### Certificate pinning:
4849

go.mod

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ require (
66
github.com/aws/aws-sdk-go v1.55.5
77
github.com/cenkalti/backoff/v4 v4.3.0
88
github.com/gofrs/uuid/v5 v5.3.0
9-
github.com/hashicorp/terraform-plugin-framework v1.11.0
9+
github.com/hashicorp/terraform-plugin-framework v1.13.0
1010
github.com/hashicorp/terraform-plugin-framework-jsontypes v0.1.0
1111
github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1
12-
github.com/hashicorp/terraform-plugin-framework-validators v0.13.0
12+
github.com/hashicorp/terraform-plugin-framework-validators v0.16.0
1313
github.com/hashicorp/terraform-plugin-mux v0.16.0
1414
github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0
1515
github.com/hashicorp/terraform-plugin-testing v1.10.0
@@ -18,6 +18,7 @@ require (
1818
github.com/ionos-cloud/sdk-go-api-gateway v1.0.0
1919
github.com/ionos-cloud/sdk-go-bundle/products/cdn/v2 v2.1.0
2020
github.com/ionos-cloud/sdk-go-bundle/products/logging/v2 v2.1.1
21+
github.com/ionos-cloud/sdk-go-bundle/products/monitoring/v2 v2.0.0
2122
github.com/ionos-cloud/sdk-go-bundle/products/vpn/v2 v2.0.2
2223
github.com/ionos-cloud/sdk-go-bundle/shared v0.1.1
2324
github.com/ionos-cloud/sdk-go-cert-manager v1.1.0
@@ -44,7 +45,6 @@ require (
4445
github.com/jmespath/go-jmespath v0.4.0 // indirect
4546
github.com/kr/pretty v0.3.0 // indirect
4647
github.com/rogpeppe/go-internal v1.12.0 // indirect
47-
github.com/stretchr/testify v1.8.2 // indirect
4848
golang.org/x/sync v0.8.0 // indirect
4949
golang.org/x/tools v0.24.0 // indirect
5050
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
@@ -67,15 +67,15 @@ require (
6767
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect
6868
github.com/hashicorp/go-hclog v1.6.3 // indirect
6969
github.com/hashicorp/go-multierror v1.1.1 // indirect
70-
github.com/hashicorp/go-plugin v1.6.1 // indirect
70+
github.com/hashicorp/go-plugin v1.6.2 // indirect
7171
github.com/hashicorp/go-uuid v1.0.3
7272
github.com/hashicorp/go-version v1.7.0
7373
github.com/hashicorp/hc-install v0.8.0 // indirect
7474
github.com/hashicorp/hcl/v2 v2.22.0 // indirect
7575
github.com/hashicorp/logutils v1.0.0 // indirect
7676
github.com/hashicorp/terraform-exec v0.21.0 // indirect
7777
github.com/hashicorp/terraform-json v0.22.1 // indirect
78-
github.com/hashicorp/terraform-plugin-go v0.23.0
78+
github.com/hashicorp/terraform-plugin-go v0.25.0
7979
github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect
8080
github.com/hashicorp/terraform-registry-address v0.2.3 // indirect
8181
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
@@ -99,6 +99,6 @@ require (
9999
golang.org/x/text v0.17.0 // indirect
100100
google.golang.org/appengine v1.6.8 // indirect
101101
google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed // indirect
102-
google.golang.org/grpc v1.66.0 // indirect
103-
google.golang.org/protobuf v1.34.2 // indirect
102+
google.golang.org/grpc v1.67.1 // indirect
103+
google.golang.org/protobuf v1.35.1 // indirect
104104
)

go.sum

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB1
6565
github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
6666
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
6767
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
68-
github.com/hashicorp/go-plugin v1.6.1 h1:P7MR2UP6gNKGPp+y7EZw2kOiq4IR9WiqLvp0XOsVdwI=
69-
github.com/hashicorp/go-plugin v1.6.1/go.mod h1:XPHFku2tFo3o3QKFgSYo+cghcUhw1NA1hZyMK0PWAw0=
68+
github.com/hashicorp/go-plugin v1.6.2 h1:zdGAEd0V1lCaU0u+MxWQhtSDQmahpkwOun8U8EiRVog=
69+
github.com/hashicorp/go-plugin v1.6.2/go.mod h1:CkgLQ5CZqNmdL9U9JzM532t8ZiYQ35+pj3b1FD37R0Q=
7070
github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU=
7171
github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk=
7272
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
@@ -84,16 +84,16 @@ github.com/hashicorp/terraform-exec v0.21.0 h1:uNkLAe95ey5Uux6KJdua6+cv8asgILFVW
8484
github.com/hashicorp/terraform-exec v0.21.0/go.mod h1:1PPeMYou+KDUSSeRE9szMZ/oHf4fYUmB923Wzbq1ICg=
8585
github.com/hashicorp/terraform-json v0.22.1 h1:xft84GZR0QzjPVWs4lRUwvTcPnegqlyS7orfb5Ltvec=
8686
github.com/hashicorp/terraform-json v0.22.1/go.mod h1:JbWSQCLFSXFFhg42T7l9iJwdGXBYV8fmmD6o/ML4p3A=
87-
github.com/hashicorp/terraform-plugin-framework v1.11.0 h1:M7+9zBArexHFXDx/pKTxjE6n/2UCXY6b8FIq9ZYhwfE=
88-
github.com/hashicorp/terraform-plugin-framework v1.11.0/go.mod h1:qBXLDn69kM97NNVi/MQ9qgd1uWWsVftGSnygYG1tImM=
87+
github.com/hashicorp/terraform-plugin-framework v1.13.0 h1:8OTG4+oZUfKgnfTdPTJwZ532Bh2BobF4H+yBiYJ/scw=
88+
github.com/hashicorp/terraform-plugin-framework v1.13.0/go.mod h1:j64rwMGpgM3NYXTKuxrCnyubQb/4VKldEKlcG8cvmjU=
8989
github.com/hashicorp/terraform-plugin-framework-jsontypes v0.1.0 h1:b8vZYB/SkXJT4YPbT3trzE6oJ7dPyMy68+9dEDKsJjE=
9090
github.com/hashicorp/terraform-plugin-framework-jsontypes v0.1.0/go.mod h1:tP9BC3icoXBz72evMS5UTFvi98CiKhPdXF6yLs1wS8A=
9191
github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1 h1:gm5b1kHgFFhaKFhm4h2TgvMUlNzFAtUqlcOWnWPm+9E=
9292
github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1/go.mod h1:MsjL1sQ9L7wGwzJ5RjcI6FzEMdyoBnw+XK8ZnOvQOLY=
93-
github.com/hashicorp/terraform-plugin-framework-validators v0.13.0 h1:bxZfGo9DIUoLLtHMElsu+zwqI4IsMZQBRRy4iLzZJ8E=
94-
github.com/hashicorp/terraform-plugin-framework-validators v0.13.0/go.mod h1:wGeI02gEhj9nPANU62F2jCaHjXulejm/X+af4PdZaNo=
95-
github.com/hashicorp/terraform-plugin-go v0.23.0 h1:AALVuU1gD1kPb48aPQUjug9Ir/125t+AAurhqphJ2Co=
96-
github.com/hashicorp/terraform-plugin-go v0.23.0/go.mod h1:1E3Cr9h2vMlahWMbsSEcNrOCxovCZhOOIXjFHbjc/lQ=
93+
github.com/hashicorp/terraform-plugin-framework-validators v0.16.0 h1:O9QqGoYDzQT7lwTXUsZEtgabeWW96zUBh47Smn2lkFA=
94+
github.com/hashicorp/terraform-plugin-framework-validators v0.16.0/go.mod h1:Bh89/hNmqsEWug4/XWKYBwtnw3tbz5BAy1L1OgvbIaY=
95+
github.com/hashicorp/terraform-plugin-go v0.25.0 h1:oi13cx7xXA6QciMcpcFi/rwA974rdTxjqEhXJjbAyks=
96+
github.com/hashicorp/terraform-plugin-go v0.25.0/go.mod h1:+SYagMYadJP86Kvn+TGeV+ofr/R3g4/If0O5sO96MVw=
9797
github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0=
9898
github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow=
9999
github.com/hashicorp/terraform-plugin-mux v0.16.0 h1:RCzXHGDYwUwwqfYYWJKBFaS3fQsWn/ZECEiW7p2023I=
@@ -118,6 +118,8 @@ github.com/ionos-cloud/sdk-go-bundle/products/cdn/v2 v2.1.0 h1:8fRICa4i+GJHrCgnL
118118
github.com/ionos-cloud/sdk-go-bundle/products/cdn/v2 v2.1.0/go.mod h1:BF6R+j1GdJEMImxkeh32qjIVWqsBfgi6VgyfsY5ezIA=
119119
github.com/ionos-cloud/sdk-go-bundle/products/logging/v2 v2.1.1 h1:GXxdNKl7haQnHO1QewZeXazur5+LDCpHqvP+nNObGaA=
120120
github.com/ionos-cloud/sdk-go-bundle/products/logging/v2 v2.1.1/go.mod h1:N0ifRq3ENqGg6qht1WPrVgSkcavPS5SRWlNfkHUZbfQ=
121+
github.com/ionos-cloud/sdk-go-bundle/products/monitoring/v2 v2.0.0 h1:gVh+jd0o8ROtJLWqUB6/VU8vSLdj/kRYAz/qbMO7z7I=
122+
github.com/ionos-cloud/sdk-go-bundle/products/monitoring/v2 v2.0.0/go.mod h1:PRdc/x/r7tMEV7rh2uZYJ8ososjfIF/cXiGX/D6FdTs=
121123
github.com/ionos-cloud/sdk-go-bundle/products/vpn/v2 v2.0.2 h1:qR/ul88v/3ZF+ZLFFv6LE9TrjZS1qM4R10UlXCaQzcs=
122124
github.com/ionos-cloud/sdk-go-bundle/products/vpn/v2 v2.0.2/go.mod h1:V6WHbWsQDlZsLtHqgsXO81Z9eJBsczE3Q6VY8J+rutc=
123125
github.com/ionos-cloud/sdk-go-bundle/shared v0.1.1 h1:NWobgIhmUJKG6ohFXefMj+KmpEEvLYEDUgGzpns6HQE=
@@ -126,8 +128,6 @@ github.com/ionos-cloud/sdk-go-cert-manager v1.1.0 h1:6lM1RoBc6Epw3g7B6CKWoKGsUDP
126128
github.com/ionos-cloud/sdk-go-cert-manager v1.1.0/go.mod h1:gf7rfOdClT/kKK58RDmy/tAQ8z6hqRRzs8zmTL/tWLM=
127129
github.com/ionos-cloud/sdk-go-container-registry v1.2.0 h1:C5r2XleKLbSFw9kmb4N8ImqJ/HtLus3yh/R5BHy/6sg=
128130
github.com/ionos-cloud/sdk-go-container-registry v1.2.0/go.mod h1:woBP1+A4N0KXiRj9jG4y/hEXgrVjJv0CUlAvc24mCeo=
129-
github.com/ionos-cloud/sdk-go-dataplatform v1.0.3 h1:eaZITgPaLHbK4d/nVaImvP19a5yAumI5hprjM/B1qSE=
130-
github.com/ionos-cloud/sdk-go-dataplatform v1.0.3/go.mod h1:LXJGnUwLLiJhKgApv7TIPGy7WOuGbYIzBPFxGpNfqN0=
131131
github.com/ionos-cloud/sdk-go-dataplatform v1.1.1 h1:Wu9TAiphRyMEweUcQlMblhVCl9qVxQlOYEOw+jJS+Ss=
132132
github.com/ionos-cloud/sdk-go-dataplatform v1.1.1/go.mod h1:3rQrOZFbXcjK3C5Dnjzahsd9x7PO+b4AARdBwdz//Mg=
133133
github.com/ionos-cloud/sdk-go-dbaas-in-memory-db v1.0.1 h1:vd3SCqZ1OI5l7Tzql7NDb5Zlpna8e2SsfEYZRGHOkOo=
@@ -205,13 +205,9 @@ github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG
205205
github.com/skeema/knownhosts v1.2.2 h1:Iug2P4fLmDw9f41PB6thxUkNUkJzB5i+1/exaj40L3A=
206206
github.com/skeema/knownhosts v1.2.2/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo=
207207
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
208-
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
209-
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
210-
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
211208
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
212-
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
213-
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
214-
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
209+
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
210+
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
215211
github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
216212
github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI=
217213
github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
@@ -283,12 +279,12 @@ google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAs
283279
google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
284280
google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed h1:J6izYgfBXAI3xTKLgxzTmUltdYaLsuBxFCgDHWJ/eXg=
285281
google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
286-
google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c=
287-
google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y=
282+
google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E=
283+
google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
288284
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
289285
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
290-
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
291-
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
286+
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
287+
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
292288
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
293289
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
294290
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
@@ -299,6 +295,5 @@ gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRN
299295
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
300296
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
301297
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
302-
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
303298
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
304299
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

internal/acctest/acctest.go

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"github.com/ionos-cloud/terraform-provider-ionoscloud/v6/internal/envar"
2020
"github.com/ionos-cloud/terraform-provider-ionoscloud/v6/internal/framework/provider"
2121
"github.com/ionos-cloud/terraform-provider-ionoscloud/v6/ionoscloud"
22+
monitoringService "github.com/ionos-cloud/terraform-provider-ionoscloud/v6/services/monitoring"
2223
objstorageservice "github.com/ionos-cloud/terraform-provider-ionoscloud/v6/services/objectstorage"
2324
)
2425

@@ -83,12 +84,6 @@ func PreCheck(t *testing.T) {
8384
t.Fatalf("%s/%s or %s must be set for acceptance tests", envar.IonosUsername, envar.IonosPassword, envar.IonosToken)
8485
}
8586
}
86-
87-
accessKey := os.Getenv(envar.IonosS3AccessKey)
88-
secretKey := os.Getenv(envar.IonosS3SecretKey)
89-
if accessKey == "" || secretKey == "" {
90-
t.Fatalf("%s and %s must be set for acceptance tests", envar.IonosS3AccessKey, envar.IonosS3SecretKey)
91-
}
9287
})
9388
}
9489

@@ -112,3 +107,23 @@ func ObjectStorageClient() (*objstorage.APIClient, error) {
112107

113108
return objstorageservice.NewClient(accessKey, secretKey, "", "", insecureBool).GetBaseClient(), nil
114109
}
110+
111+
// MonitoringClient returns a new Monitoring client for acceptance testing
112+
func MonitoringClient() *monitoringService.MonitoringClient {
113+
token := os.Getenv(envar.IonosToken)
114+
username := os.Getenv(envar.IonosUsername)
115+
password := os.Getenv(envar.IonosPassword)
116+
insecureStr := os.Getenv(envar.IonosInsecure)
117+
version := ionoscloud.Version
118+
119+
insecureBool := false
120+
if insecureStr != "" {
121+
boolValue, err := strconv.ParseBool(insecureStr)
122+
if err != nil {
123+
log.Fatal(err)
124+
}
125+
insecureBool = boolValue
126+
}
127+
128+
return monitoringService.NewClient(username, password, token, "", version, "", insecureBool)
129+
}

0 commit comments

Comments
 (0)