Skip to content

Replace var.name with a pretty name #4073

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
matifali opened this issue Sep 15, 2022 · 9 comments
Closed

Replace var.name with a pretty name #4073

matifali opened this issue Sep 15, 2022 · 9 comments
Assignees

Comments

@matifali
Copy link
Member

image

@BrunoQuaresma
Copy link
Collaborator

@matifali what a pretty name should be?

@matifali
Copy link
Member Author

For example
var.ram can be Total RAM
var.cpu can be CPU Cores
var.docker_image Docker Image

@BrunoQuaresma
Copy link
Collaborator

Since these var names are dynamic and came from terraform I don't see how we could use better names 🤔 Any ideas?

@matifali
Copy link
Member Author

matifali commented Sep 15, 2022

Yes I understand why it can't be done. Terraform HCL does not provide any field to be used for pretty ne. We can't use description as it's longer.
May be a data in coder provider can be used to create a title for every variable.

@BrunoQuaresma
Copy link
Collaborator

cc.: @bpmct

@bpmct
Copy link
Member

bpmct commented Sep 16, 2022

We have a plan to replace variable with a coder_parameter data source. The scheme is TBD but it would allow us to have friendly names, validate on the frontend, and mark specific variables as immutable. related: #802

For example,

data "coder_parameter" "cpu" {
  friendly_name = "CPU Cores"
  description = "Lorem ipsum"
  immutable = false
}

resource "some_resource" "dev" {
   cpu = data.cpu.value
}

Legacy variables would be supported, but wouldn't show up as pretty in the dashboard

There are other ways we could do it without that (e.g. mapping common terms in the backend, replacing underscores with spaces), but I think we should wait until we have more controls with coder_parameter :).

@bpmct
Copy link
Member

bpmct commented Sep 16, 2022

We should keep this issue open until there is a way to do that, though :)

@github-actions
Copy link

This issue is becoming stale. In order to keep the tracker readable and actionable, I'm going close to this issue in 7 days if there isn't more activity.

@github-actions github-actions bot added the stale This issue is like stale bread. label Nov 24, 2022
@BrunoQuaresma
Copy link
Collaborator

This is done in the latest version

@matifali matifali added feature and removed stale This issue is like stale bread. labels Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants