mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
feat: Add templates to create working release (#422)
* Add templates
* Move API structs to codersdk
* Back to green tests!
* It all works, but now with tea! 🧋
* It works!
* Add cancellation to provisionerd
* Tests pass!
* Add deletion of workspaces and projects
* Fix agent lock
* Add clog
* Fix linting errors
* Remove unused CLI tests
* Rename daemon to start
* Fix leaking command
* Fix promptui test
* Update agent connection frequency
* Skip login tests on Windows
* Increase tunnel connect timeout
* Fix templater
* Lower test requirements
* Fix embed
* Disable promptui tests for Windows
* Fix write newline
* Fix PTY write newline
* Fix CloseReader
* Fix compilation on Windows
* Fix linting error
* Remove bubbletea
* Cleanup readwriter
* Use embedded templates instead of serving over API
* Move templates to examples
* Improve workspace create flow
* Fix Windows build
* Fix tests
* Fix linting errors
* Fix untar with extracting max size
* Fix newline char
This commit is contained in:
5
examples/gcp-windows/README.md
Normal file
5
examples/gcp-windows/README.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
name: Develop in Windows on Google Cloud
|
||||
description: Get started with Windows development on Google Cloud.
|
||||
tags: [cloud, google]
|
||||
---
|
76
examples/gcp-windows/main.tf
Normal file
76
examples/gcp-windows/main.tf
Normal file
@ -0,0 +1,76 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
coder = {
|
||||
source = "coder/coder"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
variable "gcp_credentials" {
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "gcp_project" {
|
||||
description = "The Google Cloud project to manage resources in."
|
||||
}
|
||||
|
||||
variable "gcp_region" {
|
||||
default = "us-central1"
|
||||
}
|
||||
|
||||
provider "google" {
|
||||
project = var.gcp_project
|
||||
region = var.gcp_region
|
||||
credentials = var.gcp_credentials
|
||||
}
|
||||
|
||||
data "coder_workspace" "me" {
|
||||
}
|
||||
|
||||
data "coder_agent_script" "dev" {
|
||||
arch = "amd64"
|
||||
os = "windows"
|
||||
}
|
||||
|
||||
data "google_compute_default_service_account" "default" {
|
||||
}
|
||||
|
||||
resource "random_string" "random" {
|
||||
count = data.coder_workspace.me.transition == "start" ? 1 : 0
|
||||
length = 8
|
||||
special = false
|
||||
}
|
||||
|
||||
resource "google_compute_instance" "dev" {
|
||||
zone = "us-central1-a"
|
||||
count = data.coder_workspace.me.transition == "start" ? 1 : 0
|
||||
name = "coder-${lower(random_string.random[0].result)}"
|
||||
machine_type = "e2-medium"
|
||||
network_interface {
|
||||
network = "default"
|
||||
access_config {
|
||||
// Ephemeral public IP
|
||||
}
|
||||
}
|
||||
boot_disk {
|
||||
initialize_params {
|
||||
image = "projects/windows-cloud/global/images/windows-server-2022-dc-core-v20220215"
|
||||
}
|
||||
}
|
||||
service_account {
|
||||
email = data.google_compute_default_service_account.default.email
|
||||
scopes = ["cloud-platform"]
|
||||
}
|
||||
metadata = {
|
||||
windows-startup-script-ps1 = data.coder_agent_script.dev.value
|
||||
serial-port-enable = "TRUE"
|
||||
}
|
||||
}
|
||||
|
||||
resource "coder_agent" "dev" {
|
||||
count = length(google_compute_instance.dev)
|
||||
auth {
|
||||
type = "google-instance-identity"
|
||||
instance_id = google_compute_instance.dev[0].instance_id
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user