diff --git a/Terraform/deploy-fsx-ontap/README.md b/Terraform/deploy-fsx-ontap/README.md index 90051cc..251ed30 100644 --- a/Terraform/deploy-fsx-ontap/README.md +++ b/Terraform/deploy-fsx-ontap/README.md @@ -210,7 +210,7 @@ terraform apply -y | svm_name | The name of the Storage Virtual Machine | `string` | `"first_svm"` | no | | tags | Tags to be applied to the resources | `map(any)` |
{
"Name": "terraform-fsxn"
}
| no | | vol_info | Details for the volume creation | `map(any)` |
{
"bypass_sl_retention": false,
"cooling_period": 31,
"copy_tags_to_backups": false,
"efficiency": true,
"junction_path": "/vol1",
"sec_style": "UNIX",
"size_mg": 1024,
"skip_final_backup": false,
"tier_policy_name": "AUTO",
"vol_name": "vol1",
"vol_type": "RW"
}
| no | -| vol_snapshot_policy | Specifies the snapshot policy for the volume | `map(any)` |
{
"Name": "terraform-fsxn"
}
| no | +| vol_snapshot_policy | Specifies the snapshot policy for the volume | `map(any)` | `null` | no | | vpc_id | The ID of the VPC in which the FSxN fikesystem should be deployed | `string` | `"vpc-111111111"` | no | ### Outputs diff --git a/Terraform/deploy-fsx-ontap/main.tf b/Terraform/deploy-fsx-ontap/main.tf index 63c593e..821bffd 100644 --- a/Terraform/deploy-fsx-ontap/main.tf +++ b/Terraform/deploy-fsx-ontap/main.tf @@ -146,10 +146,16 @@ resource "aws_fsx_ontap_file_system" "terraform-fsxn" { automatic_backup_retention_days = var.backup_retention_days daily_automatic_backup_start_time = var.daily_backup_start_time storage_type = var.storage_type - disk_iops_configuration = var.disk_iops_configuration fsx_admin_password = var.fsx_admin_password route_table_ids = var.route_table_ids tags = var.tags + dynamic "disk_iops_configuration" { + for_each = var.disk_iops_configuration != null ? [var.disk_iops_configuration] : [] + content { + iops = disk_iops_configuration.value["iops"] + mode = disk_iops_configuration.value["mode"] + } + } # endpoint_ip_address_range = "" } @@ -183,6 +189,6 @@ resource "aws_fsx_ontap_volume" "myvol" { security_style = var.vol_info["sec_style"] skip_final_backup = var.vol_info["skip_final_backup"] # snaplock_configuration {} - snapshot_policy = "NONE" + # snapshot_policy {} tags = var.tags } diff --git a/Terraform/deploy-fsx-ontap/variables.tf b/Terraform/deploy-fsx-ontap/variables.tf index 6cba2f0..ace4555 100644 --- a/Terraform/deploy-fsx-ontap/variables.tf +++ b/Terraform/deploy-fsx-ontap/variables.tf @@ -129,9 +129,7 @@ variable "vol_info" { variable "vol_snapshot_policy" { description = "Specifies the snapshot policy for the volume" type = map(any) - default = { - "Name" = "terraform-fsxn" - } + default = null } variable "tags" {