Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mount_name to aws_fsx_lustre_file_system #14313

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions aws/resource_aws_fsx_lustre_file_system.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ func resourceAwsFsxLustreFileSystem() *schema.Resource {
ForceNew: true,
ValidateFunc: validation.IntBetween(1, 512000),
},
"mount_name": {
Type: schema.TypeString,
Computed: true,
},
"network_interface_ids": {
// As explained in https://docs.aws.amazon.com/fsx/latest/LustreGuide/mounting-on-premises.html, the first
// network_interface_id is the primary one, so ordering matters. Use TypeList instead of TypeSet to preserve it.
Expand Down Expand Up @@ -304,6 +308,7 @@ func resourceAwsFsxLustreFileSystemRead(d *schema.ResourceData, meta interface{}
if lustreConfig.PerUnitStorageThroughput != nil {
d.Set("per_unit_storage_throughput", lustreConfig.PerUnitStorageThroughput)
}
d.Set("mount_name", filesystem.LustreConfiguration.MountName)

if filesystem.KmsKeyId != nil {
d.Set("kms_key_id", filesystem.KmsKeyId)
Expand Down
5 changes: 5 additions & 0 deletions aws/resource_aws_fsx_lustre_file_system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func TestAccAWSFsxLustreFileSystem_basic(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "export_path", ""),
resource.TestCheckResourceAttr(resourceName, "import_path", ""),
resource.TestCheckResourceAttr(resourceName, "imported_file_chunk_size", "0"),
resource.TestCheckResourceAttr(resourceName, "mount_name", "fsx"),
resource.TestCheckResourceAttr(resourceName, "network_interface_ids.#", "2"),
testAccCheckResourceAttrAccountID(resourceName, "owner_id"),
resource.TestCheckResourceAttr(resourceName, "storage_capacity", "1200"),
Expand Down Expand Up @@ -447,6 +448,8 @@ func TestAccAWSFsxLustreFileSystem_DeploymentTypePersistent1(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "deployment_type", fsx.LustreDeploymentTypePersistent1),
resource.TestCheckResourceAttr(resourceName, "automatic_backup_retention_days", "0"),
testAccMatchResourceAttrRegionalARN(resourceName, "kms_key_id", "kms", regexp.MustCompile(`key/.+`)),
// We don't know the randomly generated mount_name ahead of time like for SCRATCH_1 deployment types.
resource.TestCheckResourceAttrSet(resourceName, "mount_name"),
),
},
{
Expand Down Expand Up @@ -511,6 +514,8 @@ func TestAccAWSFsxLustreFileSystem_DeploymentTypeScratch2(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
testAccCheckFsxLustreFileSystemExists(resourceName, &filesystem),
resource.TestCheckResourceAttr(resourceName, "deployment_type", fsx.LustreDeploymentTypeScratch2),
// We don't know the randomly generated mount_name ahead of time like for SCRATCH_1 deployment types.
resource.TestCheckResourceAttrSet(resourceName, "mount_name"),
),
},
{
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/fsx_lustre_file_system.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ In addition to all arguments above, the following attributes are exported:
* `dns_name` - DNS name for the file system, e.g. `fs-12345678.fsx.us-west-2.amazonaws.com`
* `id` - Identifier of the file system, e.g. `fs-12345678`
* `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.
* `mount_name` - The value to be used when mounting the filesystem.
* `owner_id` - AWS account identifier that created the file system.
* `vpc_id` - Identifier of the Virtual Private Cloud for the file system.

Expand Down