Skip to content

Commit

Permalink
feat: export of remote administration endpoint attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
drexler committed Jun 5, 2020
1 parent c90f1d6 commit 67d6026
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
28 changes: 28 additions & 0 deletions aws/resource_aws_fsx_windows_file_system.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,18 @@ func resourceAwsFsxWindowsFileSystem() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"windows_configuration": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"remote_administration_endpoint": {
Type: schema.TypeString,
Computed: true,
},
},
},
},
"security_group_ids": {
Type: schema.TypeSet,
Optional: true,
Expand Down Expand Up @@ -333,6 +345,10 @@ func resourceAwsFsxWindowsFileSystemRead(d *schema.ResourceData, meta interface{
return fmt.Errorf("error setting self_managed_active_directory: %s", err)
}

if err := d.Set("windows_configuration", flattenFsxWindowsConfiguration(d, filesystem.WindowsConfiguration)); err != nil {
return fmt.Errorf("error setting windows configuration: %s", err)
}

d.Set("storage_capacity", filesystem.StorageCapacity)

if err := d.Set("subnet_ids", aws.StringValueSlice(filesystem.SubnetIds)); err != nil {
Expand Down Expand Up @@ -441,3 +457,15 @@ func flattenFsxSelfManagedActiveDirectoryConfiguration(d *schema.ResourceData, a

return []map[string]interface{}{m}
}

func flattenFsxWindowsConfiguration(d *schema.ResourceData, adopts *fsx.WindowsFileSystemConfiguration) []map[string]interface{} {
if adopts == nil {
return []map[string]interface{}{}
}

m := map[string]interface{}{
"remote_administration_endpoint": aws.StringValue(adopts.RemoteAdministrationEndpoint),
}

return []map[string]interface{}{m}
}
1 change: 1 addition & 0 deletions aws/resource_aws_fsx_windows_file_system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func TestAccAWSFsxWindowsFileSystem_basic(t *testing.T) {
resource.TestMatchResourceAttr(resourceName, "dns_name", regexp.MustCompile(`fs-.+\..+`)),
resource.TestMatchResourceAttr(resourceName, "kms_key_id", regexp.MustCompile(`^arn:`)),
resource.TestCheckResourceAttr(resourceName, "network_interface_ids.#", "1"),
resource.TestCheckResourceAttr(resourceName, "windows_configuration.#", 1),
testAccCheckResourceAttrAccountID(resourceName, "owner_id"),
resource.TestCheckResourceAttr(resourceName, "security_group_ids.#", "0"),
resource.TestCheckResourceAttr(resourceName, "self_managed_active_directory.#", "0"),
Expand Down
3 changes: 2 additions & 1 deletion website/docs/r/fsx_windows_file_system.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ In addition to all arguments above, the following attributes are exported:
* `network_interface_ids` - Set of Elastic Network Interface identifiers from which the file system is accessible.
* `owner_id` - AWS account identifier that created the file system.
* `vpc_id` - Identifier of the Virtual Private Cloud for the file system.

* `windows_configuration`
* `remote_administration_endpoint` - The DNS endpoint of the file system
## Timeouts

`aws_fsx_windows_file_system` provides the following [Timeouts](/docs/configuration/resources.html#timeouts)
Expand Down

0 comments on commit 67d6026

Please sign in to comment.