Skip to content

Commit

Permalink
feat: Add metadata_configuration to FSx Lustre, `aggregate_configur…
Browse files Browse the repository at this point in the history
…ation` to FSx Ontap, and `file_system_endpoint_ip_address` attribute to Openzfs (#4)
  • Loading branch information
magreenbaum authored Jun 14, 2024
1 parent 3bf209e commit 432eeb2
Show file tree
Hide file tree
Showing 24 changed files with 85 additions and 27 deletions.
4 changes: 2 additions & 2 deletions examples/lustre/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ Note that this example may create resources which will incur monetary charges on
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.34 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.53 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.34 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.53 |

## Modules

Expand Down
7 changes: 6 additions & 1 deletion examples/lustre/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ module "fsx_lustre_persistent_2" {
automatic_backup_retention_days = 0
data_compression_type = "LZ4"
deployment_type = "PERSISTENT_2"
file_system_type_version = "2.12"
file_system_type_version = "2.15"

log_configuration = {
level = "ERROR_ONLY"
Expand All @@ -110,6 +110,11 @@ module "fsx_lustre_persistent_2" {
root_squash = "365534:65534"
}

metadata_configuration = {
mode = "USER_PROVISIONED"
iops = 1500
}

storage_capacity = 1200
storage_type = "SSD"
subnet_ids = slice(module.vpc.private_subnets, 0, 1)
Expand Down
2 changes: 1 addition & 1 deletion examples/lustre/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.34"
version = ">= 5.53"
}
}
}
4 changes: 2 additions & 2 deletions examples/ontap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ Note that this example may create resources which will incur monetary charges on
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.34 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.53 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.34 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.53 |

## Modules

Expand Down
16 changes: 16 additions & 0 deletions examples/ontap/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,22 @@ module "fsx_ontap" {
}
}
}
ex-flexgroup = {
name = "flexgroup"

volumes = {
ex-flexgroup = {
name = "flexgroup"
junction_path = "/test"
size_in_bytes = 1024000000000
storage_efficiency_enabled = true
volume_style = "FLEXGROUP"
aggregate_configuration = {
constituents_per_aggregate = 9
}
}
}
}
ex-other = {
name = "one"
root_volume_security_style = "NTFS"
Expand Down
2 changes: 1 addition & 1 deletion examples/ontap/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.34"
version = ">= 5.53"
}
}
}
5 changes: 3 additions & 2 deletions examples/openzfs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ Note that this example may create resources which will incur monetary charges on
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.34 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.53 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.34 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.53 |

## Modules

