Кто-нибудь настраивал один? Я пытаюсь создать общий ресурс NFS.
aws_storagegateway_local_disk не может найти диск, и без него терраформ завершается с консолью aws, показывающей сообщение «Вам необходимо выделить локальное хранилище».
Документы terraform плохи для настройки этого, так как, кажется, для настройки требуется несколько частей.
resource "aws_instance" "storage-gateway-server" {
ami = "${local.thininstallami}"
instance_type = "m4.xlarge"
associate_public_ip_address = false
key_name = "${local.keyname}"
subnet_id = "${local.subnet}"
vpc_security_group_ids = ["${aws_security_group.storage-gateway-sg.id}"]
root_block_device {
volume_size = 80
volume_type = "gp2"
}
}
resource "aws_ebs_volume" "storage-gateway-server-cache-disk" {
availability_zone = "us-east-1a"
size = 150
encrypted = true
type = "gp2"
}
resource "aws_volume_attachment" "storage-gateway-server-cache-disk-attach" {
device_name = "/dev/sdb"
volume_id = "${aws_ebs_volume.storage-gateway-server-cache-disk.id}"
instance_id = "${aws_instance.storage-gateway-server.id}"
}
resource "aws_storagegateway_gateway" "storage-gateway" {
gateway_ip_address = "${aws_instance.storage-gateway-server.private_ip}"
gateway_name = "storage-gateway"
gateway_timezone = "GMT"
gateway_type = "FILE_S3"
}
data "aws_storagegateway_local_disk" "storage-gateway-data" {
disk_path = "${aws_volume_attachment.storage-gateway-server-cache-disk-attach.device_name}"
gateway_arn = "${aws_storagegateway_gateway.storage-gateway.arn}"
}
resource "aws_storagegateway_cache" "storage-gateway-cache" {
disk_id = "${data.aws_storagegateway_local_disk.storage-gateway-data.id}"
gateway_arn = "${aws_storagegateway_gateway.storage-gateway.arn}"
}
resource "aws_storagegateway_nfs_file_share" "nfs_share" {
client_list = ["0.0.0.0/0"]
gateway_arn = "${aws_storagegateway_gateway.storage-gateway.arn}"
location_arn = "${aws_s3_bucket.transfer-bucket.arn}"
role_arn = "${aws_iam_role.transfer-role.arn}"
}