I am creating an AWS Volume Storage Gateway. I can create the Gateway, Cache and Upload Buffer. However, I cannot create a volume larger than 1GB. It looks like an overflow problem.
.
resource "aws_storagegateway_gateway" "apm" {
gateway_ip_address = data.aws_instance.storagegateway.private_ip # "172.29.29.207" --need to define VM
gateway_name = "Pracice Management Volume Gateway"
gateway_timezone = "GMT"
gateway_type = "CACHED"
gateway_vpc_endpoint = data.aws_vpc_endpoint.storagegateway.dns_entry[0].dns_name
cloudwatch_log_group_arn = data.aws_cloudwatch_log_group.storagegateway.arn
}
data "aws_storagegateway_local_disk" "cache" {
disk_node = "/dev/xvdc"
gateway_arn = aws_storagegateway_gateway.apm.arn
}
resource "aws_storagegateway_cache" "apm" {
disk_id = data.aws_storagegateway_local_disk.cache.disk_id
gateway_arn = aws_storagegateway_gateway.apm.arn
}
data "aws_storagegateway_local_disk" "buffer" {
disk_node = "/dev/xvdb"
gateway_arn = aws_storagegateway_gateway.apm.arn
}
resource "aws_storagegateway_upload_buffer" "apm" {
disk_id = data.aws_storagegateway_local_disk.buffer.disk_id
gateway_arn = aws_storagegateway_gateway.apm.arn
}
variable "Gb512" {
type = string
default = 9 * 1024 * 1024 * 1024
}
resource "aws_storagegateway_cached_iscsi_volume" "volume01" {
gateway_arn =aws_storagegateway_cache.apm.gateway_arn
network_interface_id = data.aws_instance.storagegateway.private_ip
target_name = "volume01"
volume_size_in_bytes = var.Gb512
}
I have tried defining Gb512 as number and string. I tried string, because the errors look like numeric overflow errors.
Terraform from the 386 (32 bit) release cannot handle the number. I had to change Terraform.exe to use the AMD64 version. Downloads at: https://www.terraform.io/downloads
I Defined var GB as 1024 * 1024 * 1024. I set:
variable "GB" {
type = number
default = 1024 * 1024 * 1024
}
...
volume_size_in_bytes = 500 * var.GB