79222c36bf
This changeset adds volumes but does not mount them to instances so that we can test the mounting ("staging") via CSI plugins. The CSI plugins themselves will be installed as Nomad jobs. In order to ensure we can always mount the EFS volume, this changeset pins the deployment of the cluster to a specific subnet. In future work we should spread the cluster out among several AZs and test that behavior explicitly.
25 lines
561 B
HCL
25 lines
561 B
HCL
resource "aws_efs_file_system" "csi" {
|
|
creation_token = "CSI"
|
|
|
|
tags = {
|
|
Name = "${local.random_name}-efs"
|
|
User = data.aws_caller_identity.current.arn
|
|
}
|
|
}
|
|
|
|
resource "aws_efs_mount_target" "csi" {
|
|
file_system_id = aws_efs_file_system.csi.id
|
|
subnet_id = data.aws_subnet.default.id
|
|
security_groups = [aws_security_group.nfs.id]
|
|
}
|
|
|
|
resource "aws_ebs_volume" "csi" {
|
|
availability_zone = var.availability_zone
|
|
size = 40
|
|
|
|
tags = {
|
|
Name = "${local.random_name}-ebs"
|
|
User = data.aws_caller_identity.current.arn
|
|
}
|
|
}
|