Expand All @@ -55,6 +55,7 @@ No inputs.
| <a name="output_child_volumes_snapshots"></a> [child\_volumes\_snapshots](#output\_child\_volumes\_snapshots) | A map of OpenZFS child volumes and their snapshots |
| <a name="output_file_system_arn"></a> [file\_system\_arn](#output\_file\_system\_arn) | Amazon Resource Name of the file system |
| <a name="output_file_system_dns_name"></a> [file\_system\_dns\_name](#output\_file\_system\_dns\_name) | DNS name for the file system, e.g., `fs-12345678.fsx.us-west-2.amazonaws.com` |
| <a name="output_file_system_endpoint_ip_address"></a> [file\_system\_endpoint\_ip\_address](#output\_file\_system\_endpoint\_ip\_address) | IP address of the endpoint that is used to access data or to manage the file system |
| <a name="output_file_system_id"></a> [file\_system\_id](#output\_file\_system\_id) | Identifier of the file system, e.g., `fs-12345678` |
| <a name="output_file_system_network_interface_ids"></a> [file\_system\_network\_interface\_ids](#output\_file\_system\_network\_interface\_ids) | Set of Elastic Network Interface identifiers from which the file system is accessible. As explained in the [documentation](https://docs.aws.amazon.com/fsx/latest/LustreGuide/mounting-on-premises.html), the first network interface returned is the primary network interface |
| <a name="output_file_system_root_volume_id"></a> [file\_system\_root\_volume\_id](#output\_file\_system\_root\_volume\_id) | Identifier of the root volume, e.g., `fsvol-12345678` |
Expand Down
5 changes: 5 additions & 0 deletions examples/openzfs/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ output "file_system_network_interface_ids" {
value = module.fsx_openzfs.file_system_network_interface_ids
}

output "file_system_endpoint_ip_address" {
description = "IP address of the endpoint that is used to access data or to manage the file system"
value = module.fsx_openzfs.file_system_endpoint_ip_address
}

################################################################################
# OpenZFS Volume(s)
################################################################################
Expand Down
2 changes: 1 addition & 1 deletion examples/openzfs/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.34"
version = ">= 5.53"
}
}
}
4 changes: 2 additions & 2 deletions examples/windows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ Note that this example may create resources which will incur monetary charges on
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.34 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.53 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.34 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.53 |

## Modules

Expand Down
2 changes: 1 addition & 1 deletion examples/windows/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.34"
version = ">= 5.53"
}
}
}
5 changes: 3 additions & 2 deletions modules/lustre/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,13 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.34 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.53 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.34 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.53 |

## Modules

Expand Down Expand Up @@ -231,6 +231,7 @@ No modules.
| <a name="input_file_system_type_version"></a> [file\_system\_type\_version](#input\_file\_system\_type\_version) | Sets the Lustre version for the file system that you're creating | `string` | `null` | no |
| <a name="input_kms_key_id"></a> [kms\_key\_id](#input\_kms\_key\_id) | ARN for the KMS Key to encrypt the file system at rest. Defaults to an AWS managed KMS Key | `string` | `null` | no |
| <a name="input_log_configuration"></a> [log\_configuration](#input\_log\_configuration) | The configuration object for Amazon FSx for Lustre file systems used in the CreateFileSystem and CreateFileSystemFromBackup operations. | `map(string)` | <pre>{<br> "level": "WARN_ERROR"<br>}</pre> | no |
| <a name="input_metadata_configuration"></a> [metadata\_configuration](#input\_metadata\_configuration) | The Lustre metadata configuration used when creating an Amazon FSx for Lustre file system. This can be used to specify a user provisioned metadata scale. This is only supported when deployment\_type is set to PERSISTENT\_2 | `any` | `{}` | no |
| <a name="input_name"></a> [name](#input\_name) | The name of the file system | `string` | `""` | no |
| <a name="input_per_unit_storage_throughput"></a> [per\_unit\_storage\_throughput](#input\_per\_unit\_storage\_throughput) | Describes the amount of read and write throughput for each 1 tebibyte of storage, in MB/s/TiB, required for the `PERSISTENT_1` and `PERSISTENT_2` deployment\_type | `number` | `null` | no |
| <a name="input_root_squash_configuration"></a> [root\_squash\_configuration](#input\_root\_squash\_configuration) | The Lustre root squash configuration used when creating an Amazon FSx for Lustre file system. When enabled, root squash restricts root-level access from clients that try to access your file system as a root user | `any` | `{}` | no |
Expand Down
8 changes: 8 additions & 0 deletions modules/lustre/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ resource "aws_fsx_lustre_file_system" "this" {

per_unit_storage_throughput = var.per_unit_storage_throughput

dynamic "metadata_configuration" {
for_each = length(var.metadata_configuration) > 0 ? [var.metadata_configuration] : []
content {
mode = try(metadata_configuration.value.mode, null)
iops = try(metadata_configuration.value.iops, null)
}
}

dynamic "root_squash_configuration" {
for_each = length(var.root_squash_configuration) > 0 ? [var.root_squash_configuration] : []

Expand Down
5 changes: 5 additions & 0 deletions modules/lustre/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ variable "per_unit_storage_throughput" {
default = null
}

variable "metadata_configuration" {
description = "The Lustre metadata configuration used when creating an Amazon FSx for Lustre file system. This can be used to specify a user provisioned metadata scale. This is only supported when deployment_type is set to PERSISTENT_2"
type = any
default = {}
}
variable "root_squash_configuration" {
description = "The Lustre root squash configuration used when creating an Amazon FSx for Lustre file system. When enabled, root squash restricts root-level access from clients that try to access your file system as a root user"
type = any
Expand Down
2 changes: 1 addition & 1 deletion modules/lustre/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.34"
version = ">= 5.53"
}
}
}
4 changes: 2 additions & 2 deletions modules/ontap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,13 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.34 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.53 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.34 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.53 |

## Modules

Expand Down
14 changes: 12 additions & 2 deletions modules/ontap/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,18 @@ resource "aws_fsx_ontap_volume" "this" {
name = try(each.value.name, each.key)
ontap_volume_type = try(each.value.ontap_volume_type, null)
security_style = try(each.value.security_style, null)
size_in_megabytes = each.value.size_in_megabytes
size_in_bytes = try(each.value.size_in_bytes, null)
size_in_megabytes = try(each.value.size_in_megabytes, null)
skip_final_backup = try(each.value.skip_final_backup, null)

dynamic "aggregate_configuration" {
for_each = try([each.value.aggregate_configuration], [])
content {
aggregates = try(aggregate_configuration.value.aggregates, null)
constituents_per_aggregate = try(aggregate_configuration.value.constituents_per_aggregate, null)
}
}

dynamic "snaplock_configuration" {
for_each = try([each.value.snaplock_configuration], [])

Expand Down Expand Up @@ -188,7 +197,8 @@ resource "aws_fsx_ontap_volume" "this" {
}
}

volume_type = "ONTAP"
volume_style = try(each.value.volume_style, null)
volume_type = "ONTAP"

tags = merge(
var.tags,
Expand Down
2 changes: 1 addition & 1 deletion modules/ontap/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.34"
version = ">= 5.53"
}
}
}
5 changes: 3 additions & 2 deletions modules/openzfs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,13 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.34 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.53 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.34 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.53 |

## Modules

Expand Down Expand Up @@ -218,6 +218,7 @@ No modules.
| <a name="output_child_volumes_snapshots"></a> [child\_volumes\_snapshots](#output\_child\_volumes\_snapshots) | A map of OpenZFS child volumes and their snapshots |
| <a name="output_file_system_arn"></a> [file\_system\_arn](#output\_file\_system\_arn) | Amazon Resource Name of the file system |
| <a name="output_file_system_dns_name"></a> [file\_system\_dns\_name](#output\_file\_system\_dns\_name) | DNS name for the file system, e.g., `fs-12345678.fsx.us-west-2.amazonaws.com` |
| <a name="output_file_system_endpoint_ip_address"></a> [file\_system\_endpoint\_ip\_address](#output\_file\_system\_endpoint\_ip\_address) | IP address of the endpoint that is used to access data or to manage the file system |
| <a name="output_file_system_id"></a> [file\_system\_id](#output\_file\_system\_id) | Identifier of the file system, e.g., `fs-12345678` |
| <a name="output_file_system_network_interface_ids"></a> [file\_system\_network\_interface\_ids](#output\_file\_system\_network\_interface\_ids) | Set of Elastic Network Interface identifiers from which the file system is accessible. As explained in the [documentation](https://docs.aws.amazon.com/fsx/latest/LustreGuide/mounting-on-premises.html), the first network interface returned is the primary network interface |
| <a name="output_file_system_root_volume_id"></a> [file\_system\_root\_volume\_id](#output\_file\_system\_root\_volume\_id) | Identifier of the root volume, e.g., `fsvol-12345678` |
Expand Down
5 changes: 5 additions & 0 deletions modules/openzfs/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ output "file_system_network_interface_ids" {
value = try(aws_fsx_openzfs_file_system.this[0].network_interface_ids, [])
}

output "file_system_endpoint_ip_address" {
description = "IP address of the endpoint that is used to access data or to manage the file system"
value = try(aws_fsx_openzfs_file_system.this[0].endpoint_ip_address, null)
}

################################################################################
# OpenZFS Volume(s)
################################################################################
Expand Down
2 changes: 1 addition & 1 deletion modules/openzfs/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.34"
version = ">= 5.53"
}
}
}
4 changes: 2 additions & 2 deletions modules/windows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.34 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.53 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.34 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.53 |

## Modules

Expand Down
2 changes: 1 addition & 1 deletion modules/windows/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.34"
version = ">= 5.53"
}
}
}
1 change: 1 addition & 0 deletions wrappers/lustre/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ module "wrapper" {
log_configuration = try(each.value.log_configuration, var.defaults.log_configuration, {
level = "WARN_ERROR"
})
metadata_configuration = try(each.value.metadata_configuration, var.defaults.metadata_configuration, {})
name = try(each.value.name, var.defaults.name, "")
per_unit_storage_throughput = try(each.value.per_unit_storage_throughput, var.defaults.per_unit_storage_throughput, null)
root_squash_configuration = try(each.value.root_squash_configuration, var.defaults.root_squash_configuration, {})
Expand Down

0 comments on commit 432eeb2

Please sign in to comment.