Skip to content

Commit

Permalink
Merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Hume committed Dec 1, 2023
2 parents 2da2b7e + f0779c9 commit 878b4e2
Show file tree
Hide file tree
Showing 158 changed files with 4,397 additions and 2,139 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
pull_request:
paths:
- pkg/**
- main.go
- go.mod
schedule:
- cron: 0 11 * * 0

Expand All @@ -12,6 +14,11 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions/setup-go@v4
with:
go-version-file: "go.mod"
cache: true

- name: Docker Compose Up
run: docker compose up --build -d

Expand All @@ -20,7 +27,7 @@ jobs:
env:
MZ_HOST: localhost
MZ_USER: mz_system
MZ_SSLMODE: "false"
MZ_SSLMODE: disable
MZ_PORT: 6877

- name: Docker Compose Down
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- pkg/**
- examples/**
- templates/**
- README.md

jobs:
documentation:
Expand All @@ -18,12 +19,11 @@ jobs:

- uses: actions/setup-go@v4
with:
go-version: 1.19

- run: go mod download
go-version-file: "go.mod"
cache: true

- run: go generate ./...

- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Terraform Docs
commit_message: Terraform Docs
2 changes: 2 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
paths:
- pkg/**
- integration/**
- main.go
- go.mod
schedule:
- cron: 0 11 * * 0

Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
pull_request:
paths:
- pkg/**
- main.go
- go.mod

jobs:
test:
Expand All @@ -12,8 +14,7 @@ jobs:

- uses: actions/setup-go@v4
with:
go-version: 1.19
go-version-file: "go.mod"
cache: true

- run: go mod download

- run: go test -v -cover ./...
- run: go test -v -cover ./...
102 changes: 98 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,112 @@
# Changelog

## 0.2.0 - 2023-10-30
## Unreleased

## 0.3.3 - 2023-11-30

### Features
* Add `default` to columns when defining a `materialize_table` [#374](https://github.com/MaterializeInc/terraform-provider-materialize/pull/374)
* Add `expose_progress` to `materialize_source_load_generator` [#374](https://github.com/MaterializeInc/terraform-provider-materialize/pull/374)
* Support [row type](https://materialize.com/docs/sql/create-type/#row-properties) in `materialize_type` [#374](https://github.com/MaterializeInc/terraform-provider-materialize/pull/374)

### BugFixes
* Fix `expose_progress` in `materialize_source_postgres` and `materialize_source_kafka` [#374](https://github.com/MaterializeInc/terraform-provider-materialize/pull/374)
* Fix `start_offset` in `materialize_source_kafka` [#374](https://github.com/MaterializeInc/terraform-provider-materialize/pull/374)
* Allow `replication_factor` of 0 for `materialize_cluster` [#390](https://github.com/MaterializeInc/terraform-provider-materialize/pull/390)

### Misc
* Set `replication_factor` as computed in `materialize_cluster` [#374](https://github.com/MaterializeInc/terraform-provider-materialize/pull/374)

### Breaking Changes
* Provider configuration parameters so that they are consistent across all components [#339](https://github.com/MaterializeInc/terraform-provider-materialize/pull/339):
* The configuration variable `username` is changed to `user`
* The environment variable `MZ_PW` is changed to `MZ_PASSWORD`
* Remove `session_variables` from `materialize_role` [#374](https://github.com/MaterializeInc/terraform-provider-materialize/pull/374)

## 0.3.2 - 2023-11-24

### Features

### BugFixes
* Fix default grant read [#381](https://github.com/MaterializeInc/terraform-provider-materialize/pull/381)

### Misc

## 0.3.1 - 2023-11-21

### Features
* Add `security_protocol` to `materialize_connection_kafka` [#365](https://github.com/MaterializeInc/terraform-provider-materialize/pull/365)

### BugFixes

* Handle `user` values that contain special characters, without requiring manual
URL escaping (e.g., escaping `[email protected]` as `you%40corp.com`) [#372](https://github.com/MaterializeInc/terraform-provider-materialize/pull/372)
* Load generator source `TPCH` requires `ALL TABLES` [#377](https://github.com/MaterializeInc/terraform-provider-materialize/pull/377)
* Improve grant reads [#378](https://github.com/MaterializeInc/terraform-provider-materialize/pull/378)

### Misc
* `materialize_cluster_replica` is deprecated [#370](https://github.com/MaterializeInc/terraform-provider-materialize/pull/370)
* Raise `max_clusters` for testing [#371](https://github.com/MaterializeInc/terraform-provider-materialize/pull/371)

## 0.3.0 - 2023-11-16

### Features
* Add `key_not_enforced` to `materialize_sink_kafka` [#361](https://github.com/MaterializeInc/terraform-provider-materialize/pull/361)

### BugFixes
* Fix a bug where topics were defined after keys in `materialize_sink_kafka` create statements [#358](https://github.com/MaterializeInc/terraform-provider-materialize/pull/358)
* Correct `ForceNew` for column attributes in `materialize_table` [#363](https://github.com/MaterializeInc/terraform-provider-materialize/pull/363)

### Misc
* Update go.mod version to `1.20` [#369](https://github.com/MaterializeInc/terraform-provider-materialize/pull/369)

### Breaking Changes
* Previously, blocks within resources that included optional `schema_name` and `database_name` attributes would inherit the top level attributes of the resource if set. So in the following example:
```
resource "materialize_source_postgres" "example_source_postgres" {
name = "source_postgres"
schema_name = "my_schema"
database_name = "my_database"
postgres_connection {
name = "postgres_connection"
}
}
```
The Postgres connection would have the schema name of `my_schema` and database name `my_database`. Now, if `schema_name` or `database_name` are not set, they will use the same defaults as top level attributes (`public` for schema and `materialize` for database) [#353](https://github.com/MaterializeInc/terraform-provider-materialize/pull/353)

## 0.2.2 - 2023-11-10

### Features
* Include detail and hint messages for SQL errors [#354](https://github.com/MaterializeInc/terraform-provider-materialize/pull/354)

### BugFixes

### Misc

## 0.2.1 - 2023-11-09

### Features
* Support `ASSERT NOT NULL` for materialized view resource [#341](https://github.com/MaterializeInc/terraform-provider-materialize/pull/341)

### BugFixes

### Misc
* Update testing plugin [#345](https://github.com/MaterializeInc/terraform-provider-materialize/pull/345)

### Breaking Changes
* Update header attributes for `materialize_source_webhook`. Adds `include_header` and is now a complex type `include_headers` and no longer boolean [#346](https://github.com/MaterializeInc/terraform-provider-materialize/pull/346)

## 0.2.0 - 2023-10-30

### Features

### BugFixes

### Misc

### Breaking Changes
* Provider configuration parameters so that they are consistent across all components [#339](https://github.com/MaterializeInc/terraform-provider-materialize/pull/339):
* The configuration variable `username` is changed to `user`
* The environment variable `MZ_PW` is changed to `MZ_PASSWORD`

## 0.1.14 - 2023-10-25

### Features
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ To run the acceptance tests which will simulate running Terraform commands you w
```bash
export MZ_HOST=localhost
export MZ_USER=mz_system
export MZ_SSLMODE="false"
export MZ_SSLMODE=disable
export MZ_PORT=6877

# Start all containers
Expand Down Expand Up @@ -175,7 +175,7 @@ Schema: map[string]*schema.Schema{
Type: schema.TypeString,
Computed: true,
},
"size": { // Add new field
"size": { // Add new field
Type: schema.TypeString,
Computed: true,
},
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19-alpine
FROM golang:1.20-alpine

COPY --from=hashicorp/terraform:1.3.1 /bin/terraform /bin/terraform

Expand All @@ -11,4 +11,4 @@ COPY . .

RUN go build -o ~/.terraform.d/plugins/materialize.com/devex/materialize/0.1/linux_amd64/terraform-provider-materialize

WORKDIR /usr/src/app/integration
WORKDIR /usr/src/app/integration
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ resource "materialize_connection_kafka" "kafka_connection" {
kafka_broker {
broker = "b-1.hostname-1:9096"
}
sasl_username = {
sasl_username {
text = "user"
}
sasl_password {
Expand Down
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,21 @@ services:
- 6878:6878
healthcheck: {test: curl -f localhost:6878/api/readyz, interval: 1s, start_period: 35s}

init:
image: postgres
container_name: materialized_init
depends_on:
materialized: {condition: service_healthy}
command: >-
sh -c '
echo "Waiting for materialized to start..." &&
sleep 15 &&
psql -h materialized -U mz_system -d materialize -p 6877 -c "ALTER SYSTEM SET max_clusters = 100;" &&
psql -h materialized -U mz_system -d materialize -p 6877 -c "ALTER SYSTEM SET max_sources = 100;"
'
redpanda:
container_name: redpanda
image: docker.vectorized.io/vectorized/redpanda:v21.11.2
command:
- redpanda start
Expand Down Expand Up @@ -64,6 +78,7 @@ services:
container_name: provider
depends_on:
materialized: {condition: service_healthy}
redpanda: {condition: service_healthy}
volumes:
- ./integration:/usr/src/app/integration
environment:
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "materialize_cluster Resource - terraform-provider-materialize"
subcategory: ""
description: |-
Clusters describe logical compute resources that can be used by sources, sinks, indexes, and materialized views.
Clusters describe logical compute resources that can be used by sources, sinks, indexes, and materialized views. Managed clusters are created by setting the size attribute
---

# materialize_cluster (Resource)

Clusters describe logical compute resources that can be used by sources, sinks, indexes, and materialized views.
Clusters describe logical compute resources that can be used by sources, sinks, indexes, and materialized views. Managed clusters are created by setting the `size` attribute

## Example Usage

Expand Down
52 changes: 52 additions & 0 deletions docs/resources/cluster_replica
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
page_title: "materialize_cluster_replica Resource - terraform-provider-materialize"
subcategory: ""
description: |-
Cluster replicas allocate physical compute resources for a cluster.
---

# materialize_cluster_replica (Resource)

Cluster replicas allocate physical compute resources for a cluster.

*Note*: Cluster replicas are deprecated. We recommend migrating to a managed cluster using the `materialize_cluster` resource and selecting `size`.

## Example Usage

```terraform
resource "materialize_cluster_replica" "example_cluster_replica" {
name = "replica"
cluster_name = "cluster"
size = "2xsmall"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `cluster_name` (String) The cluster whose resources you want to create an additional computation of.
- `name` (String) The identifier for the replica.
- `size` (String) The size of the replica.

### Optional

- `availability_zone` (String) The specific availability zone of the replica.
- `comment` (String) **Private Preview** Comment on an object in the database.
- `disk` (Boolean) **Private Preview**. Whether or not the replica is a _disk-backed replica_.
- `id` (String) The ID of this resource.
- `idle_arrangement_merge_effort` (Number) The amount of effort to exert compacting arrangements during idle periods. This is an unstable option! It may be changed or removed at any time.
- `introspection_debugging` (Boolean) Whether to introspect the gathering of the introspection data.
- `introspection_interval` (String) The interval at which to collect introspection data.

## Import

Import is supported using the following syntax:

```shell
# Cluster replicas can be imported using the cluster replica id:
terraform import materialize_cluster_replica.example_1_cluster_replica <cluster_replica_id>

# Cluster replica id and information be found in the `mz_catalog.mz_cluster_replicas` table
```
Loading

0 comments on commit 878b4e2

Please sign in to comment.