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
Cyb3r-Jak3
Cyb3r-Jak3•2y ago
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.
LordSilver
LordSilver•2y ago
I already created a working KV namespace, the only weird thing is the way it works.
LordSilver
LordSilver•2y ago
No description
LordSilver
LordSilver•2y ago
basically every time I want to add a pair, I need to call WorkersKv
Cyb3r-Jak3
Cyb3r-Jak3•2y ago
Yeah because each key is a separate object
LordSilver
LordSilver•2y ago
on the other hand, in most clouds you have a kv-store like DynamoDB where you have the table.put() method
Cyb3r-Jak3
Cyb3r-Jak3•2y ago
You have that in the worker which is where KV is designed to be used
LordSilver
LordSilver•2y ago
also I think you cannot update a record in a namespace becuse I saw no edit button in the GUI you can only delete
Cyb3r-Jak3
Cyb3r-Jak3•2y ago
LordSilver
LordSilver•2y ago
so there is a put method there, but there isn't in Terraform 🤔
Cyb3r-Jak3
Cyb3r-Jak3•2y ago
I mean the put in terraform is just the same as the post request. Just the workers runtime handles it differently
LordSilver
LordSilver•2y ago
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.
Cyb3r-Jak3
Cyb3r-Jak3•2y ago
Yeah that's how the rest API is built.
Want results from more Discord servers?
Add your server