Skip to content

Instantly share code, notes, and snippets.

@maneta
Created August 28, 2019 16:17
Show Gist options
  • Save maneta/ef5210fed0af36468f29d67b4d9335ba to your computer and use it in GitHub Desktop.
Save maneta/ef5210fed0af36468f29d67b4d9335ba to your computer and use it in GitHub Desktop.
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