CDK for Terraform | Terraform | HashiCor...
CDK for Terraform | Terraform | HashiCorp Developer
CDK for Terraform | Terraform | HashiCorp Developer
Cloud Development Kit for Terraform (CDKTF) lets you use familiar programming languages to define and provision infrastructure.
13 Replies
Oh then count is likely the meta-argument https://developer.hashicorp.com/terraform/language/meta-arguments/count
The only parts there that are cloudflare specific are account_id, namespace_id, key and value. https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/workers_kv
And yes you need a new WorkersKV object for each value. The namespaces vs value is a seperate api
The count Meta-Argument - Configuration Language | Terraform | HashiCorp Developer
The count Meta-Argument - Configuration Language | Terraform | Hash...
Count helps you efficiently manage nearly identical infrastructure resources without writing a separate block for each one.
I already created a working KV namespace, the only weird thing is the way it works.
![No description](https://utfs.io/f/a7af15d0-9621-4d07-bf3e-818aaeea6350-1nq2cb.png)
basically every time I want to add a pair, I need to call WorkersKv
Yeah because each key is a separate object
on the other hand, in most clouds you have a kv-store like DynamoDB where you have the
table.put()
methodYou have that in the worker which is where KV is designed to be used
also I think you cannot update a record in a namespace becuse I saw no edit button in the GUI
you can only delete
I meant from the workers run time
https://developers.cloudflare.com/workers/runtime-apis/kv/
so there is a put method there, but there isn't in Terraform 🤔
I mean the put in terraform is just the same as the post request. Just the workers runtime handles it differently
the weird thing for me is that instead of doing something like
test-table.put()
in my code above, I call the constructor of WorkersKv
to add a pair.Yeah that's how the rest API is built.