- Notifications
You must be signed in to change notification settings - Fork928
add metadata to example templates#3451
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from7 commits
8c4dbcf
876c5d9
c7cbeca
2ca9b75
8d70cee
27057cd
cd07ba1
637e064
2c67a57
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -2,7 +2,7 @@ terraform { | ||
required_providers { | ||
coder = { | ||
source = "coder/coder" | ||
version = "0.4.5" | ||
} | ||
} | ||
} | ||
@@ -146,7 +146,7 @@ EOT | ||
resource "aws_instance" "dev" { | ||
ami = data.aws_ami.ubuntu.id | ||
availability_zone = "${var.region}a" | ||
instance_type = var.instance_type | ||
user_data = data.coder_workspace.me.transition == "start" ? local.user_data_start : local.user_data_end | ||
tags = { | ||
@@ -155,3 +155,19 @@ resource "aws_instance" "dev" { | ||
Coder_Provisioned = "true" | ||
} | ||
} | ||
resource "coder_metadata" "workspace_info" { | ||
resource_id = aws_instance.dev.id | ||
item { | ||
key = "region" | ||
value = var.region | ||
} | ||
item { | ||
key = "instance type" | ||
value = aws_instance.dev.instance_type | ||
} | ||
item { | ||
key = "disk" | ||
value = "${aws_instance.dev.root_block_device[0].volume_size} GB" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Nitpick: I think all of these "volume size" parameters are actually measured in GiB, not decimal GB. How about labeling them that way? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. for sure! | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -2,7 +2,7 @@ terraform { | ||
required_providers { | ||
coder = { | ||
source = "coder/coder" | ||
version = "0.4.5" | ||
} | ||
docker = { | ||
source = "kreuzwerker/docker" | ||
@@ -45,9 +45,9 @@ resource "coder_agent" "main" { | ||
# You can remove this block if you'd prefer to configure Git manually or using | ||
# dotfiles. (see docs/dotfiles.md) | ||
env = { | ||
GIT_AUTHOR_NAME= "${data.coder_workspace.me.owner}" | ||
GIT_COMMITTER_NAME= "${data.coder_workspace.me.owner}" | ||
GIT_AUTHOR_EMAIL= "${data.coder_workspace.me.owner_email}" | ||
GIT_COMMITTER_EMAIL = "${data.coder_workspace.me.owner_email}" | ||
} | ||
} | ||
@@ -81,4 +81,3 @@ resource "docker_container" "workspace" { | ||
volume_name = docker_volume.home_volume.name | ||
read_only = false | ||
} | ||
bpmct marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. |