diff --git a/examples/allowlist/main.tf b/examples/allowlist/main.tf index 512c084a..ad60b2e5 100644 --- a/examples/allowlist/main.tf +++ b/examples/allowlist/main.tf @@ -7,6 +7,5 @@ terraform { } provider "couchbase-capella" { - host = var.host authentication_token = var.auth_token } diff --git a/examples/allowlist/terraform.template.tfvars b/examples/allowlist/terraform.template.tfvars index 1110a10e..78afbdd1 100644 --- a/examples/allowlist/terraform.template.tfvars +++ b/examples/allowlist/terraform.template.tfvars @@ -2,7 +2,6 @@ auth_token = "" organization_id = "" project_id = "" cluster_id = "" -host = "https://cloudapi.cloud.couchbase.com" allowlist = { cidr = "10.0.0.0/16" diff --git a/examples/allowlist/variables.tf b/examples/allowlist/variables.tf index fe188a57..1c6365b5 100644 --- a/examples/allowlist/variables.tf +++ b/examples/allowlist/variables.tf @@ -1,7 +1,3 @@ -variable "host" { - description = "The Host URL of Couchbase Cloud." -} - variable "organization_id" { description = "Capella Organization ID" } diff --git a/examples/apikey/main.tf b/examples/apikey/main.tf index e797bbda..4d971202 100644 --- a/examples/apikey/main.tf +++ b/examples/apikey/main.tf @@ -7,7 +7,6 @@ terraform { } provider "couchbase-capella" { - host = var.host authentication_token = var.auth_token } diff --git a/examples/apikey/terraform.template.tfvars b/examples/apikey/terraform.template.tfvars index 7eea755e..0aa85e02 100644 --- a/examples/apikey/terraform.template.tfvars +++ b/examples/apikey/terraform.template.tfvars @@ -1,6 +1,5 @@ auth_token = "" organization_id = "" -host = "https://cloudapi.cloud.couchbase.com" apikey = { name = "New Terraform Api Key" diff --git a/examples/apikey/variables.tf b/examples/apikey/variables.tf index 9d078f9b..3c82c373 100644 --- a/examples/apikey/variables.tf +++ b/examples/apikey/variables.tf @@ -1,8 +1,3 @@ -variable "host" { - default = "https://cloudapi.dev.nonprod-project-avengers.com" - description = "The Host URL of Couchbase Cloud." -} - variable "organization_id" { description = "Capella Organization ID" } @@ -33,4 +28,4 @@ variable "resources" { type = optional(string) })) default = [] -} \ No newline at end of file +} diff --git a/examples/appservice/main.tf b/examples/appservice/main.tf index 4669ebfe..ad60b2e5 100644 --- a/examples/appservice/main.tf +++ b/examples/appservice/main.tf @@ -7,6 +7,5 @@ terraform { } provider "couchbase-capella" { - host = var.host authentication_token = var.auth_token -} \ No newline at end of file +} diff --git a/examples/appservice/terraform.template.tfvars b/examples/appservice/terraform.template.tfvars index 3b6b03e4..d13e48d2 100644 --- a/examples/appservice/terraform.template.tfvars +++ b/examples/appservice/terraform.template.tfvars @@ -2,7 +2,6 @@ auth_token = "v4-api-key-secret" organization_id = "" project_id = "" cluster_id = "" -host = "https://cloudapi.cloud.couchbase.com" app_service = { name = "new-terraform-app-service" diff --git a/examples/appservice/variables.tf b/examples/appservice/variables.tf index cd5367d5..9ce7e932 100644 --- a/examples/appservice/variables.tf +++ b/examples/appservice/variables.tf @@ -1,7 +1,3 @@ -variable "host" { - description = "The Host URL of Couchbase Cloud." -} - variable "organization_id" { description = "Capella Organization ID" } @@ -31,4 +27,4 @@ variable "app_service" { ram = number }) }) -} \ No newline at end of file +} diff --git a/examples/backup/create_backups/main.tf b/examples/backup/create_backups/main.tf index d26d4f29..addd67ec 100644 --- a/examples/backup/create_backups/main.tf +++ b/examples/backup/create_backups/main.tf @@ -7,6 +7,5 @@ terraform { } provider "couchbase-capella" { - host = var.host authentication_token = var.auth_token } \ No newline at end of file diff --git a/examples/backup/create_backups/terraform.template.tfvars b/examples/backup/create_backups/terraform.template.tfvars index 4e888be5..e0b32d86 100644 --- a/examples/backup/create_backups/terraform.template.tfvars +++ b/examples/backup/create_backups/terraform.template.tfvars @@ -1,5 +1,4 @@ auth_token = "" -host = "https://cloudapi.cloud.couchbase.com" organization_id = "" project_id = "" diff --git a/examples/backup/create_backups/variables.tf b/examples/backup/create_backups/variables.tf index a106e2ea..d90f3060 100644 --- a/examples/backup/create_backups/variables.tf +++ b/examples/backup/create_backups/variables.tf @@ -1,7 +1,3 @@ -variable "host" { - description = "The Host URL of Couchbase Cloud." -} - variable "organization_id" { description = "Capella Organization ID" } diff --git a/examples/backup/list_backups/main.tf b/examples/backup/list_backups/main.tf index 4669ebfe..e58f5699 100644 --- a/examples/backup/list_backups/main.tf +++ b/examples/backup/list_backups/main.tf @@ -7,6 +7,5 @@ terraform { } provider "couchbase-capella" { - host = var.host authentication_token = var.auth_token } \ No newline at end of file diff --git a/examples/backup/list_backups/terraform.template.tfvars b/examples/backup/list_backups/terraform.template.tfvars index 4e888be5..e0b32d86 100644 --- a/examples/backup/list_backups/terraform.template.tfvars +++ b/examples/backup/list_backups/terraform.template.tfvars @@ -1,5 +1,4 @@ auth_token = "" -host = "https://cloudapi.cloud.couchbase.com" organization_id = "" project_id = "" diff --git a/examples/backup/list_backups/variables.tf b/examples/backup/list_backups/variables.tf index a106e2ea..d90f3060 100644 --- a/examples/backup/list_backups/variables.tf +++ b/examples/backup/list_backups/variables.tf @@ -1,7 +1,3 @@ -variable "host" { - description = "The Host URL of Couchbase Cloud." -} - variable "organization_id" { description = "Capella Organization ID" } diff --git a/examples/backup_schedule/main.tf b/examples/backup_schedule/main.tf index 4669ebfe..e58f5699 100644 --- a/examples/backup_schedule/main.tf +++ b/examples/backup_schedule/main.tf @@ -7,6 +7,5 @@ terraform { } provider "couchbase-capella" { - host = var.host authentication_token = var.auth_token } \ No newline at end of file diff --git a/examples/backup_schedule/terraform.template.tfvars b/examples/backup_schedule/terraform.template.tfvars index fe836d25..3f5601e0 100644 --- a/examples/backup_schedule/terraform.template.tfvars +++ b/examples/backup_schedule/terraform.template.tfvars @@ -1,5 +1,4 @@ auth_token = "" -host = "https://cloudapi.cloud.couchbase.com" organization_id = "" project_id = "" diff --git a/examples/backup_schedule/variables.tf b/examples/backup_schedule/variables.tf index 87858cb2..fb404c50 100644 --- a/examples/backup_schedule/variables.tf +++ b/examples/backup_schedule/variables.tf @@ -1,7 +1,3 @@ -variable "host" { - description = "The Host URL of Couchbase Cloud." -} - variable "organization_id" { description = "Capella Organization ID" } diff --git a/examples/bucket/main.tf b/examples/bucket/main.tf index e797bbda..4d971202 100644 --- a/examples/bucket/main.tf +++ b/examples/bucket/main.tf @@ -7,7 +7,6 @@ terraform { } provider "couchbase-capella" { - host = var.host authentication_token = var.auth_token } diff --git a/examples/bucket/terraform.template.tfvars b/examples/bucket/terraform.template.tfvars index 42fe240d..5c66c6d1 100644 --- a/examples/bucket/terraform.template.tfvars +++ b/examples/bucket/terraform.template.tfvars @@ -1,5 +1,4 @@ auth_token = "" -host = "https://cloudapi.cloud.couchbase.com" organization_id = "" project_id = "" diff --git a/examples/bucket/variables.tf b/examples/bucket/variables.tf index a135fe07..a5e73055 100644 --- a/examples/bucket/variables.tf +++ b/examples/bucket/variables.tf @@ -1,7 +1,3 @@ -variable "host" { - description = "The Host URL of Couchbase Cloud." -} - variable "organization_id" { description = "Capella Organization ID" } diff --git a/examples/certificate/main.tf b/examples/certificate/main.tf index 512c084a..ad60b2e5 100644 --- a/examples/certificate/main.tf +++ b/examples/certificate/main.tf @@ -7,6 +7,5 @@ terraform { } provider "couchbase-capella" { - host = var.host authentication_token = var.auth_token } diff --git a/examples/certificate/terraform.template.tfvars b/examples/certificate/terraform.template.tfvars index b771150c..651a5126 100644 --- a/examples/certificate/terraform.template.tfvars +++ b/examples/certificate/terraform.template.tfvars @@ -1,5 +1,4 @@ auth_token = "" organization_id = "" -host = "https://cloudapi.cloud.couchbase.com" project_id = "" cluster_id = "" \ No newline at end of file diff --git a/examples/certificate/variables.tf b/examples/certificate/variables.tf index c7b76e60..34301a4f 100644 --- a/examples/certificate/variables.tf +++ b/examples/certificate/variables.tf @@ -1,7 +1,3 @@ -variable "host" { - description = "The Host URL of Couchbase Cloud." -} - variable "organization_id" { description = "Capella Organization ID" } diff --git a/examples/cluster/main.tf b/examples/cluster/main.tf index e797bbda..4d971202 100644 --- a/examples/cluster/main.tf +++ b/examples/cluster/main.tf @@ -7,7 +7,6 @@ terraform { } provider "couchbase-capella" { - host = var.host authentication_token = var.auth_token } diff --git a/examples/cluster/terraform.template.tfvars b/examples/cluster/terraform.template.tfvars index d3c8145e..b5260bb3 100644 --- a/examples/cluster/terraform.template.tfvars +++ b/examples/cluster/terraform.template.tfvars @@ -1,6 +1,5 @@ auth_token = "" organization_id = "" -host = "https://cloudapi.cloud.couchbase.com" project_id = "" cloud_provider = { diff --git a/examples/cluster/variables.tf b/examples/cluster/variables.tf index 1d82eda8..5cfe791d 100644 --- a/examples/cluster/variables.tf +++ b/examples/cluster/variables.tf @@ -1,7 +1,3 @@ -variable "host" { - description = "The Host URL of Couchbase Cloud." -} - variable "auth_token" { description = "Authentication API Key" sensitive = true diff --git a/examples/database_credential/main.tf b/examples/database_credential/main.tf index e797bbda..4d971202 100644 --- a/examples/database_credential/main.tf +++ b/examples/database_credential/main.tf @@ -7,7 +7,6 @@ terraform { } provider "couchbase-capella" { - host = var.host authentication_token = var.auth_token } diff --git a/examples/database_credential/terraform.template.tfvars b/examples/database_credential/terraform.template.tfvars index d793cdbd..9bc03ab8 100644 --- a/examples/database_credential/terraform.template.tfvars +++ b/examples/database_credential/terraform.template.tfvars @@ -1,7 +1,6 @@ auth_token = "" organization_id = "" project_id = "" -host = "https://cloudapi.cloud.couchbase.com" cluster_id = "" database_credential = { diff --git a/examples/database_credential/variables.tf b/examples/database_credential/variables.tf index de1b88a2..1fc9007a 100644 --- a/examples/database_credential/variables.tf +++ b/examples/database_credential/variables.tf @@ -1,7 +1,3 @@ -variable "host" { - description = "The Host URL of Couchbase Cloud." -} - variable "organization_id" { description = "Capella Organization ID" } diff --git a/examples/getting_started/cluster.tf b/examples/getting_started/cluster.tf index 575ec6f3..c7512692 100644 --- a/examples/getting_started/cluster.tf +++ b/examples/getting_started/cluster.tf @@ -37,6 +37,7 @@ resource "couchbase-capella_cluster" "new_cluster" { availability = { "type" : var.cluster.availability_zone } + configuration_type = var.cluster.configuration_type support = { plan = var.support.plan timezone = var.support.timezone diff --git a/examples/getting_started/main.tf b/examples/getting_started/main.tf index 512c084a..ad60b2e5 100644 --- a/examples/getting_started/main.tf +++ b/examples/getting_started/main.tf @@ -7,6 +7,5 @@ terraform { } provider "couchbase-capella" { - host = var.host authentication_token = var.auth_token } diff --git a/examples/getting_started/terraform.template.tfvars b/examples/getting_started/terraform.template.tfvars index 47c07a90..fba5e763 100644 --- a/examples/getting_started/terraform.template.tfvars +++ b/examples/getting_started/terraform.template.tfvars @@ -1,5 +1,4 @@ auth_token = "" -host = "https://cloudapi.cloud.couchbase.com" organization_id = "" project_name = "My First Terraform Project" diff --git a/examples/getting_started/variables.tf b/examples/getting_started/variables.tf index 00c652fb..1b168b5e 100644 --- a/examples/getting_started/variables.tf +++ b/examples/getting_started/variables.tf @@ -1,7 +1,3 @@ -variable "host" { - description = "The Host URL of Couchbase Cloud." -} - variable "auth_token" { description = "Authentication API Key" sensitive = true diff --git a/examples/organization/main.tf b/examples/organization/main.tf index 512c084a..ad60b2e5 100644 --- a/examples/organization/main.tf +++ b/examples/organization/main.tf @@ -7,6 +7,5 @@ terraform { } provider "couchbase-capella" { - host = var.host authentication_token = var.auth_token } diff --git a/examples/organization/terraform.template.tfvars b/examples/organization/terraform.template.tfvars index adc74c4b..58acbe36 100644 --- a/examples/organization/terraform.template.tfvars +++ b/examples/organization/terraform.template.tfvars @@ -1,3 +1,2 @@ auth_token = "" organization_id = "" -host = "https://cloudapi.cloud.couchbase.com" \ No newline at end of file diff --git a/examples/organization/variables.tf b/examples/organization/variables.tf index f55a3099..85d5ed2c 100644 --- a/examples/organization/variables.tf +++ b/examples/organization/variables.tf @@ -1,7 +1,3 @@ -variable "host" { - description = "The Host URL of Couchbase Cloud." -} - variable "auth_token" { description = "Authentication API Key" sensitive = true diff --git a/examples/project/main.tf b/examples/project/main.tf index 512c084a..ad60b2e5 100644 --- a/examples/project/main.tf +++ b/examples/project/main.tf @@ -7,6 +7,5 @@ terraform { } provider "couchbase-capella" { - host = var.host authentication_token = var.auth_token } diff --git a/examples/project/terraform.template.tfvars b/examples/project/terraform.template.tfvars index adc74c4b..ac31666c 100644 --- a/examples/project/terraform.template.tfvars +++ b/examples/project/terraform.template.tfvars @@ -1,3 +1,2 @@ auth_token = "" -organization_id = "" -host = "https://cloudapi.cloud.couchbase.com" \ No newline at end of file +organization_id = "" \ No newline at end of file diff --git a/examples/project/variables.tf b/examples/project/variables.tf index 0f391c9d..50366c0f 100644 --- a/examples/project/variables.tf +++ b/examples/project/variables.tf @@ -1,7 +1,3 @@ -variable "host" { - description = "The Host URL of Couchbase Cloud." -} - variable "organization_id" { description = "Capella Organization ID" } @@ -14,4 +10,4 @@ variable "auth_token" { variable "project_name" { default = "terraform-couchbasecapella-project" description = "Project Name for Project Created via Terraform" -} \ No newline at end of file +} diff --git a/examples/user/main.tf b/examples/user/main.tf index 512c084a..ad60b2e5 100644 --- a/examples/user/main.tf +++ b/examples/user/main.tf @@ -7,6 +7,5 @@ terraform { } provider "couchbase-capella" { - host = var.host authentication_token = var.auth_token } diff --git a/examples/user/terraform.template.tfvars b/examples/user/terraform.template.tfvars index 7e6eb4f7..244e6832 100644 --- a/examples/user/terraform.template.tfvars +++ b/examples/user/terraform.template.tfvars @@ -1,7 +1,5 @@ auth_token = "" organization_id = "" -host = "https://cloudapi.cloud.couchbase.com" - user = { name = "John ABC" diff --git a/examples/user/variables.tf b/examples/user/variables.tf index a3aeeb6f..04141785 100644 --- a/examples/user/variables.tf +++ b/examples/user/variables.tf @@ -1,7 +1,3 @@ -variable "host" { - description = "The Host URL of Couchbase Cloud." -} - variable "organization_id" { description = "Capella Organization ID" } diff --git a/internal/provider/provider.go b/internal/provider/provider.go index cfc2555b..446cd00b 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -26,7 +26,7 @@ const ( capellaAuthenticationTokenField = "authentication_token" capellaPublicAPIHostField = "host" apiRequestTimeout = 60 * time.Second - defaultAPIHostURL = "https://cloudapi.couchbase.com" + defaultAPIHostURL = "https://cloudapi.cloud.couchbase.com" providerName = "couchbase-capella" ) @@ -55,7 +55,7 @@ func (p *capellaProvider) Schema(_ context.Context, _ provider.SchemaRequest, re resp.Schema = schema.Schema{ Attributes: map[string]schema.Attribute{ capellaPublicAPIHostField: schema.StringAttribute{ - Required: true, + Optional: true, Description: "Capella Public API HTTPS Host URL", }, capellaAuthenticationTokenField: schema.StringAttribute{ @@ -83,7 +83,7 @@ func (p *capellaProvider) Configure(ctx context.Context, req provider.ConfigureR // attributes, it must be a known value. // if the host URL is not provided, connect to the production Capella API host url by default. - if config.Host.IsUnknown() { + if config.Host.IsNull() { config.Host = types.StringValue(defaultAPIHostURL) }