From c059597b49d35a4d1e5b088b618ba98d604f5f31 Mon Sep 17 00:00:00 2001 From: longhoang Date: Thu, 31 Mar 2022 08:07:21 +0700 Subject: [PATCH 1/9] add oidcProvider to createCluster and indexManagementPlugin to bundleOptions --- Makefile | 2 +- .../valid_elasticsearch_cluster_create.tf | 11 +-- .../data/valid_opensearch_cluster_create.tf | 11 +-- docs/resources/cluster.md | 2 + instaclustr/resource_cluster.go | 8 ++ instaclustr/structs.go | 83 ++++++++++--------- 6 files changed, 66 insertions(+), 51 deletions(-) diff --git a/Makefile b/Makefile index edf4e242..4f921b1a 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ BIN_NAME=terraform-provider-instaclustr # for VERSION, don't add prefix "v", e.g., use "1.9.8" instead of "v1.9.8" as it could break circleCI stuff -VERSION=1.17.0 +VERSION=1.17.1 INSTALL_FOLDER=$(HOME)/.terraform.d/plugins/terraform.instaclustr.com/instaclustr/instaclustr/$(VERSION)/darwin_amd64 diff --git a/acc_test/data/valid_elasticsearch_cluster_create.tf b/acc_test/data/valid_elasticsearch_cluster_create.tf index e8ab9caa..93260def 100644 --- a/acc_test/data/valid_elasticsearch_cluster_create.tf +++ b/acc_test/data/valid_elasticsearch_cluster_create.tf @@ -22,11 +22,12 @@ resource "instaclustr_cluster" "validElasticsearch" { bundle = "ELASTICSEARCH" version = "1.13.3" options = { - dedicated_master_nodes = false, - master_node_size = "t3.small-v2", - data_node_size = "t3.small-v2", - security_plugin=false, - client_encryption=false + dedicated_master_nodes = false, + master_node_size = "t3.small-v2", + data_node_size = "t3.small-v2", + security_plugin = false, + index_management_plugin = true, + client_encryption = false } } } \ No newline at end of file diff --git a/acc_test/data/valid_opensearch_cluster_create.tf b/acc_test/data/valid_opensearch_cluster_create.tf index 4234cbc5..5b0f9ce4 100644 --- a/acc_test/data/valid_opensearch_cluster_create.tf +++ b/acc_test/data/valid_opensearch_cluster_create.tf @@ -22,11 +22,12 @@ resource "instaclustr_cluster" "validOpenSearch" { bundle = "OPENSEARCH" version = "1.2.4" options = { - dedicated_master_nodes = false, - master_node_size = "t3.small-v2", - data_node_size = "t3.small-v2", - security_plugin = true, - client_encryption = true + dedicated_master_nodes = false, + master_node_size = "t3.small-v2", + data_node_size = "t3.small-v2", + security_plugin = true, + index_management_plugin = true + client_encryption = true } } } diff --git a/docs/resources/cluster.md b/docs/resources/cluster.md index 73ee0c38..001af88f 100644 --- a/docs/resources/cluster.md +++ b/docs/resources/cluster.md @@ -27,6 +27,7 @@ Property | Description | Default `kafka_schema_registry_user_password`|The password of kafka schema registry bundle user, if it is a Kafka cluster with schema-registry addon. This field is updatable and requires `wait_for_state` to be `RUNNING`.|Optional `wait_for_state`|The expected state of the cluster before completing the resource creation. Skipping this field will asynchronously create the cluster.|Optional (valid states are RUNNING and PROVISIONED) `kafka_connect_credential`|Sensitive fields pertaining Kafka Connect custom connector bucket credential and sensitive Kafka worker property|Optional. See more details below. +`oidc_provider`|The ID of an OIDC provider to be used for Elasticsearch Kibana or OpenSearch Dashboards. OIDC providers must be set in Console Cluster Resources to be available for use.|Optional ### cluster_provider @@ -82,6 +83,7 @@ Property | Description | For Bundles | Default `kibana_node_size`|Desired master node size. See [here](https://developer.instaclustr.com/#operation/extendedProvisionRequestHandler) for more details. |Elasticsearch| `opensearch_dashboards_node_size`|Desired OpenSearch Dashboards node size. See [here](https://developer.instaclustr.com/#operation/extendedProvisionRequestHandler) for more details. |OpenSearch| `security_plugin`|Accepts true/false. Enables Security Plugin. This option gives an extra layer of security to the cluster. This will automatically enable internode encryption. Enforced to be true for all OpenSearch clusters. |Elasticsearch, OpenSearch|false +`index_management_plugin`|Accepts true/false. Enables Index Management Plugin which allows automating index management activities. |Elasticsearch, OpenSearch|false `use_private_broadcast_rpc_address`|Accepts true/false. Enables broadcast of private IPs for auto-discovery.|Cassandra|false `lucene_enabled`|Accepts true/false. Enabled Cassandra Lucene Index Plugin.|Cassandra|false `continuous_backup_enabled`|Accepts true/false. Enables commitlog backups and increases the frequency of the default snapshot backups.|Cassandra|false diff --git a/instaclustr/resource_cluster.go b/instaclustr/resource_cluster.go index 42e9411c..bc3fff0a 100644 --- a/instaclustr/resource_cluster.go +++ b/instaclustr/resource_cluster.go @@ -329,6 +329,12 @@ func resourceCluster() *schema.Resource { }, }, + "oidc_provider": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "bundles": { Type: schema.TypeSet, Optional: true, @@ -744,6 +750,7 @@ func resourceClusterCreate(d *schema.ResourceData, meta interface{}) error { NodeSize: size, PrivateNetworkCluster: fmt.Sprintf("%v", d.Get("private_network_cluster")), PCICompliantCluster: fmt.Sprintf("%v", d.Get("pci_compliant_cluster")), + OidcProvider: fmt.Sprintf("%v", d.Get("oidc_provider")), } dataCentre := d.Get("data_centre").(string) @@ -1400,6 +1407,7 @@ func resourceClusterRead(d *schema.ResourceData, meta interface{}) error { d.Set("sla_tier", strings.ToUpper(cluster.SlaTier)) d.Set("private_network_cluster", cluster.DataCentres[0].PrivateIPOnly) d.Set("pci_compliant_cluster", cluster.PciCompliance == "ENABLED") + d.Set("oidc_provider", cluster.OidcProvider) azList := make([]string, 0) publicContactPointList := make([]string, 0) diff --git a/instaclustr/structs.go b/instaclustr/structs.go index 5dc110b3..840cdfae 100644 --- a/instaclustr/structs.go +++ b/instaclustr/structs.go @@ -21,46 +21,47 @@ type OmitEmptyBool struct { } type BundleOptions struct { - AuthnAuthz *bool `json:"authnAuthz,omitempty" mapstructure:"auth_n_authz,omitempty"` - ClientEncryption *bool `json:"clientEncryption,omitempty" mapstructure:"client_encryption,omitempty"` - DedicatedMasterNodes *bool `json:"dedicatedMasterNodes,omitempty" mapstructure:"dedicated_master_nodes,omitempty"` - MasterNodeSize string `json:"masterNodeSize,omitempty" mapstructure:"master_node_size,omitempty"` - KibanaNodeSize string `json:"kibanaNodeSize,omitempty" mapstructure:"kibana_node_size,omitempty"` - OpenSearchDashboardsNodeSize string `json:"openSearchDashboardsNodeSize,omitempty" mapstructure:"opensearch_dashboards_node_size,omitempty"` - DataNodeSize string `json:"dataNodeSize,omitempty" mapstructure:"data_node_size,omitempty"` - SecurityPlugin *bool `json:"securityPlugin,omitempty" mapstructure:"security_plugin,omitempty"` - UsePrivateBroadcastRpcAddress *bool `json:"usePrivateBroadcastRPCAddress,omitempty" mapstructure:"use_private_broadcast_rpc_address,omitempty"` - LuceneEnabled *bool `json:"luceneEnabled,omitempty" mapstructure:"lucene_enabled,omitempty"` - ContinuousBackupEnabled *bool `json:"continuousBackupEnabled,omitempty" mapstructure:"continuous_backup_enabled,omitempty"` - NumberPartitions int `json:"numberPartitions,omitempty" mapstructure:"number_partitions,omitempty"` - AutoCreateTopics *bool `json:"autoCreateTopics,omitempty" mapstructure:"auto_create_topics,omitempty"` - DeleteTopics *bool `json:"deleteTopics,omitempty" mapstructure:"delete_topics,omitempty"` - PasswordAuthentication *bool `json:"passwordAuthentication,omitempty" mapstructure:"password_authentication,omitempty"` - TargetKafkaClusterId string `json:"targetKafkaClusterId,omitempty" mapstructure:"target_kafka_cluster_id,omitempty"` - VPCType string `json:"vpcType,omitempty" mapstructure:"vpc_type,omitempty"` - AWSAccessKeyId string `json:"aws.access.key.id,omitempty" mapstructure:"aws_access_key,omitempty"` - AWSSecretKey string `json:"aws.secret.access.key,omitempty" mapstructure:"aws_secret_key,omitempty"` - S3BucketName string `json:"s3.bucket.name,omitempty" mapstructure:"s3_bucket_name,omitempty"` - AzureStorageAccountName string `json:"azure.storage.account.name,omitempty" mapstructure:"azure_storage_account_name,omitempty"` - AzureStorageAccountKey string `json:"azure.storage.account.key,omitempty" mapstructure:"azure_storage_account_key,omitempty"` - AzureStorageContainerName string `json:"azure.storage.container.name,omitempty" mapstructure:"azure_storage_container_name,omitempty"` - SslEnabledProtocols string `json:"ssl.enabled.protocols,omitempty" mapstructure:"ssl_enabled_protocols,omitempty"` - SslTruststorePassword string `json:"ssl.truststore.password,omitempty" mapstructure:"ssl_truststore_password,omitempty"` - SslProtocol string `json:"ssl.protocol,omitempty" mapstructure:"ssl_protocol,omitempty"` - SecurityProtocol string `json:"security.protocol,omitempty" mapstructure:"security_protocol,omitempty"` - SaslMechanism string `json:"sasl.mechanism,omitempty" mapstructure:"sasl_mechanism,omitempty"` - SaslJaasConfig string `json:"sasl.jaas.config,omitempty" mapstructure:"sasl_jaas_config,omitempty"` - BootstrapServers string `json:"bootstrap.servers,omitempty" mapstructure:"bootstrap_servers,omitempty"` - Truststore string `json:"truststore,omitempty" mapstructure:"truststore,omitempty"` - RedisMasterNodes int `json:"masterNodes,omitempty" mapstructure:"master_nodes,omitempty"` - RedisReplicaNodes int `json:"replicaNodes,omitempty" mapstructure:"replica_nodes,omitempty"` - RedisPasswordAuth *bool `json:"passwordAuth,omitempty" mapstructure:"password_auth,omitempty"` - DedicatedZookeeper *bool `json:"dedicatedZookeeper,omitempty" mapstructure:"dedicated_zookeeper,omitempty"` - ZookeeperNodeSize string `json:"zookeeperNodeSize,omitempty" mapstructure:"zookeeper_node_size,omitempty"` - ZookeeperNodeCount int `json:"zookeeperNodeCount,omitempty" mapstructure:"zookeeper_node_count,omitempty"` - PostgresqlNodeCount int `json:"postgresqlNodeCount,omitempty" mapstructure:"postgresql_node_count,omitempty"` - PostgresqlReplicationMode string `json:"replicationMode,omitempty" mapstructure:"replication_mode,omitempty"` - PostgresqlSynchronousModeStrict *bool `json:"synchronousModeStrict,omitempty" mapstructure:"synchronous_mode_strict,omitempty"` + AuthnAuthz *bool `json:"authnAuthz,omitempty" mapstructure:"auth_n_authz,omitempty"` + ClientEncryption *bool `json:"clientEncryption,omitempty" mapstructure:"client_encryption,omitempty"` + DedicatedMasterNodes *bool `json:"dedicatedMasterNodes,omitempty" mapstructure:"dedicated_master_nodes,omitempty"` + MasterNodeSize string `json:"masterNodeSize,omitempty" mapstructure:"master_node_size,omitempty"` + KibanaNodeSize string `json:"kibanaNodeSize,omitempty" mapstructure:"kibana_node_size,omitempty"` + OpenSearchDashboardsNodeSize string `json:"openSearchDashboardsNodeSize,omitempty" mapstructure:"opensearch_dashboards_node_size,omitempty"` + DataNodeSize string `json:"dataNodeSize,omitempty" mapstructure:"data_node_size,omitempty"` + SecurityPlugin *bool `json:"securityPlugin,omitempty" mapstructure:"security_plugin,omitempty"` + IndexManagementPlugin *bool `json:"indexManagementPlugin,omitempty" mapstructure:"index_management_plugin,omitempty"` + UsePrivateBroadcastRpcAddress *bool `json:"usePrivateBroadcastRPCAddress,omitempty" mapstructure:"use_private_broadcast_rpc_address,omitempty"` + LuceneEnabled *bool `json:"luceneEnabled,omitempty" mapstructure:"lucene_enabled,omitempty"` + ContinuousBackupEnabled *bool `json:"continuousBackupEnabled,omitempty" mapstructure:"continuous_backup_enabled,omitempty"` + NumberPartitions int `json:"numberPartitions,omitempty" mapstructure:"number_partitions,omitempty"` + AutoCreateTopics *bool `json:"autoCreateTopics,omitempty" mapstructure:"auto_create_topics,omitempty"` + DeleteTopics *bool `json:"deleteTopics,omitempty" mapstructure:"delete_topics,omitempty"` + PasswordAuthentication *bool `json:"passwordAuthentication,omitempty" mapstructure:"password_authentication,omitempty"` + TargetKafkaClusterId string `json:"targetKafkaClusterId,omitempty" mapstructure:"target_kafka_cluster_id,omitempty"` + VPCType string `json:"vpcType,omitempty" mapstructure:"vpc_type,omitempty"` + AWSAccessKeyId string `json:"aws.access.key.id,omitempty" mapstructure:"aws_access_key,omitempty"` + AWSSecretKey string `json:"aws.secret.access.key,omitempty" mapstructure:"aws_secret_key,omitempty"` + S3BucketName string `json:"s3.bucket.name,omitempty" mapstructure:"s3_bucket_name,omitempty"` + AzureStorageAccountName string `json:"azure.storage.account.name,omitempty" mapstructure:"azure_storage_account_name,omitempty"` + AzureStorageAccountKey string `json:"azure.storage.account.key,omitempty" mapstructure:"azure_storage_account_key,omitempty"` + AzureStorageContainerName string `json:"azure.storage.container.name,omitempty" mapstructure:"azure_storage_container_name,omitempty"` + SslEnabledProtocols string `json:"ssl.enabled.protocols,omitempty" mapstructure:"ssl_enabled_protocols,omitempty"` + SslTruststorePassword string `json:"ssl.truststore.password,omitempty" mapstructure:"ssl_truststore_password,omitempty"` + SslProtocol string `json:"ssl.protocol,omitempty" mapstructure:"ssl_protocol,omitempty"` + SecurityProtocol string `json:"security.protocol,omitempty" mapstructure:"security_protocol,omitempty"` + SaslMechanism string `json:"sasl.mechanism,omitempty" mapstructure:"sasl_mechanism,omitempty"` + SaslJaasConfig string `json:"sasl.jaas.config,omitempty" mapstructure:"sasl_jaas_config,omitempty"` + BootstrapServers string `json:"bootstrap.servers,omitempty" mapstructure:"bootstrap_servers,omitempty"` + Truststore string `json:"truststore,omitempty" mapstructure:"truststore,omitempty"` + RedisMasterNodes int `json:"masterNodes,omitempty" mapstructure:"master_nodes,omitempty"` + RedisReplicaNodes int `json:"replicaNodes,omitempty" mapstructure:"replica_nodes,omitempty"` + RedisPasswordAuth *bool `json:"passwordAuth,omitempty" mapstructure:"password_auth,omitempty"` + DedicatedZookeeper *bool `json:"dedicatedZookeeper,omitempty" mapstructure:"dedicated_zookeeper,omitempty"` + ZookeeperNodeSize string `json:"zookeeperNodeSize,omitempty" mapstructure:"zookeeper_node_size,omitempty"` + ZookeeperNodeCount int `json:"zookeeperNodeCount,omitempty" mapstructure:"zookeeper_node_count,omitempty"` + PostgresqlNodeCount int `json:"postgresqlNodeCount,omitempty" mapstructure:"postgresql_node_count,omitempty"` + PostgresqlReplicationMode string `json:"replicationMode,omitempty" mapstructure:"replication_mode,omitempty"` + PostgresqlSynchronousModeStrict *bool `json:"synchronousModeStrict,omitempty" mapstructure:"synchronous_mode_strict,omitempty"` } type ClusterProvider struct { @@ -90,6 +91,7 @@ type CreateRequest struct { PrivateNetworkCluster string `json:"privateNetworkCluster,omitempty"` PCICompliantCluster string `json:"pciCompliantCluster,omitempty"` RackAllocation *RackAllocation `json:"rackAllocation,omitempty"` + OidcProvider string `json:"oidcProvider,omitempty"` } type DataCentreCreateRequest struct { @@ -123,6 +125,7 @@ type Cluster struct { DataCentre string `json:"dataCentre"` DataCentres []DataCentre `json:"dataCentres"` Provider []ClusterProvider `json:"clusterProvider"` + OidcProvider string `json:"oidcId"` } type ClusterListItem struct { From f8c36505d1834308e6b832d1d8e3737d20d01db0 Mon Sep 17 00:00:00 2001 From: longhoang Date: Thu, 31 Mar 2022 08:32:40 +0700 Subject: [PATCH 2/9] fix whitespaces --- instaclustr/structs.go | 83 ++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 43 deletions(-) diff --git a/instaclustr/structs.go b/instaclustr/structs.go index 840cdfae..5dc110b3 100644 --- a/instaclustr/structs.go +++ b/instaclustr/structs.go @@ -21,47 +21,46 @@ type OmitEmptyBool struct { } type BundleOptions struct { - AuthnAuthz *bool `json:"authnAuthz,omitempty" mapstructure:"auth_n_authz,omitempty"` - ClientEncryption *bool `json:"clientEncryption,omitempty" mapstructure:"client_encryption,omitempty"` - DedicatedMasterNodes *bool `json:"dedicatedMasterNodes,omitempty" mapstructure:"dedicated_master_nodes,omitempty"` - MasterNodeSize string `json:"masterNodeSize,omitempty" mapstructure:"master_node_size,omitempty"` - KibanaNodeSize string `json:"kibanaNodeSize,omitempty" mapstructure:"kibana_node_size,omitempty"` - OpenSearchDashboardsNodeSize string `json:"openSearchDashboardsNodeSize,omitempty" mapstructure:"opensearch_dashboards_node_size,omitempty"` - DataNodeSize string `json:"dataNodeSize,omitempty" mapstructure:"data_node_size,omitempty"` - SecurityPlugin *bool `json:"securityPlugin,omitempty" mapstructure:"security_plugin,omitempty"` - IndexManagementPlugin *bool `json:"indexManagementPlugin,omitempty" mapstructure:"index_management_plugin,omitempty"` - UsePrivateBroadcastRpcAddress *bool `json:"usePrivateBroadcastRPCAddress,omitempty" mapstructure:"use_private_broadcast_rpc_address,omitempty"` - LuceneEnabled *bool `json:"luceneEnabled,omitempty" mapstructure:"lucene_enabled,omitempty"` - ContinuousBackupEnabled *bool `json:"continuousBackupEnabled,omitempty" mapstructure:"continuous_backup_enabled,omitempty"` - NumberPartitions int `json:"numberPartitions,omitempty" mapstructure:"number_partitions,omitempty"` - AutoCreateTopics *bool `json:"autoCreateTopics,omitempty" mapstructure:"auto_create_topics,omitempty"` - DeleteTopics *bool `json:"deleteTopics,omitempty" mapstructure:"delete_topics,omitempty"` - PasswordAuthentication *bool `json:"passwordAuthentication,omitempty" mapstructure:"password_authentication,omitempty"` - TargetKafkaClusterId string `json:"targetKafkaClusterId,omitempty" mapstructure:"target_kafka_cluster_id,omitempty"` - VPCType string `json:"vpcType,omitempty" mapstructure:"vpc_type,omitempty"` - AWSAccessKeyId string `json:"aws.access.key.id,omitempty" mapstructure:"aws_access_key,omitempty"` - AWSSecretKey string `json:"aws.secret.access.key,omitempty" mapstructure:"aws_secret_key,omitempty"` - S3BucketName string `json:"s3.bucket.name,omitempty" mapstructure:"s3_bucket_name,omitempty"` - AzureStorageAccountName string `json:"azure.storage.account.name,omitempty" mapstructure:"azure_storage_account_name,omitempty"` - AzureStorageAccountKey string `json:"azure.storage.account.key,omitempty" mapstructure:"azure_storage_account_key,omitempty"` - AzureStorageContainerName string `json:"azure.storage.container.name,omitempty" mapstructure:"azure_storage_container_name,omitempty"` - SslEnabledProtocols string `json:"ssl.enabled.protocols,omitempty" mapstructure:"ssl_enabled_protocols,omitempty"` - SslTruststorePassword string `json:"ssl.truststore.password,omitempty" mapstructure:"ssl_truststore_password,omitempty"` - SslProtocol string `json:"ssl.protocol,omitempty" mapstructure:"ssl_protocol,omitempty"` - SecurityProtocol string `json:"security.protocol,omitempty" mapstructure:"security_protocol,omitempty"` - SaslMechanism string `json:"sasl.mechanism,omitempty" mapstructure:"sasl_mechanism,omitempty"` - SaslJaasConfig string `json:"sasl.jaas.config,omitempty" mapstructure:"sasl_jaas_config,omitempty"` - BootstrapServers string `json:"bootstrap.servers,omitempty" mapstructure:"bootstrap_servers,omitempty"` - Truststore string `json:"truststore,omitempty" mapstructure:"truststore,omitempty"` - RedisMasterNodes int `json:"masterNodes,omitempty" mapstructure:"master_nodes,omitempty"` - RedisReplicaNodes int `json:"replicaNodes,omitempty" mapstructure:"replica_nodes,omitempty"` - RedisPasswordAuth *bool `json:"passwordAuth,omitempty" mapstructure:"password_auth,omitempty"` - DedicatedZookeeper *bool `json:"dedicatedZookeeper,omitempty" mapstructure:"dedicated_zookeeper,omitempty"` - ZookeeperNodeSize string `json:"zookeeperNodeSize,omitempty" mapstructure:"zookeeper_node_size,omitempty"` - ZookeeperNodeCount int `json:"zookeeperNodeCount,omitempty" mapstructure:"zookeeper_node_count,omitempty"` - PostgresqlNodeCount int `json:"postgresqlNodeCount,omitempty" mapstructure:"postgresql_node_count,omitempty"` - PostgresqlReplicationMode string `json:"replicationMode,omitempty" mapstructure:"replication_mode,omitempty"` - PostgresqlSynchronousModeStrict *bool `json:"synchronousModeStrict,omitempty" mapstructure:"synchronous_mode_strict,omitempty"` + AuthnAuthz *bool `json:"authnAuthz,omitempty" mapstructure:"auth_n_authz,omitempty"` + ClientEncryption *bool `json:"clientEncryption,omitempty" mapstructure:"client_encryption,omitempty"` + DedicatedMasterNodes *bool `json:"dedicatedMasterNodes,omitempty" mapstructure:"dedicated_master_nodes,omitempty"` + MasterNodeSize string `json:"masterNodeSize,omitempty" mapstructure:"master_node_size,omitempty"` + KibanaNodeSize string `json:"kibanaNodeSize,omitempty" mapstructure:"kibana_node_size,omitempty"` + OpenSearchDashboardsNodeSize string `json:"openSearchDashboardsNodeSize,omitempty" mapstructure:"opensearch_dashboards_node_size,omitempty"` + DataNodeSize string `json:"dataNodeSize,omitempty" mapstructure:"data_node_size,omitempty"` + SecurityPlugin *bool `json:"securityPlugin,omitempty" mapstructure:"security_plugin,omitempty"` + UsePrivateBroadcastRpcAddress *bool `json:"usePrivateBroadcastRPCAddress,omitempty" mapstructure:"use_private_broadcast_rpc_address,omitempty"` + LuceneEnabled *bool `json:"luceneEnabled,omitempty" mapstructure:"lucene_enabled,omitempty"` + ContinuousBackupEnabled *bool `json:"continuousBackupEnabled,omitempty" mapstructure:"continuous_backup_enabled,omitempty"` + NumberPartitions int `json:"numberPartitions,omitempty" mapstructure:"number_partitions,omitempty"` + AutoCreateTopics *bool `json:"autoCreateTopics,omitempty" mapstructure:"auto_create_topics,omitempty"` + DeleteTopics *bool `json:"deleteTopics,omitempty" mapstructure:"delete_topics,omitempty"` + PasswordAuthentication *bool `json:"passwordAuthentication,omitempty" mapstructure:"password_authentication,omitempty"` + TargetKafkaClusterId string `json:"targetKafkaClusterId,omitempty" mapstructure:"target_kafka_cluster_id,omitempty"` + VPCType string `json:"vpcType,omitempty" mapstructure:"vpc_type,omitempty"` + AWSAccessKeyId string `json:"aws.access.key.id,omitempty" mapstructure:"aws_access_key,omitempty"` + AWSSecretKey string `json:"aws.secret.access.key,omitempty" mapstructure:"aws_secret_key,omitempty"` + S3BucketName string `json:"s3.bucket.name,omitempty" mapstructure:"s3_bucket_name,omitempty"` + AzureStorageAccountName string `json:"azure.storage.account.name,omitempty" mapstructure:"azure_storage_account_name,omitempty"` + AzureStorageAccountKey string `json:"azure.storage.account.key,omitempty" mapstructure:"azure_storage_account_key,omitempty"` + AzureStorageContainerName string `json:"azure.storage.container.name,omitempty" mapstructure:"azure_storage_container_name,omitempty"` + SslEnabledProtocols string `json:"ssl.enabled.protocols,omitempty" mapstructure:"ssl_enabled_protocols,omitempty"` + SslTruststorePassword string `json:"ssl.truststore.password,omitempty" mapstructure:"ssl_truststore_password,omitempty"` + SslProtocol string `json:"ssl.protocol,omitempty" mapstructure:"ssl_protocol,omitempty"` + SecurityProtocol string `json:"security.protocol,omitempty" mapstructure:"security_protocol,omitempty"` + SaslMechanism string `json:"sasl.mechanism,omitempty" mapstructure:"sasl_mechanism,omitempty"` + SaslJaasConfig string `json:"sasl.jaas.config,omitempty" mapstructure:"sasl_jaas_config,omitempty"` + BootstrapServers string `json:"bootstrap.servers,omitempty" mapstructure:"bootstrap_servers,omitempty"` + Truststore string `json:"truststore,omitempty" mapstructure:"truststore,omitempty"` + RedisMasterNodes int `json:"masterNodes,omitempty" mapstructure:"master_nodes,omitempty"` + RedisReplicaNodes int `json:"replicaNodes,omitempty" mapstructure:"replica_nodes,omitempty"` + RedisPasswordAuth *bool `json:"passwordAuth,omitempty" mapstructure:"password_auth,omitempty"` + DedicatedZookeeper *bool `json:"dedicatedZookeeper,omitempty" mapstructure:"dedicated_zookeeper,omitempty"` + ZookeeperNodeSize string `json:"zookeeperNodeSize,omitempty" mapstructure:"zookeeper_node_size,omitempty"` + ZookeeperNodeCount int `json:"zookeeperNodeCount,omitempty" mapstructure:"zookeeper_node_count,omitempty"` + PostgresqlNodeCount int `json:"postgresqlNodeCount,omitempty" mapstructure:"postgresql_node_count,omitempty"` + PostgresqlReplicationMode string `json:"replicationMode,omitempty" mapstructure:"replication_mode,omitempty"` + PostgresqlSynchronousModeStrict *bool `json:"synchronousModeStrict,omitempty" mapstructure:"synchronous_mode_strict,omitempty"` } type ClusterProvider struct { @@ -91,7 +90,6 @@ type CreateRequest struct { PrivateNetworkCluster string `json:"privateNetworkCluster,omitempty"` PCICompliantCluster string `json:"pciCompliantCluster,omitempty"` RackAllocation *RackAllocation `json:"rackAllocation,omitempty"` - OidcProvider string `json:"oidcProvider,omitempty"` } type DataCentreCreateRequest struct { @@ -125,7 +123,6 @@ type Cluster struct { DataCentre string `json:"dataCentre"` DataCentres []DataCentre `json:"dataCentres"` Provider []ClusterProvider `json:"clusterProvider"` - OidcProvider string `json:"oidcId"` } type ClusterListItem struct { From 82bd237168f2cd5b4119c58e4879d0ff9600aa29 Mon Sep 17 00:00:00 2001 From: longhoang Date: Thu, 31 Mar 2022 08:51:38 +0700 Subject: [PATCH 3/9] parameters in structs.go --- instaclustr/structs.go | 83 ++++++++++++++++++++++-------------------- 1 file changed, 43 insertions(+), 40 deletions(-) diff --git a/instaclustr/structs.go b/instaclustr/structs.go index 5dc110b3..840cdfae 100644 --- a/instaclustr/structs.go +++ b/instaclustr/structs.go @@ -21,46 +21,47 @@ type OmitEmptyBool struct { } type BundleOptions struct { - AuthnAuthz *bool `json:"authnAuthz,omitempty" mapstructure:"auth_n_authz,omitempty"` - ClientEncryption *bool `json:"clientEncryption,omitempty" mapstructure:"client_encryption,omitempty"` - DedicatedMasterNodes *bool `json:"dedicatedMasterNodes,omitempty" mapstructure:"dedicated_master_nodes,omitempty"` - MasterNodeSize string `json:"masterNodeSize,omitempty" mapstructure:"master_node_size,omitempty"` - KibanaNodeSize string `json:"kibanaNodeSize,omitempty" mapstructure:"kibana_node_size,omitempty"` - OpenSearchDashboardsNodeSize string `json:"openSearchDashboardsNodeSize,omitempty" mapstructure:"opensearch_dashboards_node_size,omitempty"` - DataNodeSize string `json:"dataNodeSize,omitempty" mapstructure:"data_node_size,omitempty"` - SecurityPlugin *bool `json:"securityPlugin,omitempty" mapstructure:"security_plugin,omitempty"` - UsePrivateBroadcastRpcAddress *bool `json:"usePrivateBroadcastRPCAddress,omitempty" mapstructure:"use_private_broadcast_rpc_address,omitempty"` - LuceneEnabled *bool `json:"luceneEnabled,omitempty" mapstructure:"lucene_enabled,omitempty"` - ContinuousBackupEnabled *bool `json:"continuousBackupEnabled,omitempty" mapstructure:"continuous_backup_enabled,omitempty"` - NumberPartitions int `json:"numberPartitions,omitempty" mapstructure:"number_partitions,omitempty"` - AutoCreateTopics *bool `json:"autoCreateTopics,omitempty" mapstructure:"auto_create_topics,omitempty"` - DeleteTopics *bool `json:"deleteTopics,omitempty" mapstructure:"delete_topics,omitempty"` - PasswordAuthentication *bool `json:"passwordAuthentication,omitempty" mapstructure:"password_authentication,omitempty"` - TargetKafkaClusterId string `json:"targetKafkaClusterId,omitempty" mapstructure:"target_kafka_cluster_id,omitempty"` - VPCType string `json:"vpcType,omitempty" mapstructure:"vpc_type,omitempty"` - AWSAccessKeyId string `json:"aws.access.key.id,omitempty" mapstructure:"aws_access_key,omitempty"` - AWSSecretKey string `json:"aws.secret.access.key,omitempty" mapstructure:"aws_secret_key,omitempty"` - S3BucketName string `json:"s3.bucket.name,omitempty" mapstructure:"s3_bucket_name,omitempty"` - AzureStorageAccountName string `json:"azure.storage.account.name,omitempty" mapstructure:"azure_storage_account_name,omitempty"` - AzureStorageAccountKey string `json:"azure.storage.account.key,omitempty" mapstructure:"azure_storage_account_key,omitempty"` - AzureStorageContainerName string `json:"azure.storage.container.name,omitempty" mapstructure:"azure_storage_container_name,omitempty"` - SslEnabledProtocols string `json:"ssl.enabled.protocols,omitempty" mapstructure:"ssl_enabled_protocols,omitempty"` - SslTruststorePassword string `json:"ssl.truststore.password,omitempty" mapstructure:"ssl_truststore_password,omitempty"` - SslProtocol string `json:"ssl.protocol,omitempty" mapstructure:"ssl_protocol,omitempty"` - SecurityProtocol string `json:"security.protocol,omitempty" mapstructure:"security_protocol,omitempty"` - SaslMechanism string `json:"sasl.mechanism,omitempty" mapstructure:"sasl_mechanism,omitempty"` - SaslJaasConfig string `json:"sasl.jaas.config,omitempty" mapstructure:"sasl_jaas_config,omitempty"` - BootstrapServers string `json:"bootstrap.servers,omitempty" mapstructure:"bootstrap_servers,omitempty"` - Truststore string `json:"truststore,omitempty" mapstructure:"truststore,omitempty"` - RedisMasterNodes int `json:"masterNodes,omitempty" mapstructure:"master_nodes,omitempty"` - RedisReplicaNodes int `json:"replicaNodes,omitempty" mapstructure:"replica_nodes,omitempty"` - RedisPasswordAuth *bool `json:"passwordAuth,omitempty" mapstructure:"password_auth,omitempty"` - DedicatedZookeeper *bool `json:"dedicatedZookeeper,omitempty" mapstructure:"dedicated_zookeeper,omitempty"` - ZookeeperNodeSize string `json:"zookeeperNodeSize,omitempty" mapstructure:"zookeeper_node_size,omitempty"` - ZookeeperNodeCount int `json:"zookeeperNodeCount,omitempty" mapstructure:"zookeeper_node_count,omitempty"` - PostgresqlNodeCount int `json:"postgresqlNodeCount,omitempty" mapstructure:"postgresql_node_count,omitempty"` - PostgresqlReplicationMode string `json:"replicationMode,omitempty" mapstructure:"replication_mode,omitempty"` - PostgresqlSynchronousModeStrict *bool `json:"synchronousModeStrict,omitempty" mapstructure:"synchronous_mode_strict,omitempty"` + AuthnAuthz *bool `json:"authnAuthz,omitempty" mapstructure:"auth_n_authz,omitempty"` + ClientEncryption *bool `json:"clientEncryption,omitempty" mapstructure:"client_encryption,omitempty"` + DedicatedMasterNodes *bool `json:"dedicatedMasterNodes,omitempty" mapstructure:"dedicated_master_nodes,omitempty"` + MasterNodeSize string `json:"masterNodeSize,omitempty" mapstructure:"master_node_size,omitempty"` + KibanaNodeSize string `json:"kibanaNodeSize,omitempty" mapstructure:"kibana_node_size,omitempty"` + OpenSearchDashboardsNodeSize string `json:"openSearchDashboardsNodeSize,omitempty" mapstructure:"opensearch_dashboards_node_size,omitempty"` + DataNodeSize string `json:"dataNodeSize,omitempty" mapstructure:"data_node_size,omitempty"` + SecurityPlugin *bool `json:"securityPlugin,omitempty" mapstructure:"security_plugin,omitempty"` + IndexManagementPlugin *bool `json:"indexManagementPlugin,omitempty" mapstructure:"index_management_plugin,omitempty"` + UsePrivateBroadcastRpcAddress *bool `json:"usePrivateBroadcastRPCAddress,omitempty" mapstructure:"use_private_broadcast_rpc_address,omitempty"` + LuceneEnabled *bool `json:"luceneEnabled,omitempty" mapstructure:"lucene_enabled,omitempty"` + ContinuousBackupEnabled *bool `json:"continuousBackupEnabled,omitempty" mapstructure:"continuous_backup_enabled,omitempty"` + NumberPartitions int `json:"numberPartitions,omitempty" mapstructure:"number_partitions,omitempty"` + AutoCreateTopics *bool `json:"autoCreateTopics,omitempty" mapstructure:"auto_create_topics,omitempty"` + DeleteTopics *bool `json:"deleteTopics,omitempty" mapstructure:"delete_topics,omitempty"` + PasswordAuthentication *bool `json:"passwordAuthentication,omitempty" mapstructure:"password_authentication,omitempty"` + TargetKafkaClusterId string `json:"targetKafkaClusterId,omitempty" mapstructure:"target_kafka_cluster_id,omitempty"` + VPCType string `json:"vpcType,omitempty" mapstructure:"vpc_type,omitempty"` + AWSAccessKeyId string `json:"aws.access.key.id,omitempty" mapstructure:"aws_access_key,omitempty"` + AWSSecretKey string `json:"aws.secret.access.key,omitempty" mapstructure:"aws_secret_key,omitempty"` + S3BucketName string `json:"s3.bucket.name,omitempty" mapstructure:"s3_bucket_name,omitempty"` + AzureStorageAccountName string `json:"azure.storage.account.name,omitempty" mapstructure:"azure_storage_account_name,omitempty"` + AzureStorageAccountKey string `json:"azure.storage.account.key,omitempty" mapstructure:"azure_storage_account_key,omitempty"` + AzureStorageContainerName string `json:"azure.storage.container.name,omitempty" mapstructure:"azure_storage_container_name,omitempty"` + SslEnabledProtocols string `json:"ssl.enabled.protocols,omitempty" mapstructure:"ssl_enabled_protocols,omitempty"` + SslTruststorePassword string `json:"ssl.truststore.password,omitempty" mapstructure:"ssl_truststore_password,omitempty"` + SslProtocol string `json:"ssl.protocol,omitempty" mapstructure:"ssl_protocol,omitempty"` + SecurityProtocol string `json:"security.protocol,omitempty" mapstructure:"security_protocol,omitempty"` + SaslMechanism string `json:"sasl.mechanism,omitempty" mapstructure:"sasl_mechanism,omitempty"` + SaslJaasConfig string `json:"sasl.jaas.config,omitempty" mapstructure:"sasl_jaas_config,omitempty"` + BootstrapServers string `json:"bootstrap.servers,omitempty" mapstructure:"bootstrap_servers,omitempty"` + Truststore string `json:"truststore,omitempty" mapstructure:"truststore,omitempty"` + RedisMasterNodes int `json:"masterNodes,omitempty" mapstructure:"master_nodes,omitempty"` + RedisReplicaNodes int `json:"replicaNodes,omitempty" mapstructure:"replica_nodes,omitempty"` + RedisPasswordAuth *bool `json:"passwordAuth,omitempty" mapstructure:"password_auth,omitempty"` + DedicatedZookeeper *bool `json:"dedicatedZookeeper,omitempty" mapstructure:"dedicated_zookeeper,omitempty"` + ZookeeperNodeSize string `json:"zookeeperNodeSize,omitempty" mapstructure:"zookeeper_node_size,omitempty"` + ZookeeperNodeCount int `json:"zookeeperNodeCount,omitempty" mapstructure:"zookeeper_node_count,omitempty"` + PostgresqlNodeCount int `json:"postgresqlNodeCount,omitempty" mapstructure:"postgresql_node_count,omitempty"` + PostgresqlReplicationMode string `json:"replicationMode,omitempty" mapstructure:"replication_mode,omitempty"` + PostgresqlSynchronousModeStrict *bool `json:"synchronousModeStrict,omitempty" mapstructure:"synchronous_mode_strict,omitempty"` } type ClusterProvider struct { @@ -90,6 +91,7 @@ type CreateRequest struct { PrivateNetworkCluster string `json:"privateNetworkCluster,omitempty"` PCICompliantCluster string `json:"pciCompliantCluster,omitempty"` RackAllocation *RackAllocation `json:"rackAllocation,omitempty"` + OidcProvider string `json:"oidcProvider,omitempty"` } type DataCentreCreateRequest struct { @@ -123,6 +125,7 @@ type Cluster struct { DataCentre string `json:"dataCentre"` DataCentres []DataCentre `json:"dataCentres"` Provider []ClusterProvider `json:"clusterProvider"` + OidcProvider string `json:"oidcId"` } type ClusterListItem struct { From 92094a8750e723ce388b36e8186d509c8cf67cfc Mon Sep 17 00:00:00 2001 From: longhoang Date: Thu, 31 Mar 2022 09:02:26 +0700 Subject: [PATCH 4/9] fix whitespaces 2 --- instaclustr/structs.go | 82 +++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/instaclustr/structs.go b/instaclustr/structs.go index 840cdfae..e992d43f 100644 --- a/instaclustr/structs.go +++ b/instaclustr/structs.go @@ -21,47 +21,47 @@ type OmitEmptyBool struct { } type BundleOptions struct { - AuthnAuthz *bool `json:"authnAuthz,omitempty" mapstructure:"auth_n_authz,omitempty"` - ClientEncryption *bool `json:"clientEncryption,omitempty" mapstructure:"client_encryption,omitempty"` - DedicatedMasterNodes *bool `json:"dedicatedMasterNodes,omitempty" mapstructure:"dedicated_master_nodes,omitempty"` - MasterNodeSize string `json:"masterNodeSize,omitempty" mapstructure:"master_node_size,omitempty"` - KibanaNodeSize string `json:"kibanaNodeSize,omitempty" mapstructure:"kibana_node_size,omitempty"` - OpenSearchDashboardsNodeSize string `json:"openSearchDashboardsNodeSize,omitempty" mapstructure:"opensearch_dashboards_node_size,omitempty"` - DataNodeSize string `json:"dataNodeSize,omitempty" mapstructure:"data_node_size,omitempty"` - SecurityPlugin *bool `json:"securityPlugin,omitempty" mapstructure:"security_plugin,omitempty"` - IndexManagementPlugin *bool `json:"indexManagementPlugin,omitempty" mapstructure:"index_management_plugin,omitempty"` - UsePrivateBroadcastRpcAddress *bool `json:"usePrivateBroadcastRPCAddress,omitempty" mapstructure:"use_private_broadcast_rpc_address,omitempty"` - LuceneEnabled *bool `json:"luceneEnabled,omitempty" mapstructure:"lucene_enabled,omitempty"` - ContinuousBackupEnabled *bool `json:"continuousBackupEnabled,omitempty" mapstructure:"continuous_backup_enabled,omitempty"` - NumberPartitions int `json:"numberPartitions,omitempty" mapstructure:"number_partitions,omitempty"` - AutoCreateTopics *bool `json:"autoCreateTopics,omitempty" mapstructure:"auto_create_topics,omitempty"` - DeleteTopics *bool `json:"deleteTopics,omitempty" mapstructure:"delete_topics,omitempty"` - PasswordAuthentication *bool `json:"passwordAuthentication,omitempty" mapstructure:"password_authentication,omitempty"` - TargetKafkaClusterId string `json:"targetKafkaClusterId,omitempty" mapstructure:"target_kafka_cluster_id,omitempty"` - VPCType string `json:"vpcType,omitempty" mapstructure:"vpc_type,omitempty"` - AWSAccessKeyId string `json:"aws.access.key.id,omitempty" mapstructure:"aws_access_key,omitempty"` - AWSSecretKey string `json:"aws.secret.access.key,omitempty" mapstructure:"aws_secret_key,omitempty"` - S3BucketName string `json:"s3.bucket.name,omitempty" mapstructure:"s3_bucket_name,omitempty"` - AzureStorageAccountName string `json:"azure.storage.account.name,omitempty" mapstructure:"azure_storage_account_name,omitempty"` - AzureStorageAccountKey string `json:"azure.storage.account.key,omitempty" mapstructure:"azure_storage_account_key,omitempty"` - AzureStorageContainerName string `json:"azure.storage.container.name,omitempty" mapstructure:"azure_storage_container_name,omitempty"` - SslEnabledProtocols string `json:"ssl.enabled.protocols,omitempty" mapstructure:"ssl_enabled_protocols,omitempty"` - SslTruststorePassword string `json:"ssl.truststore.password,omitempty" mapstructure:"ssl_truststore_password,omitempty"` - SslProtocol string `json:"ssl.protocol,omitempty" mapstructure:"ssl_protocol,omitempty"` - SecurityProtocol string `json:"security.protocol,omitempty" mapstructure:"security_protocol,omitempty"` - SaslMechanism string `json:"sasl.mechanism,omitempty" mapstructure:"sasl_mechanism,omitempty"` - SaslJaasConfig string `json:"sasl.jaas.config,omitempty" mapstructure:"sasl_jaas_config,omitempty"` - BootstrapServers string `json:"bootstrap.servers,omitempty" mapstructure:"bootstrap_servers,omitempty"` - Truststore string `json:"truststore,omitempty" mapstructure:"truststore,omitempty"` - RedisMasterNodes int `json:"masterNodes,omitempty" mapstructure:"master_nodes,omitempty"` - RedisReplicaNodes int `json:"replicaNodes,omitempty" mapstructure:"replica_nodes,omitempty"` - RedisPasswordAuth *bool `json:"passwordAuth,omitempty" mapstructure:"password_auth,omitempty"` - DedicatedZookeeper *bool `json:"dedicatedZookeeper,omitempty" mapstructure:"dedicated_zookeeper,omitempty"` - ZookeeperNodeSize string `json:"zookeeperNodeSize,omitempty" mapstructure:"zookeeper_node_size,omitempty"` - ZookeeperNodeCount int `json:"zookeeperNodeCount,omitempty" mapstructure:"zookeeper_node_count,omitempty"` - PostgresqlNodeCount int `json:"postgresqlNodeCount,omitempty" mapstructure:"postgresql_node_count,omitempty"` - PostgresqlReplicationMode string `json:"replicationMode,omitempty" mapstructure:"replication_mode,omitempty"` - PostgresqlSynchronousModeStrict *bool `json:"synchronousModeStrict,omitempty" mapstructure:"synchronous_mode_strict,omitempty"` + AuthnAuthz *bool `json:"authnAuthz,omitempty" mapstructure:"auth_n_authz,omitempty"` + ClientEncryption *bool `json:"clientEncryption,omitempty" mapstructure:"client_encryption,omitempty"` + DedicatedMasterNodes *bool `json:"dedicatedMasterNodes,omitempty" mapstructure:"dedicated_master_nodes,omitempty"` + MasterNodeSize string `json:"masterNodeSize,omitempty" mapstructure:"master_node_size,omitempty"` + KibanaNodeSize string `json:"kibanaNodeSize,omitempty" mapstructure:"kibana_node_size,omitempty"` + OpenSearchDashboardsNodeSize string `json:"openSearchDashboardsNodeSize,omitempty" mapstructure:"opensearch_dashboards_node_size,omitempty"` + DataNodeSize string `json:"dataNodeSize,omitempty" mapstructure:"data_node_size,omitempty"` + SecurityPlugin *bool `json:"securityPlugin,omitempty" mapstructure:"security_plugin,omitempty"` + IndexManagementPlugin *bool `json:"indexManagementPlugin,omitempty" mapstructure:"index_management_plugin,omitempty"` + UsePrivateBroadcastRpcAddress *bool `json:"usePrivateBroadcastRPCAddress,omitempty" mapstructure:"use_private_broadcast_rpc_address,omitempty"` + LuceneEnabled *bool `json:"luceneEnabled,omitempty" mapstructure:"lucene_enabled,omitempty"` + ContinuousBackupEnabled *bool `json:"continuousBackupEnabled,omitempty" mapstructure:"continuous_backup_enabled,omitempty"` + NumberPartitions int `json:"numberPartitions,omitempty" mapstructure:"number_partitions,omitempty"` + AutoCreateTopics *bool `json:"autoCreateTopics,omitempty" mapstructure:"auto_create_topics,omitempty"` + DeleteTopics *bool `json:"deleteTopics,omitempty" mapstructure:"delete_topics,omitempty"` + PasswordAuthentication *bool `json:"passwordAuthentication,omitempty" mapstructure:"password_authentication,omitempty"` + TargetKafkaClusterId string `json:"targetKafkaClusterId,omitempty" mapstructure:"target_kafka_cluster_id,omitempty"` + VPCType string `json:"vpcType,omitempty" mapstructure:"vpc_type,omitempty"` + AWSAccessKeyId string `json:"aws.access.key.id,omitempty" mapstructure:"aws_access_key,omitempty"` + AWSSecretKey string `json:"aws.secret.access.key,omitempty" mapstructure:"aws_secret_key,omitempty"` + S3BucketName string `json:"s3.bucket.name,omitempty" mapstructure:"s3_bucket_name,omitempty"` + AzureStorageAccountName string `json:"azure.storage.account.name,omitempty" mapstructure:"azure_storage_account_name,omitempty"` + AzureStorageAccountKey string `json:"azure.storage.account.key,omitempty" mapstructure:"azure_storage_account_key,omitempty"` + AzureStorageContainerName string `json:"azure.storage.container.name,omitempty" mapstructure:"azure_storage_container_name,omitempty"` + SslEnabledProtocols string `json:"ssl.enabled.protocols,omitempty" mapstructure:"ssl_enabled_protocols,omitempty"` + SslTruststorePassword string `json:"ssl.truststore.password,omitempty" mapstructure:"ssl_truststore_password,omitempty"` + SslProtocol string `json:"ssl.protocol,omitempty" mapstructure:"ssl_protocol,omitempty"` + SecurityProtocol string `json:"security.protocol,omitempty" mapstructure:"security_protocol,omitempty"` + SaslMechanism string `json:"sasl.mechanism,omitempty" mapstructure:"sasl_mechanism,omitempty"` + SaslJaasConfig string `json:"sasl.jaas.config,omitempty" mapstructure:"sasl_jaas_config,omitempty"` + BootstrapServers string `json:"bootstrap.servers,omitempty" mapstructure:"bootstrap_servers,omitempty"` + Truststore string `json:"truststore,omitempty" mapstructure:"truststore,omitempty"` + RedisMasterNodes int `json:"masterNodes,omitempty" mapstructure:"master_nodes,omitempty"` + RedisReplicaNodes int `json:"replicaNodes,omitempty" mapstructure:"replica_nodes,omitempty"` + RedisPasswordAuth *bool `json:"passwordAuth,omitempty" mapstructure:"password_auth,omitempty"` + DedicatedZookeeper *bool `json:"dedicatedZookeeper,omitempty" mapstructure:"dedicated_zookeeper,omitempty"` + ZookeeperNodeSize string `json:"zookeeperNodeSize,omitempty" mapstructure:"zookeeper_node_size,omitempty"` + ZookeeperNodeCount int `json:"zookeeperNodeCount,omitempty" mapstructure:"zookeeper_node_count,omitempty"` + PostgresqlNodeCount int `json:"postgresqlNodeCount,omitempty" mapstructure:"postgresql_node_count,omitempty"` + PostgresqlReplicationMode string `json:"replicationMode,omitempty" mapstructure:"replication_mode,omitempty"` + PostgresqlSynchronousModeStrict *bool `json:"synchronousModeStrict,omitempty" mapstructure:"synchronous_mode_strict,omitempty"` } type ClusterProvider struct { From 2d6096ecaf80d6d09a3a44e2d7c4c75b09868664 Mon Sep 17 00:00:00 2001 From: longhoang Date: Fri, 1 Apr 2022 06:11:49 +0700 Subject: [PATCH 5/9] add plugin params to schema, fix version number --- Makefile | 2 +- instaclustr/resource_cluster.go | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4f921b1a..42b0d5f8 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ BIN_NAME=terraform-provider-instaclustr # for VERSION, don't add prefix "v", e.g., use "1.9.8" instead of "v1.9.8" as it could break circleCI stuff -VERSION=1.17.1 +VERSION=1.18.0 INSTALL_FOLDER=$(HOME)/.terraform.d/plugins/terraform.instaclustr.com/instaclustr/instaclustr/$(VERSION)/darwin_amd64 diff --git a/instaclustr/resource_cluster.go b/instaclustr/resource_cluster.go index bc3fff0a..5f011b13 100644 --- a/instaclustr/resource_cluster.go +++ b/instaclustr/resource_cluster.go @@ -561,6 +561,16 @@ func resourceCluster() *schema.Resource { Optional: true, ForceNew: true, }, + "security_plugin": { + Type: schema.TypeBool, + Optional: true, + ForceNew: true, + }, + "index_management_plugin": { + Type: schema.TypeBool, + Optional: true, + ForceNew: true, + }, "postgresql_node_count": { Type: schema.TypeInt, Optional: false, From 0660bbfc512dd60f1866a63e9f232d98753cc211 Mon Sep 17 00:00:00 2001 From: longhoang Date: Mon, 4 Apr 2022 07:25:59 +0700 Subject: [PATCH 6/9] update opensearch version to 1.2.4.ic1 in scripts --- acc_test/data/invalid_opensearch_cluster_create.tf | 2 +- acc_test/data/valid_opensearch_cluster_create.tf | 2 +- acc_test/data/valid_with_resizable_opensearch_cluster.tf | 2 +- examples/main.tf | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/acc_test/data/invalid_opensearch_cluster_create.tf b/acc_test/data/invalid_opensearch_cluster_create.tf index 4c75bbca..0b1eedb1 100644 --- a/acc_test/data/invalid_opensearch_cluster_create.tf +++ b/acc_test/data/invalid_opensearch_cluster_create.tf @@ -20,7 +20,7 @@ resource "instaclustr_cluster" "invalidOpenSearch" { } bundle { bundle = "OPENSEARCH" - version = "1.2.4" + version = "1.2.4.ic1" options = { dedicated_master_nodes = false, master_node_size = "m5l-250-v2", diff --git a/acc_test/data/valid_opensearch_cluster_create.tf b/acc_test/data/valid_opensearch_cluster_create.tf index 5b0f9ce4..20e3079b 100644 --- a/acc_test/data/valid_opensearch_cluster_create.tf +++ b/acc_test/data/valid_opensearch_cluster_create.tf @@ -20,7 +20,7 @@ resource "instaclustr_cluster" "validOpenSearch" { } bundle { bundle = "OPENSEARCH" - version = "1.2.4" + version = "1.2.4.ic1" options = { dedicated_master_nodes = false, master_node_size = "t3.small-v2", diff --git a/acc_test/data/valid_with_resizable_opensearch_cluster.tf b/acc_test/data/valid_with_resizable_opensearch_cluster.tf index 64089479..5c65ae01 100644 --- a/acc_test/data/valid_with_resizable_opensearch_cluster.tf +++ b/acc_test/data/valid_with_resizable_opensearch_cluster.tf @@ -20,7 +20,7 @@ resource "instaclustr_cluster" "resizable_cluster" { } bundle { bundle = "OPENSEARCH" - version = "1.2.4" + version = "1.2.4.ic1" options = { dedicated_master_nodes = false, master_node_size = "t3.small-v2", diff --git a/examples/main.tf b/examples/main.tf index 2528b33b..30e04c70 100644 --- a/examples/main.tf +++ b/examples/main.tf @@ -226,7 +226,7 @@ resource "instaclustr_cluster" "example-opensearch" { bundle { bundle = "OPENSEARCH" - version = "1.2.4" + version = "1.2.4.ic1" options = { dedicated_master_nodes = true, master_node_size = "m5l-250-v2", From b02c0a1a70806055dde8d25bd551052c700a6082 Mon Sep 17 00:00:00 2001 From: longhoang Date: Mon, 4 Apr 2022 07:39:45 +0700 Subject: [PATCH 7/9] undo version change --- acc_test/data/invalid_opensearch_cluster_create.tf | 2 +- acc_test/data/valid_opensearch_cluster_create.tf | 2 +- acc_test/data/valid_with_resizable_opensearch_cluster.tf | 2 +- examples/main.tf | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/acc_test/data/invalid_opensearch_cluster_create.tf b/acc_test/data/invalid_opensearch_cluster_create.tf index 0b1eedb1..4c75bbca 100644 --- a/acc_test/data/invalid_opensearch_cluster_create.tf +++ b/acc_test/data/invalid_opensearch_cluster_create.tf @@ -20,7 +20,7 @@ resource "instaclustr_cluster" "invalidOpenSearch" { } bundle { bundle = "OPENSEARCH" - version = "1.2.4.ic1" + version = "1.2.4" options = { dedicated_master_nodes = false, master_node_size = "m5l-250-v2", diff --git a/acc_test/data/valid_opensearch_cluster_create.tf b/acc_test/data/valid_opensearch_cluster_create.tf index 20e3079b..5b0f9ce4 100644 --- a/acc_test/data/valid_opensearch_cluster_create.tf +++ b/acc_test/data/valid_opensearch_cluster_create.tf @@ -20,7 +20,7 @@ resource "instaclustr_cluster" "validOpenSearch" { } bundle { bundle = "OPENSEARCH" - version = "1.2.4.ic1" + version = "1.2.4" options = { dedicated_master_nodes = false, master_node_size = "t3.small-v2", diff --git a/acc_test/data/valid_with_resizable_opensearch_cluster.tf b/acc_test/data/valid_with_resizable_opensearch_cluster.tf index 5c65ae01..64089479 100644 --- a/acc_test/data/valid_with_resizable_opensearch_cluster.tf +++ b/acc_test/data/valid_with_resizable_opensearch_cluster.tf @@ -20,7 +20,7 @@ resource "instaclustr_cluster" "resizable_cluster" { } bundle { bundle = "OPENSEARCH" - version = "1.2.4.ic1" + version = "1.2.4" options = { dedicated_master_nodes = false, master_node_size = "t3.small-v2", diff --git a/examples/main.tf b/examples/main.tf index 30e04c70..2528b33b 100644 --- a/examples/main.tf +++ b/examples/main.tf @@ -226,7 +226,7 @@ resource "instaclustr_cluster" "example-opensearch" { bundle { bundle = "OPENSEARCH" - version = "1.2.4.ic1" + version = "1.2.4" options = { dedicated_master_nodes = true, master_node_size = "m5l-250-v2", From e39d29c4bbc46b0556719d49a90c6e9df68e2a31 Mon Sep 17 00:00:00 2001 From: longhoang Date: Tue, 5 Apr 2022 13:14:18 +0700 Subject: [PATCH 8/9] valid_redis_cluster moved to us_west_2 --- acc_test/data/valid_redis_cluster_create.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acc_test/data/valid_redis_cluster_create.tf b/acc_test/data/valid_redis_cluster_create.tf index 55a09c9b..98e64bb3 100644 --- a/acc_test/data/valid_redis_cluster_create.tf +++ b/acc_test/data/valid_redis_cluster_create.tf @@ -7,7 +7,7 @@ provider "instaclustr" { resource "instaclustr_cluster" "validRedis" { cluster_name = "tf-redis-test" node_size = "t3.small-20-r" - data_centre = "US_EAST_1" + data_centre = "US_WEST_2" sla_tier = "NON_PRODUCTION" cluster_network = "192.168.0.0/18" private_network_cluster = false From 02b182284c1055b78c0ff9222b8c568b8f9a9101 Mon Sep 17 00:00:00 2001 From: longhoang Date: Tue, 5 Apr 2022 14:07:33 +0700 Subject: [PATCH 9/9] delete AZs check for redis --- acc_test/resource_redis_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/acc_test/resource_redis_test.go b/acc_test/resource_redis_test.go index c16f85c4..3b3dd2a4 100644 --- a/acc_test/resource_redis_test.go +++ b/acc_test/resource_redis_test.go @@ -44,7 +44,6 @@ func TestRedisResource(t *testing.T) { testCheckResourceValid(resourceName), testCheckResourceCreated(resourceName, hostname, username, apiKey), checkClusterRunning(resourceName, hostname, username, apiKey), - testCheckContactIPCorrect(resourceName, hostname, username, apiKey, 5, 5), ), }, {