Skip to content

Terragrunt support #4381

@kotx

Description

@kotx

One of my providers depends on a resource:

provider "docker" {
  host = "tcp://${fly_machine.machine[0].privateip}:2375"
}

But this doesn't pass validation when trying to create the template: Error: Error initializing Docker client: unable to parse docker host ''.

@kylecarbs Suggested using Terragrunt instead of Terraform, a drop-in replacement of the binary doesn't work:

Coder server logs when I run `coder templates create`:
2022-10-05T14:34:26Z app[0e826cce] lax [info]2022-10-05 14:34:26.902 [WARN]     (coderd)        <./coderd/httpmw/logger.go:54>  Logger.func1.1  GET     {"host": "coder.yukata.tech", "path": "/api/v2/organizations/a79036f8-5983-4386-b221-39248072a3c7/templates/docker-on-fly", "proto": "HTTP/1.1", "remote_addr": "172.19.3.225:61680", "took": "8.826606ms", "status_code": 404, "latency_ms": 8, "response_body": "{\"message\":\"Resource not found or you do not have access to this resource\"}\n", "request_id": "dc90ff9f-9216-4250-a950-1abcaea6a824"}
2022-10-05T14:34:27Z app[0e826cce] lax [info]2022-10-05 14:34:27.188 [INFO]     <./provisionerd/provisionerd.go:256>    (*Server).acquireJob    acquired job    {"initiator_username": "Kot", "provisioner": "terraform", "job_id": "90e898af-994c-42a0-b379-9de8393e4c3c"}
2022-10-05T14:34:27Z app[0e826cce] lax [info]2022-10-05 14:34:27.247 [INFO]     <./provisionerd/runner/runner.go:328>   (*Runner).do    unpacking template source archive       {"job_id": "90e898af-994c-42a0-b379-9de8393e4c3c", "size_bytes": 6656}
2022-10-05T14:34:27Z app[0e826cce] lax [info]2022-10-05 14:34:27.368 [INFO]     <./provisionerd/runner/runner.go:632>   (*Runner).runTemplateImportParse        parse complete  {"job_id": "90e898af-994c-42a0-b379-9de8393e4c3c", "parameter_schemas": [{"name": "fly_app", "description": "  Coder requires a Fly.io app name to provision workspaces.\n", "default_destination": {"scheme": 1}}, {"name": "fly_token", "description": "Coder requires a Fly.io token to provision workspaces.\n", "default_destination": {"scheme": 1}, "validation_type_system": 1, "validation_error": "Please provide a valid Fly.io Access token.", "validation_condition": "length(var.fly_token) == 43"}, {"name": "docker_image", "description": "Which Docker image would you like to use for your workspace?", "default_source": {"value": "codercom/enterprise-base:ubuntu"}, "allow_override_source": true, "default_destination": {"scheme": 1}, "redisplay_value": true}, {"name": "workspace_size", "description": "What should the size of your workspace be? (in GB)", "default_source": {"value": "1"}, "allow_override_source": true, "default_destination": {"scheme": 1}, "redisplay_value": true, "validation_type_system": 1, "validation_error": "Invalid volume size! Allowed: 1-10", "validation_condition": "var.workspace_size \u003e= 1 \u0026\u0026 var.workspace_size \u003c= 10"}, {"name": "fly_region", "description": "Which Fly.io region would you like to use for your workspace?", "default_source": {"value": "lax"}, "allow_override_source": true, "default_destination": {"scheme": 1}, "redisplay_value": true, "validation_type_system": 1, "validation_error": "Invalid Fly.io region!", "validation_condition": "contains([\"ams\", \"cdg\", \"dfw\", \"ewr\", \"fra\", \"gru\", \"hkg\", \"iad\", \"lax\", \"lhr\", \"maa\", \"mad\", \"mia\", \"nrt\", \"ord\", \"phx\", \"scl\", \"sea\", \"sin\", \"sjc\", \"syd\", \"yul\", \"yyz\"], var.fly_region)"}, {"name": "docker_sysbox", "description": "    Should the [Sysbox](https://github.com/nestybox/sysbox) runtime be used?\n    See [here](https://coder.com/docs/coder-oss/latest/templates/docker-in-docker) for details.\n", "default_source": {"value": "true"}, "allow_override_source": true, "default_destination": {"scheme": 1}, "redisplay_value": true}]}
2022-10-05T14:34:27Z app[0e826cce] lax [info]2022-10-05 14:34:27.567 [INFO]     <./provisionerd/runner/runner.go:148>   (*Runner).Run   sent FailedJob  {"job_id": "90e898af-994c-42a0-b379-9de8393e4c3c"}

It's possible this can be resolved without Terragrunt, but this seems like a Terraform limitation, so this issue initially requests Terragrunt support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleThis issue is like stale bread.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions