Skip to content

Commit

Permalink
Add mount_name to aws_fsx_lustre_file_system
Browse files Browse the repository at this point in the history
  • Loading branch information
mtpdt committed Sep 23, 2020
1 parent 528b404 commit 0d36e0d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
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

0 comments on commit 0d36e0d

Please sign in to comment.