hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.61k stars 9k forks source link

[Enhancement]: Support Detailed Root Volume Configurations for aws_fsx_openzfs_volume Creation from Snapshot #36630

Open ehubbard opened 3 months ago

ehubbard commented 3 months ago

Description

The AWS CLI provides comprehensive options for configuring the root volume when creating an FSx for OpenZFS volume from a snapshot. These options include settings for storage capacity, NFS exports, user and group quotas, data compression types, and copy strategies among others.

Currently, the Terraform AWS provider's aws_fsx_openzfs_volume resource does not offer the same level of configurability directly. Instead, it primarily relies on the configurations of the snapshot from which the volume is created. This limitation restricts users' ability to tailor the newly created FSx volumes according to their specific needs directly via Terraform.

It would be nice if, when the root volume configuration is specified in the FSx resource, the backend code could smartly apply it after the snapshot is restored.

Affected Resource(s) and/or Data Source(s)

No response

Potential Terraform Configuration

resource "aws_fsx_openzfs_volume" "example" {
  volume_type            = "OPENZFS"
  parent_volume_id       = "fsvol-example"
  storage_capacity_quota_gib = 3000
  copy_tags_to_snapshots = true
  nfs_exports {
    client_configurations {
      clients = "10.3.0.0/16"
      options = ["rw", "crossmnt", "no_root_squash"]
    }
  }
  user_and_group_quotas {
    type                       = "GROUP"
    id                         = 0
    storage_capacity_quota_gib = 0
  }
  user_and_group_quotas {
    type                       = "USER"
    id                         = 0
    storage_capacity_quota_gib = 0
  }
  data_compression_type = "LZ4"
  origin_snapshot {
    snapshot_arn  = "arn:aws:fsx:us-east-1:example:snapshot/fsvol-example/fsvolsnap-example"
    copy_strategy = "CLONE"
  }
  name = "MyVolumeFromSnapshot"
}

References

https://docs.aws.amazon.com/cli/latest/reference/fsx/create-volume.html

Would you like to implement a fix?

No

github-actions[bot] commented 3 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue