Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit08483d8

Browse files
committed
feat: Set default values to skip in admin, docs, Fedora fix
1 parentb599799 commit08483d8

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

‎examples/do-linux/main.tf

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ terraform {
1313

1414
variable"step1_do_token" {
1515
type=string
16-
description="Enter token (refer to docsat...)"
16+
description="Enter token (see documentationathttps://docs.digitalocean.com/reference/api/create-personal-access-token/)"
1717
sensitive=true
1818

1919
validation {
@@ -24,7 +24,11 @@ variable "step1_do_token" {
2424

2525
variable"step2_do_project_id" {
2626
type=string
27-
description="Enter project ID (see e.g. doctl projects list)"
27+
description=<<-EOF
28+
Enter project ID
29+
30+
$ doctl projects list
31+
EOF
2832
sensitive=true
2933

3034
validation {
@@ -33,7 +37,20 @@ variable "step2_do_project_id" {
3337
}
3438
}
3539

40+
variable"step3_do_admin_ssh_key" {
41+
type=number
42+
description=<<-EOF
43+
Enter admin SSH key ID (some Droplet images require an SSH key to be set):
44+
45+
Note: Leaving this as zero will break Fedora images and notify root passwords via email.
46+
47+
$ doctl compute ssh-key list
48+
EOF
49+
sensitive=true
50+
}
51+
3652
variable"droplet_image" {
53+
type=string
3754
description="Which Droplet image would you like to use for your workspace?"
3855
default="ubuntu-22-04-x64"
3956
validation {
@@ -43,7 +60,9 @@ variable "droplet_image" {
4360
}
4461

4562
variable"droplet_size" {
63+
type=string
4664
description="Which Droplet configuration would you like to use?"
65+
default="s-1vcpu-1gb"
4766
validation {
4867
condition=contains(["s-1vcpu-1gb","s-1vcpu-2gb","s-2vcpu-2gb","s-2vcpu-4gb","s-4vcpu-8gb","s-8vcpu-16gb"], var.droplet_size)
4968
error_message="Value must be s-1vcpu-1gb, s-1vcpu-2gb, s-2vcpu-2gb, s-2vcpu-4gb, s-4vcpu-8gb or s-8vcpu-16gb."
@@ -61,7 +80,9 @@ variable "home_volume_size" {
6180
}
6281

6382
variable"region" {
83+
type=string
6484
description="Which region would you like to use?"
85+
default="ams3"
6586
validation {
6687
condition=contains(["nyc1","nyc2","nyc3","sfo1","sfo2","sfo3","ams2","ams3","sgp1","lon1","fra1","tor1","blr1"], var.region)
6788
error_message="Value must be nyc1, nyc2, nyc3, sfo1, sfo2, sfo3, ams2, ams3, sgp1, lon1, fra1, tor1 or blr1."
@@ -101,6 +122,8 @@ resource "digitalocean_droplet" "workspace" {
101122
init_script=base64encode(coder_agent.dev.init_script)
102123
coder_agent_token= coder_agent.dev.token
103124
})
125+
# Required to provision Fedora.
126+
ssh_keys=concat([], var.step3_do_admin_ssh_key>0? [var.step3_do_admin_ssh_key]: [])
104127
}
105128

106129
# resource "digitalocean_project_resources" "project" {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp