-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #187 from ably/feature/INF-5307-add-ingress-rules
[INF-5307] - Add the MongoDB & PostgreSQL Outbox Ably Ingress Rules
- Loading branch information
Showing
24 changed files
with
1,014 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Copyright 2022 Ably Real-time Ltd (ably.com) | ||
Copyright 2024 Ably Real-time Ltd (ably.com) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "ably_ingress_rule_mongodb Resource - terraform-provider-ably" | ||
subcategory: "" | ||
description: |- | ||
The ably_ingress_rule_mongodb resource sets up a MongoDB Integration Rule to stream document changes from a database collection over Ably. | ||
--- | ||
|
||
# ably_ingress_rule_mongodb (Resource) | ||
|
||
The `ably_ingress_rule_mongodb` resource sets up a MongoDB Integration Rule to stream document changes from a database collection over Ably. | ||
|
||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `app_id` (String) The Ably application ID. | ||
- `target` (Attributes) object (rule_source) (see [below for nested schema](#nestedatt--target)) | ||
|
||
### Optional | ||
|
||
- `status` (String) The status of the rule. Rules can be enabled or disabled. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The rule ID. | ||
|
||
<a id="nestedatt--target"></a> | ||
### Nested Schema for `target` | ||
|
||
Required: | ||
|
||
- `collection` (String) What the connector should watch within the database. The connector only supports watching collections. | ||
- `database` (String) The MongoDB Database Name | ||
- `full_document` (String) Controls whether the full document should be included in the published change events. Full Document is not available by default in all types of change event. Possible values are `updateLookup`, `whenAvailable`, `off`. The default is `off`. | ||
- `full_document_before_change` (String) Controls whether the full document before the change should be included in the change event. Full Document before change is not available on all types of change event. Possible values are `whenAvailable` or `off`. The default is `off`. | ||
- `pipeline` (String) A MongoDB pipeline to pass to the Change Stream API. This field allows you to control which types of change events are published, and which channel the change event should be published to. The pipeline must set the _ablyChannel field on the root of the change event. It must also be a valid JSON array of pipeline operations. | ||
- `primary_site` (String) The primary site that the connector will run in. You should choose a site that is close to your database. | ||
- `url` (String) The connection string of your MongoDB instance. (e.g. mongodb://user:pass@myhost.com) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "ably_ingress_rule_postgres_outbox Resource - terraform-provider-ably" | ||
subcategory: "" | ||
description: |- | ||
The ably_ingress_rule_postgres_outbox resource Use the Postgres database connector to distribute changes from your Postgres database to end users at scale. It enables you to distribute records using the outbox pattern to large numbers of subscribing clients, in realtime, as the changes occur. | ||
--- | ||
|
||
# ably_ingress_rule_postgres_outbox (Resource) | ||
|
||
The `ably_ingress_rule_postgres_outbox` resource Use the Postgres database connector to distribute changes from your Postgres database to end users at scale. It enables you to distribute records using the outbox pattern to large numbers of subscribing clients, in realtime, as the changes occur. | ||
|
||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `app_id` (String) The Ably application ID. | ||
- `target` (Attributes) object (rule_source) (see [below for nested schema](#nestedatt--target)) | ||
|
||
### Optional | ||
|
||
- `status` (String) The status of the rule. Rules can be enabled or disabled. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The rule ID. | ||
|
||
<a id="nestedatt--target"></a> | ||
### Nested Schema for `target` | ||
|
||
Required: | ||
|
||
- `nodes_table_name` (String) Name for the nodes table. | ||
- `nodes_table_schema` (String) Schema for the nodes table in your database to allow for operation as a cluster to provide fault tolerance. | ||
- `outbox_table_name` (String) Name for the outbox table. | ||
- `outbox_table_schema` (String) Schema for the outbox table in your database, which allows for the reliable publication of an ordered sequence of change event messages over Ably. | ||
- `primary_site` (String) The primary data center in which to run the integration rule. | ||
- `ssl_mode` (String) Determines the level of protection provided by the SSL connection. Options are: | ||
- prefer: Attempt SSL but allow non-SSL. | ||
- require: Always use SSL but don't verify certificates. | ||
- verify-ca: Verify server certificate is signed by a trusted CA. | ||
- verify-full: Verify server certificate and hostname. | ||
|
||
Default: prefer. | ||
- `url` (String) The URL for your Postgres database, for example postgres://user:password@example.com:5432/your-database-name. The associated user must have the correct privileges | ||
|
||
Optional: | ||
|
||
- `ssl_root_cert` (String) Optional. Specifies the SSL certificate authority (CA) certificates. Required if SSL mode is verify-ca or verify-full. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
resource "ably_ingress_rule_mongodb" "rule0" { | ||
app_id = ably_app.app0.id | ||
status = "enabled" | ||
target = { | ||
url = "mongodb://${var.mongodb_user}:${var.mongodb_password}@${var.mongodb_host}:27017" | ||
database = "coconut" | ||
collection = "coconut" | ||
pipeline = jsonencode([ | ||
{ | ||
"$set" = { | ||
"_ablyChannel" = "myChannel" | ||
} | ||
} | ||
]) | ||
full_document = "off" | ||
full_document_before_change = "off" | ||
primary_site = "us-east-1-A" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
resource "ably_ingress_rule_postgres_outbox" "rule0" { | ||
app_id = ably_app.app0.id | ||
status = "enabled" | ||
target = { | ||
url = "postgres://${var.postgres_user}:${var.postgres_password}@${var.postgres_host}:5432/${var.postgres_db}" | ||
outbox_table_schema = "public" | ||
outbox_table_name = "outbox" | ||
nodes_table_schema = "public" | ||
nodes_table_name = "nodes" | ||
ssl_mode = "prefer" | ||
ssl_root_cert = "-----BEGIN CERTIFICATE----- MIIFiTCCA3GgAwIBAgIUYO1Lomxzj7VRawWwEFiQht9OLpUwDQYJKoZIhvcNAQEL BQAwTDELMAkGA1UEBhMCVVMxETAPBgNVBAgMCE1pY2hpZ2FuMQ8wDQYDVQQHDAZX ...snip... TOfReTlUQzgpXRW5h3n2LVXbXQhPGcVitb88Cm2R8cxQwgB1VncM8yvmKhREo2tz 7Y+sUx6eIl4dlNl9kVrH1TD3EwwtGsjUNlFSZhg= -----END CERTIFICATE-----" | ||
primary_site = "us-east-1-A" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
variable "mongodb_user" { | ||
description = "MongoDB username" | ||
sensitive = true | ||
default = "test" | ||
} | ||
|
||
variable "mongodb_password" { | ||
description = "MongoDB password" | ||
sensitive = true | ||
default = "test" | ||
} | ||
|
||
variable "mongodb_host" { | ||
description = "MongoDB host" | ||
default = "test" | ||
} | ||
|
||
variable "postgres_user" { | ||
description = "PostgreSQL username" | ||
sensitive = true | ||
default = "test" | ||
} | ||
|
||
variable "postgres_password" { | ||
description = "PostgreSQL password" | ||
sensitive = true | ||
default = "test" | ||
} | ||
|
||
variable "postgres_host" { | ||
description = "PostgreSQL host" | ||
default = "test" | ||
} | ||
|
||
variable "postgres_db" { | ||
description = "PostgreSQL database name" | ||
default = "test" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.