質問編集履歴

2

説明の追加

2022/10/01 06:28

投稿

ttoo
ttoo

score126

test CHANGED
File without changes
test CHANGED
@@ -3,6 +3,7 @@
3
3
  こちらは一つにまとめたいのですが、プログラミングの関数みたいな形で、
4
4
  ひとまとめにすることは可能でしょうか?
5
5
  また、可能でしたらその設定方法をご教示ください。
6
+ 「module」は利用せずに、1ファイル内で完結するものとします。
6
7
 
7
8
  ```
8
9
  ##########################################################

1

gじょいj

2022/10/01 06:19

投稿

ttoo
ttoo

score126

test CHANGED
File without changes
test CHANGED
@@ -47,7 +47,7 @@
47
47
  }
48
48
 
49
49
  # データウェアハウス用S3
50
- resource "aws_s3_bucket" "data_lake_s3" {
50
+ resource "aws_s3_bucket" "data_warehouse_s3" {
51
51
 
52
52
  bucket = "${var.project}-data-warehouse-${var.env}"
53
53
 
@@ -63,12 +63,12 @@
63
63
  }
64
64
  }
65
65
  tags = {
66
- Name = "${var.project}-data-lake-${var.env}"
66
+ Name = "${var.project}-data-warehouse-${var.env}"
67
67
  }
68
68
  }
69
69
 
70
- resource "aws_s3_bucket_public_access_block" "data_lake_s3_block" {
70
+ resource "aws_s3_bucket_public_access_block" "data_warehouse_s3_block1" {
71
- bucket = aws_s3_bucket.data_lake_s3.id
71
+ bucket = aws_s3_bucket.data_warehouse_s3.id
72
72
 
73
73
  block_public_acls = true
74
74
  block_public_policy = true
@@ -77,7 +77,7 @@
77
77
  }
78
78
 
79
79
  # データマート用S3
80
- resource "aws_s3_bucket" "data_lake_s3" {
80
+ resource "aws_s3_bucket" "data_mart_s3" {
81
81
 
82
82
  bucket = "${var.project}-data-mart-${var.env}"
83
83
 
@@ -93,12 +93,12 @@
93
93
  }
94
94
  }
95
95
  tags = {
96
- Name = "${var.project}-data-lake-${var.env}"
96
+ Name = "${var.project}-data-mart-${var.env}"
97
97
  }
98
98
  }
99
99
 
100
- resource "aws_s3_bucket_public_access_block" "data_lake_s3_block" {
100
+ resource "aws_s3_bucket_public_access_block" "data_mart_s3_block2" {
101
- bucket = aws_s3_bucket.data_lake_s3.id
101
+ bucket = aws_s3_bucket.data_mart_s3.id
102
102
 
103
103
  block_public_acls = true
104
104
  block_public_policy = true
@@ -107,7 +107,7 @@
107
107
  }
108
108
 
109
109
  # Athena用
110
- resource "aws_s3_bucket" "data_lake_s3" {
110
+ resource "aws_s3_bucket" "athena_log_s3" {
111
111
 
112
112
  bucket = "${var.project}-athena-log-${var.env}"
113
113
 
@@ -125,12 +125,12 @@
125
125
  }
126
126
  }
127
127
  tags = {
128
- Name = "${var.project}-data-lake-${var.env}"
128
+ Name = "${var.project}-athena-log-${var.env}"
129
129
  }
130
130
  }
131
131
 
132
- resource "aws_s3_bucket_public_access_block" "data_lake_s3_block" {
132
+ resource "aws_s3_bucket_public_access_block" "athena_log_s3_block3" {
133
- bucket = aws_s3_bucket.data_lake_s3.id
133
+ bucket = aws_s3_bucket.athena_log_s3.id
134
134
 
135
135
  block_public_acls = true
136
136
  block_public_policy = true