upstash / terraform-provider-upstash

MIT License
22 stars 4 forks source link

Expose Redis database port #6

Closed fdionisi closed 2 years ago

fdionisi commented 2 years ago

I noticed that each Redis database listens on a different port, and at the moment, that's not exposed by the Terraform resource. This behaviour makes it nearly impossible to deploy and have a resource connecting to the newly created database in one go (unless you guess and hardcode the port, and you are extremely lucky 😅).

Looking at Upstash API ^1, the port is provided in the response payload when creating a new database, so this feature request should be trivial to implement.

Here's the error message I receive when trying to access the port attribute:

╷
│ Error: Unsupported attribute
│ 
│   on main.tf line 396, in resource "aws_lambda_function" "api_lambda":
│  396:       HIVE_REDIS_URL = "rediss://:${upstash_redis_database.cache.password}@${upstash_redis_database.cache.endpoint}:${upstash_redis_database.cache.port}"
│ 
│ This object has no argument, nested block, or exported attribute named "port".
╵
buggyhunter commented 2 years ago

@fdionisi yes you are right.. rest endpoint should work but we will add port for tcp endpoints. expecting another fix/release today.

fdionisi commented 2 years ago

Amazing @buggyhunter! Thank you for taking the time.

FYI, the journey with Upstash has been great so far and your prompt reactions are levelling up the experience even more. 😁

buggyhunter commented 2 years ago

https://registry.terraform.io/providers/upstash/upstash/1.0.2 has been released with a fix closing the issue for now