Created
August 28, 2019 16:17
-
-
Save maneta/95ce8a13c38bd9da8ee406800e8b8ba5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_efs_file_system" "openshift-volumes" { | |
creation_token = "os-{{ CLUSTER_NAME }}-volumes" | |
tags { | |
Name = "os-{{ CLUSTER_NAME }}-volumes" | |
stack = "openshift" | |
cluster_name = "{{ CLUSTER_NAME }}" | |
layer = "os-storage" | |
} | |
} | |
{% for MOUNT_ID in range(0, 3) -%} | |
resource "aws_efs_mount_target" "openshift-volumes-0{{ MOUNT_ID + 1 }}" { | |
file_system_id = "${aws_efs_file_system.openshift-volumes.id}" | |
subnet_id = "{{ (SEPARATED_SUBNETS_REF | from_json)[MOUNT_ID] }}" | |
security_groups = ["${aws_security_group.os-efs.id}"] | |
} | |
{% endfor %} | |
resource "aws_security_group" "os-efs" { | |
name = "os-{{ CLUSTER_NAME }}-efs" | |
description = "openshift Elastic FS SG - cluster: {{ CLUSTER_NAME }}" | |
vpc_id = "{{ VPC_REF }}" | |
} | |
output "efs_id" { | |
value = "${aws_efs_file_system.openshift-volumes.id}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment