質問編集履歴
2
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -80,8 +80,9 @@
|
|
80
80
|
public_c_id = module.vpc.public_c_id
|
81
81
|
sg_id = module.sg.sg_id
|
82
82
|
}
|
83
|
-
|
83
|
+
```
|
84
|
+
|
84
|
-
variables.tf
|
85
|
+
```variables.tf
|
85
86
|
|
86
87
|
variable "region" {
|
87
88
|
default = "ap-northeast-1"
|
@@ -106,8 +107,9 @@
|
|
106
107
|
variable "tag_group" {
|
107
108
|
default = "learn-terraform-aws"
|
108
109
|
}
|
109
|
-
|
110
|
+
```
|
111
|
+
|
110
|
-
vpc/vpc.tf
|
112
|
+
```vpc/vpc.tf
|
111
113
|
|
112
114
|
resource "aws_vpc" "default" {
|
113
115
|
cidr_block = "10.0.0.0/16"
|
@@ -169,18 +171,19 @@
|
|
169
171
|
subnet_id = aws_subnet.public_1c.id
|
170
172
|
route_table_id = aws_route_table.default.id
|
171
173
|
}
|
172
|
-
|
174
|
+
```
|
175
|
+
|
173
|
-
vpc/variables.tf
|
176
|
+
```vpc/variables.tf
|
174
177
|
variable "region" {default = "ap-northeast-1"}
|
175
178
|
variable "az_a" {default = "ap-northeast-1a"}
|
176
179
|
variable "az_c" {default = "ap-northeast-1c"}
|
177
180
|
variable "name_prefix" {default = "ltar"}
|
178
181
|
variable "tag_name" {default = "learn-terraform-aws-rds"}
|
179
182
|
variable "tag_group" {default = "learn-terraform-aws"}
|
180
|
-
|
183
|
+
```
|
181
|
-
|
182
|
-
|
184
|
+
|
185
|
+
|
183
|
-
sg/sg.tf
|
186
|
+
```sg/sg.tf
|
184
187
|
|
185
188
|
resource "aws_security_group" "default" {
|
186
189
|
vpc_id = "${var.vpc_id}"
|
@@ -206,8 +209,8 @@
|
|
206
209
|
cidr_blocks = ["0.0.0.0/0"]
|
207
210
|
security_group_id = aws_security_group.default.id
|
208
211
|
}
|
209
|
-
|
212
|
+
```
|
210
|
-
sg/variables.tf
|
213
|
+
```sg/variables.tf
|
211
214
|
|
212
215
|
variable "region" {default = "ap-northeast-1"}
|
213
216
|
variable "az_a" {default = "ap-northeast-1a"}
|
@@ -218,10 +221,9 @@
|
|
218
221
|
|
219
222
|
variable "vpc_id" {default = "aws_vpc.default.id"}
|
220
223
|
|
221
|
-
```ここに言語を入力
|
222
|
-
|
223
|
-
```
|
224
|
+
```
|
225
|
+
|
224
|
-
rds/rds.tf
|
226
|
+
```rds/rds.tf
|
225
227
|
locals {
|
226
228
|
aurora_database_name = "learn"
|
227
229
|
aurora_master_username = "learn_user"
|
@@ -343,8 +345,9 @@
|
|
343
345
|
name = "${var.name_prefix}-db-parameter-group"
|
344
346
|
family = "aurora-mysql8.0"
|
345
347
|
}
|
346
|
-
|
348
|
+
```
|
349
|
+
|
347
|
-
rds/variables.tf
|
350
|
+
```rds/variables.tf
|
348
351
|
|
349
352
|
variable "region" {default = "ap-northeast-1"}
|
350
353
|
variable "az_a" {default = "ap-northeast-1a"}
|
1
段落修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -21,8 +21,7 @@
|
|
21
21
|
|
22
22
|
```terraform
|
23
23
|
|
24
|
-
|
25
|
-
main.tf
|
24
|
+
```main.tf
|
26
25
|
terraform {
|
27
26
|
|
28
27
|
required_providers {
|
@@ -81,12 +80,9 @@
|
|
81
80
|
public_c_id = module.vpc.public_c_id
|
82
81
|
sg_id = module.sg.sg_id
|
83
82
|
}
|
84
|
-
|
83
|
+
|
85
|
-
|
86
|
-
output "rds_endpoint" {
|
87
|
-
value = module.rds.endpoint
|
88
|
-
}
|
89
84
|
variables.tf
|
85
|
+
|
90
86
|
variable "region" {
|
91
87
|
default = "ap-northeast-1"
|
92
88
|
}
|
@@ -110,8 +106,9 @@
|
|
110
106
|
variable "tag_group" {
|
111
107
|
default = "learn-terraform-aws"
|
112
108
|
}
|
109
|
+
|
113
110
|
vpc/vpc.tf
|
114
|
-
|
111
|
+
|
115
112
|
resource "aws_vpc" "default" {
|
116
113
|
cidr_block = "10.0.0.0/16"
|
117
114
|
enable_dns_support = true
|
@@ -172,6 +169,7 @@
|
|
172
169
|
subnet_id = aws_subnet.public_1c.id
|
173
170
|
route_table_id = aws_route_table.default.id
|
174
171
|
}
|
172
|
+
|
175
173
|
vpc/variables.tf
|
176
174
|
variable "region" {default = "ap-northeast-1"}
|
177
175
|
variable "az_a" {default = "ap-northeast-1a"}
|
@@ -179,18 +177,8 @@
|
|
179
177
|
variable "name_prefix" {default = "ltar"}
|
180
178
|
variable "tag_name" {default = "learn-terraform-aws-rds"}
|
181
179
|
variable "tag_group" {default = "learn-terraform-aws"}
|
182
|
-
|
180
|
+
|
183
|
-
|
181
|
+
|
184
|
-
value = "${aws_vpc.default.id}"
|
185
|
-
}
|
186
|
-
|
187
|
-
output "public_a_id" {
|
188
|
-
value = "${aws_subnet.public_1a.id}"
|
189
|
-
}
|
190
|
-
|
191
|
-
output "public_c_id" {
|
192
|
-
value = "${aws_subnet.public_1c.id}"
|
193
|
-
}
|
194
182
|
|
195
183
|
sg/sg.tf
|
196
184
|
|
@@ -229,9 +217,10 @@
|
|
229
217
|
variable "tag_group" {default = "learn-terraform-aws"}
|
230
218
|
|
231
219
|
variable "vpc_id" {default = "aws_vpc.default.id"}
|
220
|
+
|
232
|
-
|
221
|
+
```ここに言語を入力
|
222
|
+
|
233
|
-
|
223
|
+
```
|
234
|
-
|
235
224
|
rds/rds.tf
|
236
225
|
locals {
|
237
226
|
aurora_database_name = "learn"
|
@@ -356,6 +345,7 @@
|
|
356
345
|
}
|
357
346
|
|
358
347
|
rds/variables.tf
|
348
|
+
|
359
349
|
variable "region" {default = "ap-northeast-1"}
|
360
350
|
variable "az_a" {default = "ap-northeast-1a"}
|
361
351
|
variable "az_c" {default = "ap-northeast-1c"}
|
@@ -367,11 +357,6 @@
|
|
367
357
|
variable "public_a_id" {default = "aws_subnet.public_1a.id"}
|
368
358
|
variable "public_c_id" {default = "aws_subnet.public_1c.id"}
|
369
359
|
variable "sg_id" {default = "aws_security_group.default.id"}
|
370
|
-
|
371
|
-
rds/output.tf
|
372
|
-
output "endpoint" {
|
373
|
-
value = aws_rds_cluster.learn.endpoint
|
374
|
-
}
|
375
360
|
```
|
376
361
|
|
377
362
|
### 試したこと・調べたこと
|