terraform {
required_providers {
scylladbcloud = {
source = "scylladb/scylladbcloud"
}
}
}
provider "scylladbcloud" {
endpoint = "https://api-v2.lab.dbaas.scyop.net"
token = MY_TOKEN
}
# Create a cluster on AWS cloud.
resource "scylladbcloud_cluster" "example" {
name = "My Cluster"
cloud = "AWS"
region = "us-east-1"
node_count = 3
node_type = "i3.xlarge"
cidr_block = "172.31.0.0/16"
enable_vpc_peering = true
enable_dns = true
}
output "scylladbcloud_cluster_id" {
value = scylladbcloud_cluster.example.id
}
output "scylladbcloud_cluster_datacenter" {
value = scylladbcloud_cluster.example.datacenter
}
$ terraform init
Initializing the backend...
Initializing provider plugins...
- Finding latest version of scylladb/scylladbcloud...
- Installing scylladb/scylladbcloud v1.3.0...
- Installed scylladb/scylladbcloud v1.3.0 (self-signed, key ID A25EFAA782EF5641)
Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://www.terraform.io/docs/cli/plugins/signing.html
Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
$ terraform plan
╷
│ Error: Request cancelled
│
│ with provider["registry.terraform.io/scylladb/scylladbcloud"],
│ on main.tf line 9, in provider "scylladbcloud":
│ 9: provider "scylladbcloud" {
│
│ The plugin.(*GRPCProvider).ConfigureProvider request was cancelled.
╵
Stack trace from the terraform-provider-scylladbcloud_v1.3.0 plugin:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x6e5de7]
goroutine 83 [running]:
github.com/scylladb/terraform-provider-scylladbcloud/internal/scylla.(*Client).callAPI(0xc00037e510, {0xd77860?, 0xc000691440}, {0xc44172?, 0x0?}, {0xc00003e540?, 0x44d454?}, {0x0?, 0x0?}, {0xb258e0, ...}, ...)
github.com/scylladb/terraform-provider-scylladbcloud/internal/scylla/client.go:180 +0x687
github.com/scylladb/terraform-provider-scylladbcloud/internal/scylla.(*Client).get(...)
github.com/scylladb/terraform-provider-scylladbcloud/internal/scylla/client.go:187
github.com/scylladb/terraform-provider-scylladbcloud/internal/scylla.(*Client).ListCloudProviderRegions(0xbaf5e0?, {0xd77860, 0xc000691440}, 0xd6ed78?)
github.com/scylladb/terraform-provider-scylladbcloud/internal/scylla/endpoints.go:22 +0x150
github.com/scylladb/terraform-provider-scylladbcloud/internal/scylla.BuildCloudmeta({0xd77860, 0xc000691440}, 0xc4b6d3?)
github.com/scylladb/terraform-provider-scylladbcloud/internal/scylla/cloudmeta.go:99 +0x33d
github.com/scylladb/terraform-provider-scylladbcloud/internal/scylla.(*Client).Auth(0xc00037e510, {0xd77860, 0xc000691440}, {0xc00003e630, 0x27})
github.com/scylladb/terraform-provider-scylladbcloud/internal/scylla/client.go:51 +0x1e9
github.com/scylladb/terraform-provider-scylladbcloud/internal/provider.configure({0xd77860, 0xc000691440}, 0xc000280720, 0x1?)
github.com/scylladb/terraform-provider-scylladbcloud/internal/provider/provider.go:81 +0x2b7
github.com/scylladb/terraform-provider-scylladbcloud/internal/provider.New.func1({0xd77860?, 0xc000691440?}, 0xc000691440?)
github.com/scylladb/terraform-provider-scylladbcloud/internal/provider/provider.go:53 +0x2d
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Provider).Configure(0xc000280720, {0xd77860, 0xc000691440}, 0xd?)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/provider.go:297 +0x1f5
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ConfigureProvider(0xc0002845e8, {0xd77860?, 0xc000691020?}, 0xc0000112d8)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:557 +0x345
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.muxServer.ConfigureProvider({0xc00037e570, 0xc00037e5d0, {0xc0003b8480, 0x1, 0x1}, 0xc00037e5a0, 0xc000287dd0, 0xc000287dc0, 0xc00037e600}, {0xd77860, ...}, ...)
github.com/hashicorp/[email protected]/tf5muxserver/mux_server_ConfigureProvider.go:25 +0x1f3
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).Configure(0xc0002a9040, {0xd77860?, 0xc000690720?}, 0xc00022e780)
github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:556 +0x2d3
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_Configure_Handler({0xc19c20?, 0xc0002a9040}, {0xd77860, 0xc000690720}, 0xc0000f9570, 0x0)
github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:331 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0003303c0, {0xd7b360, 0xc000102680}, 0xc0002ea6c0, 0xc000478600, 0x11fccf8, 0x0)
google.golang.org/[email protected]/server.go:1340 +0xd23
google.golang.org/grpc.(*Server).handleStream(0xc0003303c0, {0xd7b360, 0xc000102680}, 0xc0002ea6c0, 0x0)
google.golang.org/[email protected]/server.go:1713 +0xa2f
google.golang.org/grpc.(*Server).serveStreams.func1.2()
google.golang.org/[email protected]/server.go:965 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/[email protected]/server.go:963 +0x28a
Error: The terraform-provider-scylladbcloud_v1.3.0 plugin crashed!
This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.
$ curl -X POST https://api-v2.lab.dbaas.scyop.net/account/50782/cluster \
-H "Authorization: Bearer MY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"clusterName":"My Cluster","scyllaVersionId":108,"cidrBlock":"172.31.0.0/16","broadcastType":"PRIVATE","allowedIPs":[],"cloudProviderId":1,"regionId":1,"instanceId":2,"replicationFactor":3,"numberOfNodes":3,"accountCredentialId":1,"freeTier":false,"userApiInterface":"CQL","enableDnsAssociation":true}'
{"data":{"requestId":78321,"fields":{"clusterName":"My Cluster","scyllaVersionId":108,"cidrBlock":"172.31.0.0/16","allowedIPs":[],"cloudProviderId":1,"regionId":1,"instanceId":2,"replicationFactor":3,"numberOfNodes":3,"promProxy":false,"accountCredentialId":1,"freeTier":false,"alternatorWriteIsolation":"","userApiInterface":"CQL","enableDnsAssociation":true,"broadcastType":"PRIVATE","scyllaVersion":{"versionId":108,"version":"2022.2.0","description":"Scylla Enterprise 2022.2.0","newCluster":"ENABLED"},"cloudProvider":{"id":1,"name":"AWS","rootAccountId":"734708892259"},"region":{"id":1,"externalId":"us-east-1","cloudProviderId":1,"name":"us-east-1","dcName":"AWS_US_EAST_1","fullName":"US East (N. Virginia)","continent":"America","backupStorageGBCost":"0.023","trafficSameRegionInGBCost":"0.01","trafficSameRegionOutGBCost":"0.01","trafficCrossRegionOutGBCost":"0.02","trafficInternetOutGBCost":"0.09"},"instance":{"id":2,"externalId":"i3.xlarge","cloudProviderId":1,"groupDefault":true,"displayOrder":3,"memory":31232,"localDiskCount":1,"totalStorage":972,"cpuCount":4,"networkSpeed":10240,"externalStorageNetworkSpeed":0,"costPerHour":"0.654","environment":"PRODUCTION","licenseCostOnDemandPerHour":"0.342","subscriptionCostHourly":"0.69608","instanceCostHourly":"0.312","freeTierHours":0}}}}