Skip to content

Commit

Permalink
chore(userconfig): improve naming and docs (#1420)
Browse files Browse the repository at this point in the history
  • Loading branch information
Serpentiel authored and byashimov committed Nov 2, 2023
1 parent 4c445cb commit 9d01553
Show file tree
Hide file tree
Showing 100 changed files with 7,465 additions and 1,728 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ nav_order: 1

# Changelog

## [X.Y.Z] - YYYY-MM-DD
## [4.10.0] - YYYY-MM-DD

- Add new user config generator
- Use `TypeSet` for arrays with scalar values

## [4.9.3] - 2023-10-27

Expand Down
39 changes: 23 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: build build-dev test test-unit test-acc test-examples lint lint-go lint-test lint-docs fmt fmt-test docs clean clean-tools sweep go-generate generate imports
.PHONY: build build-dev test test-unit test-acc test-examples lint lint-go lint-test lint-docs fmt fmt-test fmt-imports clean clean-tools clean-examples sweep generate gen-go docs

#################################################
# Global
Expand Down Expand Up @@ -83,8 +83,6 @@ test-acc:
TF_ACC=1 $(GO) test ./$(PKG_PATH)/... \
-v -count $(TEST_COUNT) -parallel $(ACC_TEST_PARALLELISM) $(RUNARGS) $(TESTARGS) -timeout $(ACC_TEST_TIMEOUT)

clean-examples:
find ./examples -type f -name '*.tfstate*' -delete

test-examples: build-dev clean-examples
AIVEN_PROVIDER_PATH=$(BUILD_DEV_DIR) $(GO) test --tags=examples ./examples_tests/... \
Expand Down Expand Up @@ -112,42 +110,51 @@ lint-docs: $(TFPLUGINDOCS)
# Format
#################################################

fmt: imports fmt-test
fmt: fmt-test fmt-imports


fmt-test: $(TERRAFMT)
$(TERRAFMT) fmt ./internal -fv

# On MACOS requires gnu-sed. Run `brew info gnu-sed` and follow instructions to replace default sed.
imports:

# macOS requires to install GNU sed first. Use `brew install gnu-sed` to install it.
# It has to be added to PATH as `sed` command, to replace default BSD sed.
# See `brew info gnu-sed` for more details on how to add it to PATH.
fmt-imports:
find . -type f -name '*.go' -exec sed -zi 's/"\n\+\t"/"\n"/g' {} +
goimports -local "github.com/aiven/terraform-provider-aiven" -w .

#################################################
# Docs
#################################################

docs: $(TFPLUGINDOCS)
$(TFPLUGINDOCS) generate

#################################################
# Clean
#################################################

clean: clean-tools sweep
clean: clean-tools clean-examples sweep


clean-tools: $(TOOLS_BIN_DIR)
rm -rf $(TOOLS_BIN_DIR)


clean-examples:
find ./examples -type f -name '*.tfstate*' -delete


SWEEP ?= global

sweep:
@echo 'WARNING: This will destroy infrastructure. Use only in development accounts.'
$(GO) test ./internal/sweep -v -tags=sweep -sweep=$(SWEEP) $(SWEEP_ARGS) -timeout 15m

go-generate:
#################################################
# Generate
#################################################

generate: gen-go fmt-imports docs


gen-go:
go generate ./...


generate: go-generate docs
docs: $(TFPLUGINDOCS)
$(TFPLUGINDOCS) generate
6 changes: 3 additions & 3 deletions docs/data-sources/cassandra.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ Read-Only:

Read-Only:

- `additional_backup_regions` (List of String)
- `additional_backup_regions` (Set of String)
- `backup_hour` (Number)
- `backup_minute` (Number)
- `cassandra` (List of Object) (see [below for nested schema](#nestedobjatt--cassandra_user_config--cassandra))
- `cassandra_version` (String)
- `ip_filter` (List of String)
- `ip_filter` (Set of String)
- `ip_filter_object` (List of Object) (see [below for nested schema](#nestedobjatt--cassandra_user_config--ip_filter_object))
- `ip_filter_string` (List of String)
- `ip_filter_string` (Set of String)
- `migrate_sstableloader` (Boolean)
- `private_access` (List of Object) (see [below for nested schema](#nestedobjatt--cassandra_user_config--private_access))
- `project_to_fork_from` (String)
Expand Down
6 changes: 3 additions & 3 deletions docs/data-sources/clickhouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ Read-Only:

Read-Only:

- `additional_backup_regions` (List of String)
- `ip_filter` (List of String)
- `additional_backup_regions` (Set of String)
- `ip_filter` (Set of String)
- `ip_filter_object` (List of Object) (see [below for nested schema](#nestedobjatt--clickhouse_user_config--ip_filter_object))
- `ip_filter_string` (List of String)
- `ip_filter_string` (Set of String)
- `private_access` (List of Object) (see [below for nested schema](#nestedobjatt--clickhouse_user_config--private_access))
- `privatelink_access` (List of Object) (see [below for nested schema](#nestedobjatt--clickhouse_user_config--privatelink_access))
- `project_to_fork_from` (String)
Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/flink.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ Read-Only:
Read-Only:

- `flink_version` (String)
- `ip_filter` (List of String)
- `ip_filter` (Set of String)
- `ip_filter_object` (List of Object) (see [below for nested schema](#nestedobjatt--flink_user_config--ip_filter_object))
- `ip_filter_string` (List of String)
- `ip_filter_string` (Set of String)
- `number_of_task_slots` (Number)
- `privatelink_access` (List of Object) (see [below for nested schema](#nestedobjatt--flink_user_config--privatelink_access))

Expand Down
24 changes: 12 additions & 12 deletions docs/data-sources/grafana.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Read-Only:

Read-Only:

- `additional_backup_regions` (List of String)
- `additional_backup_regions` (Set of String)
- `alerting_enabled` (Boolean)
- `alerting_error_or_timeout` (String)
- `alerting_max_annotations_to_keep` (Number)
Expand All @@ -106,9 +106,9 @@ Read-Only:
- `editors_can_admin` (Boolean)
- `external_image_storage` (List of Object) (see [below for nested schema](#nestedobjatt--grafana_user_config--external_image_storage))
- `google_analytics_ua_id` (String)
- `ip_filter` (List of String)
- `ip_filter` (Set of String)
- `ip_filter_object` (List of Object) (see [below for nested schema](#nestedobjatt--grafana_user_config--ip_filter_object))
- `ip_filter_string` (List of String)
- `ip_filter_string` (Set of String)
- `metrics_enabled` (Boolean)
- `oauth_allow_insecure_email_lookup` (Boolean)
- `private_access` (List of Object) (see [below for nested schema](#nestedobjatt--grafana_user_config--private_access))
Expand All @@ -129,8 +129,8 @@ Read-Only:
Read-Only:

- `allow_sign_up` (Boolean)
- `allowed_domains` (List of String)
- `allowed_groups` (List of String)
- `allowed_domains` (Set of String)
- `allowed_groups` (Set of String)
- `auth_url` (String)
- `client_id` (String)
- `client_secret` (String)
Expand All @@ -143,15 +143,15 @@ Read-Only:
Read-Only:

- `allow_sign_up` (Boolean)
- `allowed_domains` (List of String)
- `allowed_organizations` (List of String)
- `allowed_domains` (Set of String)
- `allowed_organizations` (Set of String)
- `api_url` (String)
- `auth_url` (String)
- `auto_login` (Boolean)
- `client_id` (String)
- `client_secret` (String)
- `name` (String)
- `scopes` (List of String)
- `scopes` (Set of String)
- `token_url` (String)


Expand All @@ -161,10 +161,10 @@ Read-Only:
Read-Only:

- `allow_sign_up` (Boolean)
- `allowed_organizations` (List of String)
- `allowed_organizations` (Set of String)
- `client_id` (String)
- `client_secret` (String)
- `team_ids` (List of Number)
- `team_ids` (Set of Number)


<a id="nestedobjatt--grafana_user_config--auth_gitlab"></a>
Expand All @@ -173,7 +173,7 @@ Read-Only:
Read-Only:

- `allow_sign_up` (Boolean)
- `allowed_groups` (List of String)
- `allowed_groups` (Set of String)
- `api_url` (String)
- `auth_url` (String)
- `client_id` (String)
Expand All @@ -187,7 +187,7 @@ Read-Only:
Read-Only:

- `allow_sign_up` (Boolean)
- `allowed_domains` (List of String)
- `allowed_domains` (Set of String)
- `client_id` (String)
- `client_secret` (String)

Expand Down
6 changes: 3 additions & 3 deletions docs/data-sources/influxdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ Read-Only:

Read-Only:

- `additional_backup_regions` (List of String)
- `additional_backup_regions` (Set of String)
- `custom_domain` (String)
- `influxdb` (List of Object) (see [below for nested schema](#nestedobjatt--influxdb_user_config--influxdb))
- `ip_filter` (List of String)
- `ip_filter` (Set of String)
- `ip_filter_object` (List of Object) (see [below for nested schema](#nestedobjatt--influxdb_user_config--ip_filter_object))
- `ip_filter_string` (List of String)
- `ip_filter_string` (Set of String)
- `private_access` (List of Object) (see [below for nested schema](#nestedobjatt--influxdb_user_config--private_access))
- `privatelink_access` (List of Object) (see [below for nested schema](#nestedobjatt--influxdb_user_config--privatelink_access))
- `project_to_fork_from` (String)
Expand Down
6 changes: 3 additions & 3 deletions docs/data-sources/kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ Read-Only:

Read-Only:

- `additional_backup_regions` (List of String)
- `additional_backup_regions` (Set of String)
- `custom_domain` (String)
- `ip_filter` (List of String)
- `ip_filter` (Set of String)
- `ip_filter_object` (List of Object) (see [below for nested schema](#nestedobjatt--kafka_user_config--ip_filter_object))
- `ip_filter_string` (List of String)
- `ip_filter_string` (Set of String)
- `kafka` (List of Object) (see [below for nested schema](#nestedobjatt--kafka_user_config--kafka))
- `kafka_authentication_methods` (List of Object) (see [below for nested schema](#nestedobjatt--kafka_user_config--kafka_authentication_methods))
- `kafka_connect` (Boolean)
Expand Down
6 changes: 3 additions & 3 deletions docs/data-sources/kafka_connect.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ Read-Only:

Read-Only:

- `additional_backup_regions` (List of String)
- `ip_filter` (List of String)
- `additional_backup_regions` (Set of String)
- `ip_filter` (Set of String)
- `ip_filter_object` (List of Object) (see [below for nested schema](#nestedobjatt--kafka_connect_user_config--ip_filter_object))
- `ip_filter_string` (List of String)
- `ip_filter_string` (Set of String)
- `kafka_connect` (List of Object) (see [below for nested schema](#nestedobjatt--kafka_connect_user_config--kafka_connect))
- `private_access` (List of Object) (see [below for nested schema](#nestedobjatt--kafka_connect_user_config--private_access))
- `privatelink_access` (List of Object) (see [below for nested schema](#nestedobjatt--kafka_connect_user_config--privatelink_access))
Expand Down
6 changes: 3 additions & 3 deletions docs/data-sources/kafka_mirrormaker.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ Read-Only:

Read-Only:

- `additional_backup_regions` (List of String)
- `ip_filter` (List of String)
- `additional_backup_regions` (Set of String)
- `ip_filter` (Set of String)
- `ip_filter_object` (List of Object) (see [below for nested schema](#nestedobjatt--kafka_mirrormaker_user_config--ip_filter_object))
- `ip_filter_string` (List of String)
- `ip_filter_string` (Set of String)
- `kafka_mirrormaker` (List of Object) (see [below for nested schema](#nestedobjatt--kafka_mirrormaker_user_config--kafka_mirrormaker))
- `static_ips` (Boolean)

Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/m3aggregator.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ Read-Only:
Read-Only:

- `custom_domain` (String)
- `ip_filter` (List of String)
- `ip_filter` (Set of String)
- `ip_filter_object` (List of Object) (see [below for nested schema](#nestedobjatt--m3aggregator_user_config--ip_filter_object))
- `ip_filter_string` (List of String)
- `ip_filter_string` (Set of String)
- `m3_version` (String)
- `m3aggregator_version` (String)
- `static_ips` (Boolean)
Expand Down
12 changes: 6 additions & 6 deletions docs/data-sources/m3db.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ Read-Only:

Read-Only:

- `additional_backup_regions` (List of String)
- `additional_backup_regions` (Set of String)
- `custom_domain` (String)
- `ip_filter` (List of String)
- `ip_filter` (Set of String)
- `ip_filter_object` (List of Object) (see [below for nested schema](#nestedobjatt--m3db_user_config--ip_filter_object))
- `ip_filter_string` (List of String)
- `ip_filter_string` (Set of String)
- `limits` (List of Object) (see [below for nested schema](#nestedobjatt--m3db_user_config--limits))
- `m3` (List of Object) (see [below for nested schema](#nestedobjatt--m3db_user_config--m3))
- `m3_version` (String)
Expand Down Expand Up @@ -200,13 +200,13 @@ Read-Only:

Read-Only:

- `aggregations` (List of String)
- `aggregations` (Set of String)
- `drop` (Boolean)
- `filter` (String)
- `name` (String)
- `namespaces` (List of String)
- `namespaces` (Set of String)
- `namespaces_object` (List of Object) (see [below for nested schema](#nestedobjatt--m3db_user_config--rules--mapping--namespaces_object))
- `namespaces_string` (List of String)
- `namespaces_string` (Set of String)
- `tags` (List of Object) (see [below for nested schema](#nestedobjatt--m3db_user_config--rules--mapping--tags))

<a id="nestedobjatt--m3db_user_config--rules--mapping--namespaces_object"></a>
Expand Down
6 changes: 3 additions & 3 deletions docs/data-sources/mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ Read-Only:

Read-Only:

- `additional_backup_regions` (List of String)
- `additional_backup_regions` (Set of String)
- `admin_password` (String)
- `admin_username` (String)
- `backup_hour` (Number)
- `backup_minute` (Number)
- `binlog_retention_period` (Number)
- `ip_filter` (List of String)
- `ip_filter` (Set of String)
- `ip_filter_object` (List of Object) (see [below for nested schema](#nestedobjatt--mysql_user_config--ip_filter_object))
- `ip_filter_string` (List of String)
- `ip_filter_string` (Set of String)
- `migration` (List of Object) (see [below for nested schema](#nestedobjatt--mysql_user_config--migration))
- `mysql` (List of Object) (see [below for nested schema](#nestedobjatt--mysql_user_config--mysql))
- `mysql_version` (String)
Expand Down
8 changes: 4 additions & 4 deletions docs/data-sources/opensearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ Read-Only:

Read-Only:

- `additional_backup_regions` (List of String)
- `additional_backup_regions` (Set of String)
- `custom_domain` (String)
- `disable_replication_factor_adjustment` (Boolean)
- `index_patterns` (List of Object) (see [below for nested schema](#nestedobjatt--opensearch_user_config--index_patterns))
- `index_template` (List of Object) (see [below for nested schema](#nestedobjatt--opensearch_user_config--index_template))
- `ip_filter` (List of String)
- `ip_filter` (Set of String)
- `ip_filter_object` (List of Object) (see [below for nested schema](#nestedobjatt--opensearch_user_config--ip_filter_object))
- `ip_filter_string` (List of String)
- `ip_filter_string` (Set of String)
- `keep_index_refresh_interval` (Boolean)
- `max_index_count` (Number)
- `openid` (List of Object) (see [below for nested schema](#nestedobjatt--opensearch_user_config--openid))
Expand Down Expand Up @@ -176,7 +176,7 @@ Read-Only:
- `indices_recovery_max_bytes_per_sec` (Number)
- `indices_recovery_max_concurrent_file_chunks` (Number)
- `override_main_response_version` (Boolean)
- `reindex_remote_whitelist` (List of String)
- `reindex_remote_whitelist` (Set of String)
- `script_max_compilations_rate` (String)
- `search_max_buckets` (Number)
- `thread_pool_analyze_queue_size` (Number)
Expand Down
8 changes: 4 additions & 4 deletions docs/data-sources/pg.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ Read-Only:

Read-Only:

- `additional_backup_regions` (List of String)
- `additional_backup_regions` (Set of String)
- `admin_password` (String)
- `admin_username` (String)
- `backup_hour` (Number)
- `backup_minute` (Number)
- `enable_ipv6` (Boolean)
- `ip_filter` (List of String)
- `ip_filter` (Set of String)
- `ip_filter_object` (List of Object) (see [below for nested schema](#nestedobjatt--pg_user_config--ip_filter_object))
- `ip_filter_string` (List of String)
- `ip_filter_string` (Set of String)
- `migration` (List of Object) (see [below for nested schema](#nestedobjatt--pg_user_config--migration))
- `pg` (List of Object) (see [below for nested schema](#nestedobjatt--pg_user_config--pg))
- `pg_read_replica` (Boolean)
Expand Down Expand Up @@ -210,7 +210,7 @@ Read-Only:
- `autodb_max_db_connections` (Number)
- `autodb_pool_mode` (String)
- `autodb_pool_size` (Number)
- `ignore_startup_parameters` (List of String)
- `ignore_startup_parameters` (Set of String)
- `min_pool_size` (Number)
- `server_idle_timeout` (Number)
- `server_lifetime` (Number)
Expand Down
Loading

0 comments on commit 9d01553

Please sign in to comment.