Skip to content

Commit

Permalink
Update resource naming in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Talina06 committed Dec 6, 2023
1 parent c71c835 commit 930ffdf
Show file tree
Hide file tree
Showing 36 changed files with 95 additions and 94 deletions.
6 changes: 3 additions & 3 deletions examples/allowlist/create_allowlist.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
output "new_allowlist" {
value = capella_allowlist.new_allowlist
value = couchbase-capella_allowlist.new_allowlist
}

output "allowlist_id" {
value = capella_allowlist.new_allowlist.id
value = couchbase-capella_allowlist.new_allowlist.id
}

resource "capella_allowlist" "new_allowlist" {
resource "couchbase-capella_allowlist" "new_allowlist" {
organization_id = var.organization_id
project_id = var.project_id
cluster_id = var.cluster_id
Expand Down
4 changes: 2 additions & 2 deletions examples/allowlist/list_allowlists.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
output "allowlists_list" {
value = data.capella_allowlists.existing_allowlists
value = data.couchbase-capella_allowlists.existing_allowlists
}

data "capella_allowlists" "existing_allowlists" {
data "couchbase-capella_allowlists" "existing_allowlists" {
organization_id = var.organization_id
project_id = var.project_id
cluster_id = var.cluster_id
Expand Down
6 changes: 3 additions & 3 deletions examples/apikey/create_apikey.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
output "new_apikey" {
value = capella_apikey.new_apikey
value = couchbase-capella_apikey.new_apikey
sensitive = true
}

output "apikey_id" {
value = capella_apikey.new_apikey.id
value = couchbase-capella_apikey.new_apikey.id
}

resource "capella_apikey" "new_apikey" {
resource "couchbase-capella_apikey" "new_apikey" {
organization_id = var.organization_id
name = var.apikey.name
description = var.apikey.description
Expand Down
4 changes: 2 additions & 2 deletions examples/apikey/list_apikeys.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
output "apikeys_list" {
value = data.capella_apikeys.existing_apikeys
value = data.couchbase-capella_apikeys.existing_apikeys
}

data "capella_apikeys" "existing_apikeys" {
data "couchbase-capella_apikeys" "existing_apikeys" {
organization_id = var.organization_id
}
6 changes: 3 additions & 3 deletions examples/appservice/create_app_service.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
output "new_app_service" {
value = capella_app_service.new_app_service
value = couchbase-capella_app_service.new_app_service
}

output "appservice_id" {
value = capella_app_service.new_app_service.id
value = couchbase-capella_app_service.new_app_service.id
}

resource "capella_app_service" "new_app_service" {
resource "couchbase-capella_app_service" "new_app_service" {
organization_id = var.organization_id
project_id = var.project_id
cluster_id = var.cluster_id
Expand Down
4 changes: 2 additions & 2 deletions examples/appservice/list_app_services.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
output "app_services_list" {
value = data.capella_app_services.existing_app_services
value = data.couchbase-capella_app_services.existing_app_services
}

data "capella_app_services" "existing_app_services" {
data "couchbase-capella_app_services" "existing_app_services" {
organization_id = var.organization_id
}
4 changes: 2 additions & 2 deletions examples/backup/create_backup.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
output "new_backup" {
value = capella_backup.new_backup
value = couchbase-capella_backup.new_backup
}

resource "capella_backup" "new_backup" {
resource "couchbase-capella_backup" "new_backup" {
organization_id = var.organization_id
project_id = var.project_id
cluster_id = var.cluster_id
Expand Down
4 changes: 2 additions & 2 deletions examples/backup/list_backups.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
output "backups_list" {
value = data.capella_backups.existing_backups
value = data.couchbase-capella_backups.existing_backups
}

data "capella_backups" "existing_backups" {
data "couchbase-capella_backups" "existing_backups" {
organization_id = var.organization_id
project_id = var.project_id
cluster_id = var.cluster_id
Expand Down
4 changes: 2 additions & 2 deletions examples/backup_schedule/create_backup_schedule.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
output "new_backup_schedule" {
value = capella_backup_schedule.new_backup_schedule
value = couchbase-capella_backup_schedule.new_backup_schedule
}

resource "capella_backup_schedule" "new_backup_schedule" {
resource "couchbase-capella_backup_schedule" "new_backup_schedule" {
organization_id = var.organization_id
project_id = var.project_id
cluster_id = var.cluster_id
Expand Down
6 changes: 3 additions & 3 deletions examples/bucket/create_bucket.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
output "new_bucket" {
value = capella_bucket.new_bucket
value = couchbase-capella_bucket.new_bucket
}

output "bucket_id" {
value = capella_bucket.new_bucket.id
value = couchbase-capella_bucket.new_bucket.id
}

resource "capella_bucket" "new_bucket" {
resource "couchbase-capella_bucket" "new_bucket" {
name = var.bucket.name
organization_id = var.organization_id
project_id = var.project_id
Expand Down
4 changes: 2 additions & 2 deletions examples/bucket/list_buckets.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
output "buckets_list" {
value = data.capella_buckets.existing_buckets
value = data.couchbase-capella_buckets.existing_buckets
}

data "capella_buckets" "existing_buckets" {
data "couchbase-capella_buckets" "existing_buckets" {
organization_id = var.organization_id
project_id = var.project_id
cluster_id = var.cluster_id
Expand Down
4 changes: 2 additions & 2 deletions examples/certificate/get_certificate.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
output "existing_certificate" {
value = data.capella_certificate.existing_certificate
value = data.couchbase-capella_certificate.existing_certificate
}

data "capella_certificate" "existing_certificate" {
data "couchbase-capella_certificate" "existing_certificate" {
organization_id = var.organization_id
project_id = var.project_id
cluster_id = var.cluster_id
Expand Down
6 changes: 3 additions & 3 deletions examples/cluster/create_cluster.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
output "new_cluster" {
value = capella_cluster.new_cluster
value = couchbase-capella_cluster.new_cluster
}

output "cluster_id" {
value = capella_cluster.new_cluster.id
value = couchbase-capella_cluster.new_cluster.id
}

resource "capella_cluster" "new_cluster" {
resource "couchbase-capella_cluster" "new_cluster" {
organization_id = var.organization_id
project_id = var.project_id
name = var.cluster.name
Expand Down
6 changes: 3 additions & 3 deletions examples/database_credential/create_database_credential.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
output "new_database_credential" {
value = capella_database_credential.new_database_credential
value = couchbase-capella_database_credential.new_database_credential
sensitive = true
}

output "database_credential_id" {
value = capella_database_credential.new_database_credential.id
value = couchbase-capella_database_credential.new_database_credential.id
}

resource "capella_database_credential" "new_database_credential" {
resource "couchbase-capella_database_credential" "new_database_credential" {
name = var.database_credential.database_credential_name
organization_id = var.organization_id
project_id = var.project_id
Expand Down
4 changes: 2 additions & 2 deletions examples/database_credential/list_database_credentials.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
output "database_credentials_list" {
value = data.capella_database_credentials.existing_credentials
value = data.couchbase-capella_database_credentials.existing_credentials
}

data "capella_database_credentials" "existing_credentials" {
data "couchbase-capella_database_credentials" "existing_credentials" {
organization_id = var.organization_id
project_id = var.project_id
cluster_id = var.cluster_id
Expand Down
8 changes: 0 additions & 8 deletions examples/demo/allowlist.tf

This file was deleted.

11 changes: 0 additions & 11 deletions examples/demo/certificate.tf

This file was deleted.

File renamed without changes.
8 changes: 8 additions & 0 deletions examples/getting_started/allowlist.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resource "couchbase-capella_allowlist" "new_allowlist" {
organization_id = var.organization_id
project_id = couchbase-capella_project.new_project.id
cluster_id = couchbase-capella_cluster.new_cluster.id
cidr = var.cidr
comment = var.comment
expires_at = var.expires_at
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Stores the API key details in an output variable.
# Can be viewed using `terraform output apikey` command
output "apikey" {
value = capella_apikey.new_apikey
value = couchbase-capella_apikey.new_apikey
sensitive = true
}

resource "capella_apikey" "new_apikey" {
resource "couchbase-capella_apikey" "new_apikey" {
organization_id = var.organization_id
name = var.apikey.name
organization_roles = var.apikey.organization_roles
allowed_cidrs = var.apikey.allowed_cidrs
resources = [
{
id = capella_project.new_project.id
id = couchbase-capella_project.new_project.id
roles = ["projectManager", "projectDataReader"]
type = "project"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
# Stores the app service details in an output variable.
# Can be viewed using `terraform output app_service` command
output "app_service" {
value = capella_app_service.new_app_service
value = couchbase-capella_app_service.new_app_service
}

resource "capella_app_service" "new_app_service" {
resource "couchbase-capella_app_service" "new_app_service" {
organization_id = var.organization_id
project_id = capella_project.new_project.id
cluster_id = capella_cluster.new_cluster.id
project_id = couchbase-capella_project.new_project.id
cluster_id = couchbase-capella_cluster.new_cluster.id
name = var.app_service.name
description = var.app_service.description
nodes = var.app_service.nodes
compute = {
cpu = var.app_service.compute.cpu
ram = var.app_service.compute.ram
}
version = var.app_service.version
version = var.app_service.version
depends_on = [couchbase-capella_cluster.new_cluster, couchbase-capella_bucket.new_bucket]
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Stores the bucket name in an output variable.
# Can be viewed using `terraform output bucket` command
output "bucket" {
value = capella_bucket.new_bucket.name
value = couchbase-capella_bucket.new_bucket.name
}

resource "capella_bucket" "new_bucket" {
resource "couchbase-capella_bucket" "new_bucket" {
name = var.bucket.name
organization_id = var.organization_id
project_id = capella_project.new_project.id
cluster_id = capella_cluster.new_cluster.id
project_id = couchbase-capella_project.new_project.id
cluster_id = couchbase-capella_cluster.new_cluster.id
type = var.bucket.type
storage_backend = var.bucket.storage_backend
memory_allocation_in_mb = var.bucket.memory_allocation_in_mb
Expand Down
11 changes: 11 additions & 0 deletions examples/getting_started/certificate.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Stores the certificate details in an output variable.
# Can be viewed using `terraform output certificate` command
output "certificate" {
value = data.couchbase-capella_certificate.existing_certificate
}

data "couchbase-capella_certificate" "existing_certificate" {
organization_id = var.organization_id
project_id = couchbase-capella_project.new_project.id
cluster_id = couchbase-capella_cluster.new_cluster.id
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Stores the cluster details in an output variable.
# Can be viewed using `terraform output cluster` command
output "cluster" {
value = capella_cluster.new_cluster
value = couchbase-capella_cluster.new_cluster
}

resource "capella_cluster" "new_cluster" {
resource "couchbase-capella_cluster" "new_cluster" {
organization_id = var.organization_id
project_id = capella_project.new_project.id
project_id = couchbase-capella_project.new_project.id
name = var.cluster.name
description = "My first test cluster for multiple services."
cloud_provider = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Stores the database_credential details in an output variable.
# Can be viewed using `terraform output database_credential` command
output "database_credential" {
value = capella_database_credential.new_database_credential
value = couchbase-capella_database_credential.new_database_credential
sensitive = true
}

resource "capella_database_credential" "new_database_credential" {
resource "couchbase-capella_database_credential" "new_database_credential" {
name = var.database_credential_name
organization_id = var.organization_id
project_id = capella_project.new_project.id
cluster_id = capella_cluster.new_cluster.id
project_id = couchbase-capella_project.new_project.id
cluster_id = couchbase-capella_cluster.new_cluster.id
password = var.password
access = var.access
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Stores the organization name in an output variable.
# Can be viewed using `terraform output organization` command
output "organization" {
value = data.capella_organization.existing_organization
value = data.couchbase-capella_organization.existing_organization
}

data "capella_organization" "existing_organization" {
data "couchbase-capella_organization" "existing_organization" {
organization_id = var.organization_id
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Stores the project name in an output variable.
# Can be viewed using `terraform output project` command
output "project" {
value = capella_project.new_project.name
value = couchbase-capella_project.new_project.name
}

resource "capella_project" "new_project" {
resource "couchbase-capella_project" "new_project" {
organization_id = var.organization_id
name = var.project_name
description = "A Capella Project that will host many Capella clusters."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ access = [

comment = "Allow access from a public IP"
cidr = "8.8.8.8/32"
expires_at = "2023-11-30T23:59:59.465Z"
expires_at = "2043-11-30T23:59:59.465Z"

bucket = {
name = "new_terraform_bucket"
Expand Down
6 changes: 3 additions & 3 deletions examples/demo/user.tf → examples/getting_started/user.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Stores the user details in an output variable.
# Can be viewed using `terraform output user` command
output "user" {
value = capella_user.new_user
value = couchbase-capella_user.new_user
}

resource "capella_user" "new_user" {
resource "couchbase-capella_user" "new_user" {
organization_id = var.organization_id

name = var.user.name
Expand All @@ -17,7 +17,7 @@ resource "capella_user" "new_user" {
resources = [
{
type = "project"
id = capella_project.new_project.id
id = couchbase-capella_project.new_project.id
roles = [
"projectViewer",
"projectDataReaderWriter"
Expand Down
File renamed without changes.
Loading

0 comments on commit 930ffdf

Please sign in to comment.