-
Notifications
You must be signed in to change notification settings - Fork 27
/
fss.tf
47 lines (42 loc) · 1.71 KB
/
fss.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
41
42
43
44
45
46
47
resource "oci_file_storage_file_system" "FSS" {
count = var.create_fss ? 1 : 0
availability_domain = var.fss_ad
compartment_id = var.fss_compartment
display_name = "${local.cluster_name}-fss"
}
resource "oci_file_storage_file_system" "FSS_home" {
count = var.create_fss && var.home_fss ? 1 : 0
availability_domain = var.fss_ad
compartment_id = var.fss_compartment
display_name = "${local.cluster_name}-fss-home"
}
resource "oci_file_storage_mount_target" "FSSMountTarget" {
count = var.create_fss ? var.mount_target_count : 0
availability_domain = var.fss_ad
compartment_id = var.fss_compartment
subnet_id = local.subnet_id
display_name = "${local.cluster_name}-mt-${count.index}"
hostname_label = "fileserver${count.index}"
}
resource "oci_file_storage_export" "FSSExport" {
count = var.create_fss ? var.mount_target_count : 0
export_set_id = oci_file_storage_mount_target.FSSMountTarget[count.index].export_set_id
file_system_id = oci_file_storage_file_system.FSS[0].id
path = var.nfs_source_path
export_options {
source = data.oci_core_vcn.vcn.cidr_block
access = "READ_WRITE"
identity_squash = "NONE"
}
}
resource "oci_file_storage_export" "FSSExport_home" {
count = var.create_fss && var.home_fss ? var.mount_target_count : 0
export_set_id = oci_file_storage_mount_target.FSSMountTarget[count.index].export_set_id
file_system_id = oci_file_storage_file_system.FSS_home[0].id
path = "/home"
export_options {
source = data.oci_core_vcn.vcn.cidr_block
access = "READ_WRITE"
identity_squash = "NONE"
}
}