File tree 1 file changed +7
-15
lines changed
examples/templates/aws-linux
1 file changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -36,19 +36,6 @@ variable "region" {
36
36
}
37
37
}
38
38
39
- variable "disk_size" {
40
- description = " Specify your disk size (GiBs)"
41
- default = " 20"
42
- type = number
43
- validation {
44
- condition = (
45
- var. disk_size >= 8 &&
46
- var. disk_size <= 256
47
- )
48
- error_message = " Disk size must be between 8 and 256."
49
- }
50
- }
51
-
52
39
provider "aws" {
53
40
region = var. region
54
41
}
@@ -93,6 +80,11 @@ Content-Disposition: attachment; filename="cloud-config.txt"
93
80
#cloud-config
94
81
cloud_final_modules:
95
82
- [scripts-user, always]
83
+ hostname: ${ lower (data. coder_workspace . me . name )}
84
+ users:
85
+ - name: ${ lower (data. coder_workspace . me . owner )}
86
+ sudo: ALL=(ALL) NOPASSWD:ALL
87
+ shell: /bin/bash
96
88
97
89
--//
98
90
Content-Type: text/x-shellscript; charset="us-ascii"
@@ -101,7 +93,7 @@ Content-Transfer-Encoding: 7bit
101
93
Content-Disposition: attachment; filename="userdata.txt"
102
94
103
95
#!/bin/bash
104
- sudo -u ubuntu sh -c '${ coder_agent . dev . init_script } '
96
+ sudo -u ${ lower (data . coder_workspace . me . owner ) } sh -c '${ coder_agent . dev . init_script } '
105
97
--//--
106
98
EOT
107
99
134
126
resource "aws_instance" "dev" {
135
127
ami = data. aws_ami . ubuntu . id
136
128
availability_zone = " ${ var . region } a"
137
- instance_type = " t3.micro "
129
+ instance_type = " t3.medium "
138
130
139
131
user_data = data. coder_workspace . me . transition == " start" ? local. user_data_start : local. user_data_end
140
132
tags = {
You can’t perform that action at this time.
0 commit comments