diff --git a/docs/resources/bigquery_warehouse.md b/docs/resources/bigquery_warehouse.md
index 556709b..f2aa31f 100644
--- a/docs/resources/bigquery_warehouse.md
+++ b/docs/resources/bigquery_warehouse.md
@@ -7,9 +7,7 @@ description: |-
# montecarlo_bigquery_warehouse (Resource)
-Represents the integration of the **Monte Carlo** platform with _BigQuery_ data warehouse. While this resource is not responsible for handling data access and other operations, such as data filtering, it is **responsible for managing the connection** to the _BigQuery_ using the provided service account key.
-
-> **Warning:** Current implementations of _warehouse_ resources are not capable of fetching credentials for given _warehouse_ from the **Monte Carlo** APIs. For this reason its not possible for this resource to detect whether the credentials have been changed externally in the **Monte Carlo**. You can force credentials update by changing remote instance state and re-running your _Terraform_ commands.
+Represents the integration of the **Monte Carlo** platform with _BigQuery_ data warehouse. While this resource is not responsible for handling data access and other operations, such as data filtering, it is **responsible for managing the connection** to the _BigQuery_ using the provided service account key.
To get more information about **Monte Carlo** warehouses, see:
- [API documentation](https://apidocs.getmontecarlo.com/#definition-Warehouse)
@@ -24,7 +22,8 @@ To get more information about **Monte Carlo** warehouses, see:
resource "montecarlo_bigquery_warehouse" "example" {
name = "name"
collector_uuid = "uuid"
- service_account_key = "{...}"
+ credentials = { service_account_key = "{...}" }
+ deletion_protection = false
}
```
@@ -42,9 +41,7 @@ resource "montecarlo_bigquery_warehouse" "example" {
- If changed in the remote instance state, resource instance will be **removed** from the _Terraform_ state, but not deleted (leading to a new resource creation on the next `terraform plan/apply`).
-- `service_account_key` (String, Sensitive) Service account key used by the warehouse connection for authentication and authorization against _BigQuery_. The very same service account is used to grant required permissions to _Monte Carlo BigQuery warehouse_ for the data access. For more information follow **Monte Carlo** documentation: https://docs.getmontecarlo.com/docs/bigquery.
-
- - The key must be provided as raw **JSON** string (_as obtained when downloaded from GCP UI_), otherwise this reasource will fail during _Terraform_ commands.
+- `credentials` (Attributes nested) Configuration options used by the warehouse connection for authentication and authorization against _BigQuery_. (see [below for nested schema](#nestedatt--credentials))
### Optional
@@ -54,9 +51,22 @@ resource "montecarlo_bigquery_warehouse" "example" {
- `uuid` (String) Unique identifier of warehouse managed by this resource.
+
+### Nested Schema for `credentials`
+
+Required:
+
+- `service_account_key` (String, Sensitive) Service account key used by the warehouse connection for authentication and authorization against _BigQuery_. The very same service account is used to grant required permissions to _Monte Carlo BigQuery warehouse_ for the data access. For more information follow **Monte Carlo** documentation: https://docs.getmontecarlo.com/docs/bigquery.
+
+ - The key must be provided as raw **JSON** string (_as obtained when downloaded from GCP UI_), otherwise this reasource will fail during _Terraform_ commands.
+
+Read Only:
+
- `connection_uuid` (String) Unique identifier of connection managed by this resource, responsible for communication with _BigQuery_.
- - if _connection type_ of the connection managed by this reasource changes externally, this reasource **will fail to read** external state (_blocking any further resource functionality_). In such scenario a manual intervention is required.
+ - if _connection type_ of the connection managed by this reasource changes externally, this reasource **will fail to read** external state (_blocking any further resource functionality_). In such scenario a manual intervention is required.
+
+- `updated_at` (String) **Timestamp** of the last update in credentials done by this resource. This information is used mainly to detect drift changes in credentials _(external change)_.
diff --git a/docs/resources/transactional_warehouse.md b/docs/resources/transactional_warehouse.md
index 91a3d1f..d01542a 100644
--- a/docs/resources/transactional_warehouse.md
+++ b/docs/resources/transactional_warehouse.md
@@ -7,9 +7,7 @@ description: |-
# montecarlo_transactional_warehouse (Resource)
-Represents the integration of the **Monte Carlo** platform with _Transactional_ data warehouse. While this resource is not responsible for handling data access and other operations, such as data filtering, it is **responsible for managing the connection** to the _Transactional DB_ using the provided configuration.
-
-> **Warning:** Current implementations of _warehouse_ resources are not capable of fetching credentials for given _warehouse_ from the **Monte Carlo** APIs. For this reason its not possible for this resource to detect whether the database configuration has been changed externally in the **Monte Carlo**. You can force database configuration update by changing remote instance state and re-running your _Terraform_ commands.
+Represents the integration of the **Monte Carlo** platform with _Transactional_ data warehouse. While this resource is not responsible for handling data access and other operations, such as data filtering, it is **responsible for managing the connection** to the _Transactional DB_ using the provided configuration.
To get more information about **Monte Carlo** warehouses, see:
- [API documentation](https://apidocs.getmontecarlo.com/#definition-Warehouse)
@@ -24,11 +22,12 @@ To get more information about **Monte Carlo** warehouses, see:
```terraform
resource "montecarlo_transactional_warehouse" "example" {
- name = "name"
- collector_uuid = "uuid"
- db_type = "POSTGRES" # POSTGRES | MYSQL | SQL-SERVER
+ name = "name"
+ collector_uuid = "uuid"
+ db_type = "POSTGRES" # POSTGRES | MYSQL | SQL-SERVER
+ deletion_protection = false
- configuration = {
+ credentials = {
host = "host"
port = 5432
database = "database"
@@ -61,7 +60,7 @@ resource "montecarlo_transactional_warehouse" "example" {
> **Warning:** If changed in the remote instance state or in the _Terraform_ configuration, resource instance will be **deleted** (leading to a new resource creation on the next `terraform plan/apply`).
-- `configuration` (Attributes nested) Configuration options used by the warehouse connection for authentication and authorization against _Transactional DB_. (see [below for nested schema](#nestedatt--configuration))
+- `credentials` (Attributes nested) Configuration options used by the warehouse connection for authentication and authorization against _Transactional DB_. (see [below for nested schema](#nestedatt--credentials))
### Optional
@@ -71,12 +70,8 @@ resource "montecarlo_transactional_warehouse" "example" {
- `uuid` (String) Unique identifier of warehouse managed by this resource.
-- `connection_uuid` (String) Unique identifier of connection managed by this resource, responsible for communication with _BigQuery_.
-
- - if _connection type_ of the connection managed by this reasource changes externally, this reasource **will fail to read** external state (_blocking any further resource functionality_). In such scenario a manual intervention is required.
-
-
-### Nested Schema for `configuration`
+
+### Nested Schema for `credentials`
Required:
@@ -91,6 +86,14 @@ Required:
- `username` (String, Sensitive)
+Read Only:
+
+- `connection_uuid` (String) Unique identifier of connection managed by this resource, responsible for communication with _Transactional DB_.
+
+ - if _connection type_ of the connection managed by this reasource changes externally, this reasource **will fail to read** external state (_blocking any further resource functionality_). In such scenario a manual intervention is required.
+
+- `updated_at` (String) **Timestamp** of the last update in credentials done by this resource. This information is used mainly to detect drift changes in credentials _(external change)_.
+
## Import
diff --git a/examples/resources/montecarlo_bigquery_warehouse/resource.tf b/examples/resources/montecarlo_bigquery_warehouse/resource.tf
index a1a6c97..e904bb8 100644
--- a/examples/resources/montecarlo_bigquery_warehouse/resource.tf
+++ b/examples/resources/montecarlo_bigquery_warehouse/resource.tf
@@ -1,5 +1,6 @@
resource "montecarlo_bigquery_warehouse" "example" {
name = "name"
collector_uuid = "uuid"
- service_account_key = "{...}"
+ credentials = { service_account_key = "{...}" }
+ deletion_protection = false
}
diff --git a/examples/resources/montecarlo_transactional_warehouse/resource.tf b/examples/resources/montecarlo_transactional_warehouse/resource.tf
index cd45fe9..e1e269c 100644
--- a/examples/resources/montecarlo_transactional_warehouse/resource.tf
+++ b/examples/resources/montecarlo_transactional_warehouse/resource.tf
@@ -1,9 +1,10 @@
resource "montecarlo_transactional_warehouse" "example" {
- name = "name"
- collector_uuid = "uuid"
- db_type = "POSTGRES" # POSTGRES | MYSQL | SQL-SERVER
+ name = "name"
+ collector_uuid = "uuid"
+ db_type = "POSTGRES" # POSTGRES | MYSQL | SQL-SERVER
+ deletion_protection = false
- configuration = {
+ credentials = {
host = "host"
port = 5432
database = "database"