Closed alexraskin closed 6 months ago
It could be a one-off error or something related to your settings. Could you try again and let me know?
It could be a one-off error or something related to your settings. Could you try again and let me know?
Thanks for getting back to me..
So I tested again and I am getting the same result.
I also tried testing using locals.
locals {
auth_key = tailscale_tailnet_key.tailscale_auth_key.key
}
I am not sure what else this could be.
Thanks for your help!
@alexraskin Is this still an issue?
Hello, yes, I am still getting an error. Sorry I haven't updated lately, been busy.
@wertlex Did you encounter this issue in your recent contributions?
@pksunkara no, not really. I never seen this issue in the wild However, if I'll face something like that I'll at least report it here
Okay, I figured it out. It seems like a problem of exact HCL. project_id
was used as environment_id
:
resource "railway_variable" "tailscale_auth_key" {
name = "TAILSCALE_AUTHKEY"
value = "test"
# INCORRECT
# environment_id = railway_project.tailscale_vpn.id
# SOMETHING LIKE THIS SHOULD WORK
environment_id = railway_project.tailscale_vpn.default_environment.id
service_id = railway_service.tailscale_vpn.id
depends_on = [tailscale_tailnet_key.tailscale_auth_key]
}
Okay, I figured it out. It seems like a problem of exact HCL.
project_id
was used asenvironment_id
:resource "railway_variable" "tailscale_auth_key" { name = "TAILSCALE_AUTHKEY" value = "test" # INCORRECT # environment_id = railway_project.tailscale_vpn.id # SOMETHING LIKE THIS SHOULD WORK environment_id = railway_project.tailscale_vpn.default_environment.id service_id = railway_service.tailscale_vpn.id depends_on = [tailscale_tailnet_key.tailscale_auth_key] }
Okay, let me give this a go, thank you
Yup, that would give error. Sorry, I missed that.
Thanks @wertlex
@alexraskin I am closing this. Feel free to comment here if that doesn't fix your error.
I'm encountering a client error when attempting to deploy a variable using Terraform with the Railway provider. The goal is to set up a railway_variable resource for a Tailscale authentication key. I've tried two approaches: directly using the output from another resource and hardcoding a test value. Both methods result in the same client error during the apply phase.
Environment
Terraform Version:
1.6.6
Railway Provider Version:0.3.1
Error encountered in both a direct assignment from another resource and hardcoded value scenarios.Attempt 1: Using output from another resource
Attempt 2: Hardcoding the value
Error Message
Steps to Reproduce
Define a
railway_variable
resource in Terraform configuration. Run terraform apply to deploy the changes. Observe the "Client Error" output during the apply phase.Expected Behavior
The variable should be created successfully in the Railway environment without errors.
Actual Behavior
Receiving a "Client Error" indicating a problem processing the request, preventing the variable from being created.
Additional Context
I'm unsure if there have been recent changes to the Railway API that might be affecting this functionality. Looking for advice on whether there's a workaround or if a fix is needed on the provider's side. Would appreciate any insights or suggestions on how to resolve this issue. Thank you!
Funding