Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Multiple terraform resources are detected as multiple workspaces, resulting in inability to SSH and unrecognized name #1750

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mafredri opened this issue May 25, 2022 · 5 comments
Assignees
Labels
api Area: HTTP API
Milestone

Comments

@mafredri
Copy link
Member

mafredri commented May 25, 2022

Steps to Reproduce

  1. Uncomment the "project resource" in examples/do-droplet-linux (feat: Add examples/templates/do-linux for Digital Ocean Droplets #1749)
  2. Run coder template create -d examples/do-droplet-linux
  3. Run coder create -t do-droplet-linux my-dev
  4. Observe problems (see screenshot)

Ucommented the resource should look like:

resource "digitalocean_project_resources" "project" {
  project = var.step2_do_project_id
  # Workaround for terraform plan when using count.
  resources = length(digitalocean_droplet.workspace) > 0 ? [
    digitalocean_volume.home_volume.urn,
    digitalocean_droplet.workspace[0].urn
    ] : [
    digitalocean_volume.home_volume.urn
  ]
}

Expected

Only one resource should be listed as the workspace.

Actual

Multiple resources are listed and detected as workspaces, leading to unexpected behavior.

Screenshot

Screen Shot 2022-05-25 at 18 11 00

@ketang
Copy link
Contributor

ketang commented May 25, 2022

Can this happen in other infrastructure?

@mafredri
Copy link
Member Author

mafredri commented May 27, 2022

@ketang I think it can, depending on the implementation details of different Terraform providers. In this instance, the problem could've been avoided if the digitalocean provider allowed specifying the project on a per-resource basis (which would seem logical to me). Instead the behavior is such that resources are first created the default project, then moved to specified one.

All this is to say, I'm fairly certain we will want/need a way to specify which resource is the actual workspace (or is running the agent). This way we can avoid the confusing UI from above (listing two ssh targets).

@mafredri
Copy link
Member Author

@kylecarbs do you think the issue in #1884 is related to this one?

@kylecarbs kylecarbs changed the title Bug: Multiple terraform resources are detected as multiple workspaces, resulting in inability to SSH and unrecognized name Multiple terraform resources are detected as multiple workspaces, resulting in inability to SSH and unrecognized name Jun 7, 2022
@mafredri
Copy link
Member Author

mafredri commented Jun 9, 2022

I believe this issue was fixed by #2187? // @kylecarbs

mafredri added a commit that referenced this issue Jun 9, 2022
The issue tracked in #1750 was fixed by #2187, we can now re-enable the
project resource.
mafredri added a commit that referenced this issue Jun 9, 2022
The issue tracked in #1750 was fixed by #2187, we can now re-enable the
project resource.
@kylecarbs
Copy link
Member

Correct!

@mafredri mafredri closed this as completed Jun 9, 2022
kylecarbs pushed a commit that referenced this issue Jun 10, 2022
The issue tracked in #1750 was fixed by #2187, we can now re-enable the
project resource.
@misskniss misskniss added this to the Community MVP milestone Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Area: HTTP API
Projects
None yet
Development

No branches or pull requests

4 participants