open-nomad/e2e/terraform/volumes.tf
Mahmood Ali 857ddf7aaf e2e: use unique CSI token
Use a unique per-cluster efs creation token, as https://www.terraform.io/docs/providers/aws/r/efs_file_system.html#creation_token.

Using a static value prevents having multiple test clusters.

[ci skip]
2020-03-15 21:55:26 -04:00

25 lines
582 B
HCL

resource "aws_efs_file_system" "csi" {
creation_token = "${local.random_name}-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
}
}