diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1ac740a..7a27012 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -42,6 +42,14 @@ jobs: exit 1 fi name: Check documentation + - run: | + make fmt-check + git status -s + if [[ -n $(git status -s) ]]; then + echo "The formatting is not proper. Please ensure that your run 'make fmt'" + exit 1 + fi + name: Check documentation unit: name: Unit Tests runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index 533bed0..31063c1 100644 --- a/Makefile +++ b/Makefile @@ -51,3 +51,12 @@ update-client: clean: rm -rf terraform-provider-ybm + +fmt: + go fmt ./... + terraform fmt --recursive + +fmt-check: + @echo "Verifying formatting, failures can be fixed with 'make fmt'" + @!(gofmt -l -s -d . | grep '[a-z]') + terraform fmt -check --recursive diff --git a/docs/data-sources/backup.md b/docs/data-sources/backup.md index 0f01a20..01eb706 100644 --- a/docs/data-sources/backup.md +++ b/docs/data-sources/backup.md @@ -13,7 +13,7 @@ The data source to fetch the backup ID and other information about the most rece ```terraform data "ybm_backup" "example_backup" { - cluster_id = "example-cluster-id" + cluster_id = "example-cluster-id" most_recent = true } ``` diff --git a/docs/data-sources/cluster.md b/docs/data-sources/cluster.md index 590e52f..fa68989 100644 --- a/docs/data-sources/cluster.md +++ b/docs/data-sources/cluster.md @@ -12,7 +12,7 @@ The data source to fetch the cluster ID and other information about a cluster gi ## Example Usage ```terraform -data "ybm_cluster" "example_cluster"{ +data "ybm_cluster" "example_cluster" { cluster_name = "example-cluster" } ``` diff --git a/docs/index.md b/docs/index.md index e8ded88..2fb3b17 100644 --- a/docs/index.md +++ b/docs/index.md @@ -26,9 +26,9 @@ variable "auth_token" { } provider "ybm" { - host = "cloud.yugabyte.com" + host = "cloud.yugabyte.com" use_secure_host = false # True by default - auth_token = var.auth_token + auth_token = var.auth_token } ``` diff --git a/docs/resources/allow_list.md b/docs/resources/allow_list.md index b2e48ee..99c5a15 100644 --- a/docs/resources/allow_list.md +++ b/docs/resources/allow_list.md @@ -13,9 +13,9 @@ The resource to create an allow list in YugabyteDB Managed. ```terraform resource "ybm_allow_list" "example_allow_list" { - allow_list_name = "allow-all" + allow_list_name = "allow-all" allow_list_description = "allow all the ip addresses" - cidr_list = ["0.0.0.0/0"] + cidr_list = ["0.0.0.0/0"] } ``` diff --git a/docs/resources/api_key.md b/docs/resources/api_key.md index 7840ca5..de38adb 100644 --- a/docs/resources/api_key.md +++ b/docs/resources/api_key.md @@ -15,11 +15,11 @@ To issue an API Key with predefined built-in roles like Admin, Developer, Viewer ```terraform resource "ybm_api_key" "example_api_key" { - name = "example-api-key-name" - description = "example API Key description" #Optional - duration = 10 - unit = "Hours" - role_name = "Developer" + name = "example-api-key-name" + description = "example API Key description" #Optional + duration = 10 + unit = "Hours" + role_name = "Developer" } ``` @@ -27,11 +27,11 @@ To issue an API Key with custom user defined roles ```terraform resource "ybm_api_key" "example_custom_role_api_key" { - name = "example-api-key-name" - description = "example API Key description" #Optional - duration = 1 - unit = "Months" - role_name = "example-custom-role-name" + name = "example-api-key-name" + description = "example API Key description" #Optional + duration = 1 + unit = "Months" + role_name = "example-custom-role-name" } ``` diff --git a/docs/resources/associate_metrics_exporter_cluster.md b/docs/resources/associate_metrics_exporter_cluster.md index 71bfa5d..3ec8768 100644 --- a/docs/resources/associate_metrics_exporter_cluster.md +++ b/docs/resources/associate_metrics_exporter_cluster.md @@ -13,9 +13,9 @@ The resource to associate a metrics exporter config to a cluster in YugabyteDB M ```terraform resource "ybm_associate_metrics_exporter_cluster" "metrics-srcluster" { - cluster_id= ybm_cluster.single_region_cluster.cluster_id - config_id = ybm_metrics_exporter.test.config_id - depends_on = [ ybm_cluster.single_region_cluster, ybm_metrics_exporter.test ] + cluster_id = ybm_cluster.single_region_cluster.cluster_id + config_id = ybm_metrics_exporter.test.config_id + depends_on = [ybm_cluster.single_region_cluster, ybm_metrics_exporter.test] } ``` diff --git a/docs/resources/backup.md b/docs/resources/backup.md index 4d9e319..9b7c20a 100644 --- a/docs/resources/backup.md +++ b/docs/resources/backup.md @@ -15,9 +15,9 @@ The resource to create a manual backup of tables in a particular cluster. ```terraform resource "ybm_backup" "example_backup" { - cluster_id = "example-cluster-id" - backup_description = "example-backup-description" - retention_period_in_days = 2 + cluster_id = "example-cluster-id" + backup_description = "example-backup-description" + retention_period_in_days = 2 } ``` diff --git a/docs/resources/cluster.md b/docs/resources/cluster.md index 0c9474e..9db2b6d 100644 --- a/docs/resources/cluster.md +++ b/docs/resources/cluster.md @@ -270,7 +270,7 @@ resource "ybm_cluster" "multi_region_cluster" { vpc_id = "example-vpc-id" #Optional #vpc_name = "example-vpc-name" #Optional You can also use the VPC Name in place of vpc_id } - + ] cluster_tier = "PAID" cluster_allow_list_ids = ["example-allow-list-id-1", "example-allow-list-id-2"] #Optional @@ -390,9 +390,9 @@ resource "ybm_cluster" "single_region" { num_nodes = 6 } ] - cluster_tier = "PAID" + cluster_tier = "PAID" # fault tolerance cannot be NONE for CMK enabled cluster - fault_tolerance = "ZONE" + fault_tolerance = "ZONE" cmk_spec = { provider_type = "AWS" @@ -403,7 +403,7 @@ resource "ybm_cluster" "single_region" { "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" ] } - is_enabled = true + is_enabled = true } node_config = { @@ -449,31 +449,31 @@ resource "ybm_cluster" "single_region" { num_nodes = 6 } ] - cluster_tier = "PAID" + cluster_tier = "PAID" # fault tolerance cannot be NONE for CMK enabled cluster - fault_tolerance = "ZONE" + fault_tolerance = "ZONE" cmk_spec = { provider_type = "GCP" gcp_cmk_spec = { - location = "global" - key_ring_name = "example_cmk_key_ring" - key_name = "example_cmk_key" - protection_level = "software" - gcp_service_account = { - type = "service_account" - project_id = "your-project-id" - private_key_id = "your-private-key-id" - private_key = "-----BEGIN PRIVATE KEY-----\nYourPrivateRSAKey\n-----END PRIVATE KEY-----\n" - client_email = "your-service-account-email@your-project-id.iam.gserviceaccount.com" - client_id = "your-client-id" - auth_uri = "https://accounts.google.com/o/oauth2/auth" - token_uri = "https://accounts.google.com/o/oauth2/token" + location = "global" + key_ring_name = "example_cmk_key_ring" + key_name = "example_cmk_key" + protection_level = "software" + gcp_service_account = { + type = "service_account" + project_id = "your-project-id" + private_key_id = "your-private-key-id" + private_key = "-----BEGIN PRIVATE KEY-----\nYourPrivateRSAKey\n-----END PRIVATE KEY-----\n" + client_email = "your-service-account-email@your-project-id.iam.gserviceaccount.com" + client_id = "your-client-id" + auth_uri = "https://accounts.google.com/o/oauth2/auth" + token_uri = "https://accounts.google.com/o/oauth2/token" auth_provider_x509_cert_url = "https://www.googleapis.com/oauth2/v1/certs" - client_x509_cert_url = "https://www.googleapis.com/.../your-service-account-email%40your-project-id.iam.gserviceaccount.com" - universe_domain = "googleapis.com" - }} - is_enabled = true + client_x509_cert_url = "https://www.googleapis.com/.../your-service-account-email%40your-project-id.iam.gserviceaccount.com" + universe_domain = "googleapis.com" + } } + is_enabled = true } node_config = { num_cores = 4 diff --git a/docs/resources/read_replicas.md b/docs/resources/read_replicas.md index c730c72..c83aa43 100644 --- a/docs/resources/read_replicas.md +++ b/docs/resources/read_replicas.md @@ -15,15 +15,15 @@ The resource to create read replicas of a particular cluster. You can create mul ```terraform resource "ybm_read_replicas" "example_read_replica" { - read_replicas_info = [ + read_replicas_info = [ { - cloud_type = "GCP" + cloud_type = "GCP" num_replicas = 1 - num_nodes = 1 - region = "us-east4" - vpc_id = "example-vpc-id" + num_nodes = 1 + region = "us-east4" + vpc_id = "example-vpc-id" node_config = { - num_cores = 2 + num_cores = 2 disk_size_gb = 10 } } diff --git a/docs/resources/role.md b/docs/resources/role.md index 459f574..505bbcd 100644 --- a/docs/resources/role.md +++ b/docs/resources/role.md @@ -13,18 +13,18 @@ The resource to create a custom role in YugabyteDB Managed. ```terraform resource "ybm_role" "example_role" { - role_name = "example_role_name" - role_description = "example_role_description" #Optional - permission_list = [ - { - resource_type = "CLUSTER" - operation_groups = ["READ"] - }, - { - resource_type = "READ_REPLICA" - operation_groups = ["READ", "CREATE"] - } - ] + role_name = "example_role_name" + role_description = "example_role_description" #Optional + permission_list = [ + { + resource_type = "CLUSTER" + operation_groups = ["READ"] + }, + { + resource_type = "READ_REPLICA" + operation_groups = ["READ", "CREATE"] + } + ] } ``` diff --git a/docs/resources/user.md b/docs/resources/user.md index 793dfc2..00c2785 100644 --- a/docs/resources/user.md +++ b/docs/resources/user.md @@ -15,8 +15,8 @@ To invite a user with predefined built-in roles like Admin, Developer, Viewer ```terraform resource "ybm_user" "example_user" { - email = "example@example.com" - role_name = "Developer" + email = "example@example.com" + role_name = "Developer" } ``` @@ -24,8 +24,8 @@ To invite a user with custom user defined roles ```terraform resource "ybm_user" "example_custom_role_user" { - email = "example@example.com" - role_name = "example-custom-role-name" + email = "example@example.com" + role_name = "example-custom-role-name" } ``` diff --git a/docs/resources/vpc.md b/docs/resources/vpc.md index a9b2bc9..0d18426 100644 --- a/docs/resources/vpc.md +++ b/docs/resources/vpc.md @@ -13,7 +13,7 @@ The resource to create a VPC in YugabyteDB Managed. ```terraform resource "ybm_vpc" "example-vpc" { - name = "example-vpc" + name = "example-vpc" cloud = "GCP" # Use only one of either global cidr or region cidr global_cidr = "10.9.0.0/18" @@ -34,12 +34,12 @@ resource "ybm_vpc" "example-vpc" { ```terraform resource "ybm_vpc" "example-vpc" { - name = "example-vpc" + name = "example-vpc" cloud = "AWS" region_cidr_info = [ { region = "us-east-1" - cidr = "10.231.0.0/24" + cidr = "10.231.0.0/24" } ] } @@ -49,7 +49,7 @@ resource "ybm_vpc" "example-vpc" { ```terraform resource "ybm_vpc" "example-vpc" { - name = "example-vpc" + name = "example-vpc" cloud = "AZURE" region_cidr_info = [ { diff --git a/docs/resources/vpc_peering.md b/docs/resources/vpc_peering.md index d130945..fbca501 100644 --- a/docs/resources/vpc_peering.md +++ b/docs/resources/vpc_peering.md @@ -15,25 +15,25 @@ The resource to create a VPC peering in YugabyteDB Managed. #AWS VPC Peering resource "ybm_vpc_peering" "example_vpc_peering" { - name = "example_name" + name = "example_name" yugabytedb_vpc_id = "example_vpc_id" application_vpc_info = { - cloud = "AWS" + cloud = "AWS" account_id = "example_account_id" - region = "us-west1" - vpc_id = "application_vpc_id" - cidr = "example_cidr" + region = "us-west1" + vpc_id = "application_vpc_id" + cidr = "example_cidr" } } #GCP VPC Peering resource "ybm_vpc_peering" "example_vpc_peering" { - name = "example_name" + name = "example_name" yugabytedb_vpc_id = "example_vpc_id" application_vpc_info = { - cloud = "GCP" + cloud = "GCP" project = "example_project" - vpc_id = "application_vpc_id" + vpc_id = "application_vpc_id" } } ``` diff --git a/examples/data-sources/ybm_backup/data-source.tf b/examples/data-sources/ybm_backup/data-source.tf index 19c1363..3337dc0 100644 --- a/examples/data-sources/ybm_backup/data-source.tf +++ b/examples/data-sources/ybm_backup/data-source.tf @@ -1,5 +1,5 @@ data "ybm_backup" "example_backup" { - cluster_id = "example-cluster-id" + cluster_id = "example-cluster-id" most_recent = true } diff --git a/examples/data-sources/ybm_cluster/data-source.tf b/examples/data-sources/ybm_cluster/data-source.tf index ab91f25..3dfcd02 100644 --- a/examples/data-sources/ybm_cluster/data-source.tf +++ b/examples/data-sources/ybm_cluster/data-source.tf @@ -1,3 +1,3 @@ -data "ybm_cluster" "example_cluster"{ +data "ybm_cluster" "example_cluster" { cluster_name = "example-cluster" -} +} diff --git a/examples/provider/provider.tf b/examples/provider/provider.tf index 35eea37..4fa66f8 100644 --- a/examples/provider/provider.tf +++ b/examples/provider/provider.tf @@ -5,7 +5,7 @@ variable "auth_token" { } provider "ybm" { - host = "cloud.yugabyte.com" + host = "cloud.yugabyte.com" use_secure_host = false # True by default - auth_token = var.auth_token + auth_token = var.auth_token } diff --git a/examples/resources/ybm_allow_list/resource.tf b/examples/resources/ybm_allow_list/resource.tf index 86d67d4..2f5e262 100644 --- a/examples/resources/ybm_allow_list/resource.tf +++ b/examples/resources/ybm_allow_list/resource.tf @@ -1,5 +1,5 @@ resource "ybm_allow_list" "example_allow_list" { - allow_list_name = "allow-all" + allow_list_name = "allow-all" allow_list_description = "allow all the ip addresses" - cidr_list = ["0.0.0.0/0"] + cidr_list = ["0.0.0.0/0"] } diff --git a/examples/resources/ybm_api_key/built-in-role-api-key.tf b/examples/resources/ybm_api_key/built-in-role-api-key.tf index 0eb7d68..b252fed 100644 --- a/examples/resources/ybm_api_key/built-in-role-api-key.tf +++ b/examples/resources/ybm_api_key/built-in-role-api-key.tf @@ -1,7 +1,7 @@ resource "ybm_api_key" "example_api_key" { - name = "example-api-key-name" - description = "example API Key description" #Optional - duration = 10 - unit = "Hours" - role_name = "Developer" + name = "example-api-key-name" + description = "example API Key description" #Optional + duration = 10 + unit = "Hours" + role_name = "Developer" } \ No newline at end of file diff --git a/examples/resources/ybm_api_key/custom-role-api-key.tf b/examples/resources/ybm_api_key/custom-role-api-key.tf index 9c9d7ea..f3e89d8 100644 --- a/examples/resources/ybm_api_key/custom-role-api-key.tf +++ b/examples/resources/ybm_api_key/custom-role-api-key.tf @@ -1,7 +1,7 @@ resource "ybm_api_key" "example_custom_role_api_key" { - name = "example-api-key-name" - description = "example API Key description" #Optional - duration = 1 - unit = "Months" - role_name = "example-custom-role-name" + name = "example-api-key-name" + description = "example API Key description" #Optional + duration = 1 + unit = "Months" + role_name = "example-custom-role-name" } \ No newline at end of file diff --git a/examples/resources/ybm_associate_metrics_exporter_cluster/resource.tf b/examples/resources/ybm_associate_metrics_exporter_cluster/resource.tf index eaea1e1..fb75e2f 100644 --- a/examples/resources/ybm_associate_metrics_exporter_cluster/resource.tf +++ b/examples/resources/ybm_associate_metrics_exporter_cluster/resource.tf @@ -1,5 +1,5 @@ resource "ybm_associate_metrics_exporter_cluster" "metrics-srcluster" { - cluster_id= ybm_cluster.single_region_cluster.cluster_id - config_id = ybm_metrics_exporter.test.config_id - depends_on = [ ybm_cluster.single_region_cluster, ybm_metrics_exporter.test ] + cluster_id = ybm_cluster.single_region_cluster.cluster_id + config_id = ybm_metrics_exporter.test.config_id + depends_on = [ybm_cluster.single_region_cluster, ybm_metrics_exporter.test] } \ No newline at end of file diff --git a/examples/resources/ybm_backup/resource.tf b/examples/resources/ybm_backup/resource.tf index 7e44239..00171d6 100644 --- a/examples/resources/ybm_backup/resource.tf +++ b/examples/resources/ybm_backup/resource.tf @@ -1,5 +1,5 @@ resource "ybm_backup" "example_backup" { - cluster_id = "example-cluster-id" - backup_description = "example-backup-description" - retention_period_in_days = 2 + cluster_id = "example-cluster-id" + backup_description = "example-backup-description" + retention_period_in_days = 2 } diff --git a/examples/resources/ybm_cluster/asymmetric-geo-partitioned.tf b/examples/resources/ybm_cluster/asymmetric-geo-partitioned.tf new file mode 100644 index 0000000..c945f3f --- /dev/null +++ b/examples/resources/ybm_cluster/asymmetric-geo-partitioned.tf @@ -0,0 +1,58 @@ +variable "password" { + type = string + description = "YSQL and YCQL Password." + sensitive = true +} + +# Asymmetric Geo Partitioned Cluster +# Creates 3 regions us-west1/asia-east1/europe-central2 with num_cores as 2/4/4 respectively +resource "ybm_cluster" "asymmetric_geo_partitioned_cluster" { + cluster_name = "asymmetric-geo-partitioned-cluster" + cloud_type = "GCP" + cluster_type = "GEO_PARTITIONED" + cluster_region_info = [ + { + region = "us-west1" + num_nodes = 1 + num_cores = 2 + disk_size_gb = 50 #Optional + vpc_id = "example-vpc-id" #Optional + #vpc_name = "example-vpc-name" #Optional You can also use the VPC Name in place of vpc_id + }, + { + region = "asia-east1" + num_nodes = 1 + num_cores = 4 + disk_size_gb = 100 #Optional + vpc_id = "example-vpc-id" #Optional + #vpc_name = "example-vpc-name" #Optional You can also use the VPC Name in place of vpc_id + }, + { + region = "europe-central2" + num_nodes = 1 + num_cores = 4 + disk_size_gb = 100 # Optional + vpc_id = "example-vpc-id" #Optional + #vpc_name = "example-vpc-name" #Optional You can also use the VPC Name in place of vpc_id + } + ] + cluster_tier = "PAID" + cluster_allow_list_ids = ["example-allow-list-id-1", "example-allow-list-id-2"] #Optional + restore_backup_id = "example-backup-id" #Optional + fault_tolerance = "REGION" + node_config = { + num_cores = 2 + disk_size_gb = 50 #Optional + } + backup_schedules = [ + { + state = "ACTIVE" + retention_period_in_days = 10 + time_interval_in_days = 10 + } + ] #Optional + credentials = { + username = "example_user" + password = var.password + } +} \ No newline at end of file diff --git a/examples/resources/ybm_cluster/multi-region-rf5.tf b/examples/resources/ybm_cluster/multi-region-rf5.tf index 77274a9..b1a0112 100644 --- a/examples/resources/ybm_cluster/multi-region-rf5.tf +++ b/examples/resources/ybm_cluster/multi-region-rf5.tf @@ -40,7 +40,7 @@ resource "ybm_cluster" "multi_region_cluster" { vpc_id = "example-vpc-id" #Optional #vpc_name = "example-vpc-name" #Optional You can also use the VPC Name in place of vpc_id } - + ] cluster_tier = "PAID" cluster_allow_list_ids = ["example-allow-list-id-1", "example-allow-list-id-2"] #Optional diff --git a/examples/resources/ybm_cluster/single-region-aws-cmk.tf b/examples/resources/ybm_cluster/single-region-aws-cmk.tf index 9f6af82..3f32733 100644 --- a/examples/resources/ybm_cluster/single-region-aws-cmk.tf +++ b/examples/resources/ybm_cluster/single-region-aws-cmk.tf @@ -26,9 +26,9 @@ resource "ybm_cluster" "single_region" { num_nodes = 6 } ] - cluster_tier = "PAID" + cluster_tier = "PAID" # fault tolerance cannot be NONE for CMK enabled cluster - fault_tolerance = "ZONE" + fault_tolerance = "ZONE" cmk_spec = { provider_type = "AWS" @@ -39,7 +39,7 @@ resource "ybm_cluster" "single_region" { "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" ] } - is_enabled = true + is_enabled = true } node_config = { diff --git a/examples/resources/ybm_cluster/single-region-azure-cmk.tf b/examples/resources/ybm_cluster/single-region-azure-cmk.tf index 3f87088..0e85593 100644 --- a/examples/resources/ybm_cluster/single-region-azure-cmk.tf +++ b/examples/resources/ybm_cluster/single-region-azure-cmk.tf @@ -26,19 +26,19 @@ resource "ybm_cluster" "single_region" { num_nodes = 6 } ] - cluster_tier = "PAID" + cluster_tier = "PAID" # fault tolerance cannot be NONE for CMK enabled cluster - fault_tolerance = "ZONE" + fault_tolerance = "ZONE" cmk_spec = { provider_type = "AZURE" azure_cmk_spec = { - client_id = "your-client-id" + client_id = "your-client-id" client_secret = "your-client-secret" - tenant_id = "your-tenant-id" - key_name = "your-key-name" + tenant_id = "your-tenant-id" + key_name = "your-key-name" key_vault_uri = "your-key-vault-uri" } - is_enabled = true + is_enabled = true } node_config = { diff --git a/examples/resources/ybm_cluster/single-region-gcp-cmk.tf b/examples/resources/ybm_cluster/single-region-gcp-cmk.tf index 9e285f2..97a764a 100644 --- a/examples/resources/ybm_cluster/single-region-gcp-cmk.tf +++ b/examples/resources/ybm_cluster/single-region-gcp-cmk.tf @@ -25,31 +25,31 @@ resource "ybm_cluster" "single_region" { num_nodes = 6 } ] - cluster_tier = "PAID" + cluster_tier = "PAID" # fault tolerance cannot be NONE for CMK enabled cluster - fault_tolerance = "ZONE" + fault_tolerance = "ZONE" cmk_spec = { provider_type = "GCP" gcp_cmk_spec = { - location = "global" - key_ring_name = "example_cmk_key_ring" - key_name = "example_cmk_key" - protection_level = "software" - gcp_service_account = { - type = "service_account" - project_id = "your-project-id" - private_key_id = "your-private-key-id" - private_key = "-----BEGIN PRIVATE KEY-----\nYourPrivateRSAKey\n-----END PRIVATE KEY-----\n" - client_email = "your-service-account-email@your-project-id.iam.gserviceaccount.com" - client_id = "your-client-id" - auth_uri = "https://accounts.google.com/o/oauth2/auth" - token_uri = "https://accounts.google.com/o/oauth2/token" + location = "global" + key_ring_name = "example_cmk_key_ring" + key_name = "example_cmk_key" + protection_level = "software" + gcp_service_account = { + type = "service_account" + project_id = "your-project-id" + private_key_id = "your-private-key-id" + private_key = "-----BEGIN PRIVATE KEY-----\nYourPrivateRSAKey\n-----END PRIVATE KEY-----\n" + client_email = "your-service-account-email@your-project-id.iam.gserviceaccount.com" + client_id = "your-client-id" + auth_uri = "https://accounts.google.com/o/oauth2/auth" + token_uri = "https://accounts.google.com/o/oauth2/token" auth_provider_x509_cert_url = "https://www.googleapis.com/oauth2/v1/certs" - client_x509_cert_url = "https://www.googleapis.com/.../your-service-account-email%40your-project-id.iam.gserviceaccount.com" - universe_domain = "googleapis.com" - }} - is_enabled = true + client_x509_cert_url = "https://www.googleapis.com/.../your-service-account-email%40your-project-id.iam.gserviceaccount.com" + universe_domain = "googleapis.com" + } } + is_enabled = true } node_config = { num_cores = 4 diff --git a/examples/resources/ybm_read_replicas/resource.tf b/examples/resources/ybm_read_replicas/resource.tf index a2da249..f911595 100644 --- a/examples/resources/ybm_read_replicas/resource.tf +++ b/examples/resources/ybm_read_replicas/resource.tf @@ -1,13 +1,13 @@ resource "ybm_read_replicas" "example_read_replica" { - read_replicas_info = [ + read_replicas_info = [ { - cloud_type = "GCP" + cloud_type = "GCP" num_replicas = 1 - num_nodes = 1 - region = "us-east4" - vpc_id = "example-vpc-id" + num_nodes = 1 + region = "us-east4" + vpc_id = "example-vpc-id" node_config = { - num_cores = 2 + num_cores = 2 disk_size_gb = 10 } } diff --git a/examples/resources/ybm_role/resource.tf b/examples/resources/ybm_role/resource.tf index a7cde19..ead3b4a 100644 --- a/examples/resources/ybm_role/resource.tf +++ b/examples/resources/ybm_role/resource.tf @@ -1,14 +1,14 @@ resource "ybm_role" "example_role" { - role_name = "example_role_name" - role_description = "example_role_description" #Optional - permission_list = [ - { - resource_type = "CLUSTER" - operation_groups = ["READ"] - }, - { - resource_type = "READ_REPLICA" - operation_groups = ["READ", "CREATE"] - } - ] + role_name = "example_role_name" + role_description = "example_role_description" #Optional + permission_list = [ + { + resource_type = "CLUSTER" + operation_groups = ["READ"] + }, + { + resource_type = "READ_REPLICA" + operation_groups = ["READ", "CREATE"] + } + ] } \ No newline at end of file diff --git a/examples/resources/ybm_user/built-in-role-user.tf b/examples/resources/ybm_user/built-in-role-user.tf index 81e7a1a..d0341ee 100644 --- a/examples/resources/ybm_user/built-in-role-user.tf +++ b/examples/resources/ybm_user/built-in-role-user.tf @@ -1,4 +1,4 @@ resource "ybm_user" "example_user" { - email = "example@example.com" - role_name = "Developer" + email = "example@example.com" + role_name = "Developer" } \ No newline at end of file diff --git a/examples/resources/ybm_user/custom-role-user.tf b/examples/resources/ybm_user/custom-role-user.tf index 13d5d75..e346ce1 100644 --- a/examples/resources/ybm_user/custom-role-user.tf +++ b/examples/resources/ybm_user/custom-role-user.tf @@ -1,4 +1,4 @@ resource "ybm_user" "example_custom_role_user" { - email = "example@example.com" - role_name = "example-custom-role-name" + email = "example@example.com" + role_name = "example-custom-role-name" } \ No newline at end of file diff --git a/examples/resources/ybm_vpc/aws-regional-vpc.tf b/examples/resources/ybm_vpc/aws-regional-vpc.tf index 824ac92..550dfc3 100644 --- a/examples/resources/ybm_vpc/aws-regional-vpc.tf +++ b/examples/resources/ybm_vpc/aws-regional-vpc.tf @@ -1,10 +1,10 @@ resource "ybm_vpc" "example-vpc" { - name = "example-vpc" + name = "example-vpc" cloud = "AWS" region_cidr_info = [ { region = "us-east-1" - cidr = "10.231.0.0/24" + cidr = "10.231.0.0/24" } ] } \ No newline at end of file diff --git a/examples/resources/ybm_vpc/azure-vpc.tf b/examples/resources/ybm_vpc/azure-vpc.tf index cb17ed0..18911d3 100644 --- a/examples/resources/ybm_vpc/azure-vpc.tf +++ b/examples/resources/ybm_vpc/azure-vpc.tf @@ -1,5 +1,5 @@ resource "ybm_vpc" "example-vpc" { - name = "example-vpc" + name = "example-vpc" cloud = "AZURE" region_cidr_info = [ { diff --git a/examples/resources/ybm_vpc/gcp-global-cidr.tf b/examples/resources/ybm_vpc/gcp-global-cidr.tf index 9442cce..7ff87cb 100644 --- a/examples/resources/ybm_vpc/gcp-global-cidr.tf +++ b/examples/resources/ybm_vpc/gcp-global-cidr.tf @@ -1,5 +1,5 @@ resource "ybm_vpc" "example-vpc" { - name = "example-vpc" + name = "example-vpc" cloud = "GCP" # Use only one of either global cidr or region cidr global_cidr = "10.9.0.0/18" diff --git a/examples/resources/ybm_vpc_peering/resource.tf b/examples/resources/ybm_vpc_peering/resource.tf index e53d4fb..43e1450 100644 --- a/examples/resources/ybm_vpc_peering/resource.tf +++ b/examples/resources/ybm_vpc_peering/resource.tf @@ -1,24 +1,24 @@ #AWS VPC Peering resource "ybm_vpc_peering" "example_vpc_peering" { - name = "example_name" + name = "example_name" yugabytedb_vpc_id = "example_vpc_id" application_vpc_info = { - cloud = "AWS" + cloud = "AWS" account_id = "example_account_id" - region = "us-west1" - vpc_id = "application_vpc_id" - cidr = "example_cidr" + region = "us-west1" + vpc_id = "application_vpc_id" + cidr = "example_cidr" } } #GCP VPC Peering resource "ybm_vpc_peering" "example_vpc_peering" { - name = "example_name" + name = "example_name" yugabytedb_vpc_id = "example_vpc_id" application_vpc_info = { - cloud = "GCP" + cloud = "GCP" project = "example_project" - vpc_id = "application_vpc_id" + vpc_id = "application_vpc_id" } } \ No newline at end of file diff --git a/samples/cluster-multi-region.tf b/samples/cluster-multi-region.tf index 570bcb4..207726c 100644 --- a/samples/cluster-multi-region.tf +++ b/samples/cluster-multi-region.tf @@ -1,30 +1,30 @@ resource "ybm_cluster" "multi_region" { cluster_name = "terraform-test-posriniv-3" - cloud_type = "GCP" + cloud_type = "GCP" cluster_type = "SYNCHRONOUS" cluster_region_info = [ { - region = "us-west2" + region = "us-west2" num_nodes = 1 - vpc_id = ybm_vpc.newvpc.vpc_id + vpc_id = ybm_vpc.newvpc.vpc_id }, { - region = "asia-east1" + region = "asia-east1" num_nodes = 1 - vpc_id = ybm_vpc.newvpc.vpc_id + vpc_id = ybm_vpc.newvpc.vpc_id }, { - region = "europe-central2" + region = "europe-central2" num_nodes = 1 - vpc_id = ybm_vpc.newvpc.vpc_id + vpc_id = ybm_vpc.newvpc.vpc_id } ] - cluster_tier = "PAID" + cluster_tier = "PAID" cluster_allow_list_ids = [ybm_allow_list.mylist.allow_list_id] - restore_backup_id = ybm_backup.mybackup.backup_id - fault_tolerance = "REGION" + restore_backup_id = ybm_backup.mybackup.backup_id + fault_tolerance = "REGION" node_config = { - num_cores = 2 + num_cores = 2 disk_size_gb = 10 } credentials = { diff --git a/samples/cluster-single-region.tf b/samples/cluster-single-region.tf index 72abdca..c72f67f 100644 --- a/samples/cluster-single-region.tf +++ b/samples/cluster-single-region.tf @@ -92,8 +92,8 @@ resource "ybm_allow_list" "mylist" { resource "ybm_vpc" "newvpc" { - name = "terraform-vpc" - cloud = "GCP" + name = "terraform-vpc" + cloud = "GCP" # Use only one among global cidr and region cidr global_cidr = "10.9.0.0/18" # region_cidr_info = [