-
Notifications
You must be signed in to change notification settings - Fork 0
/
storage.tf
40 lines (40 loc) · 1.17 KB
/
storage.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
###########################
# creates EFS and security group for EFS
# Ingress Security Port 2049 (Inbound)
resource "aws_security_group" "sg_jenkins_efs" {
name_prefix = "sg_jenkins_efs_"
vpc_id = aws_vpc.devVPC.id
ingress {
from_port = 2049
to_port = 2049
protocol = "tcp"
cidr_blocks = [var.cidr_blocks]
}
tags = {
project = var.tag_project
}
}
# Provides an Elastic File System (EFS) File System resource to store JENKINS_HOME
resource "aws_efs_file_system" "jenkins_home_efs" {
creation_token = "jenkins_home_efs"
tags = {
Name = "${var.tag_project}_jenkins_home"
project = var.tag_project
}
}
# Provides an Elastic File System (EFS) mount target
resource "aws_efs_mount_target" "jenkins_mount_target" {
file_system_id = aws_efs_file_system.jenkins_home_efs.id
subnet_id = aws_subnet.public_subnet.id
security_groups = [aws_security_group.sg_jenkins_efs.id]
}
# Provides an Elastic File System (EFS) access point
resource "aws_efs_access_point" "jenkins_access_point" {
file_system_id = aws_efs_file_system.jenkins_home_efs.id
root_directory {
path = "/"
}
tags = {
project = var.tag_project
}
}