Skip to content

Commit

Permalink
azurerm_managed_lustre_file_system: Add mgs_address attribute (ha…
Browse files Browse the repository at this point in the history
…shicorp#23941)

* `azurerm_managed_lustre_file_system`: Add `mgs_address` attribute

Fixes hashicorp#23743

* Typofix
  • Loading branch information
favoretti authored Nov 20, 2023
1 parent 0118066 commit 97f6cc8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type ManagedLustreFileSystemModel struct {
Identity []identity.ModelUserAssigned `tfschema:"identity"`
EncryptionKey []EncryptionKey `tfschema:"encryption_key"`
MaintenanceWindow []MaintenanceWindow `tfschema:"maintenance_window"`
MgsAddress string `tfschema:"mgs_address"`
SkuName string `tfschema:"sku_name"`
StorageCapacityInTb int64 `tfschema:"storage_capacity_in_tb"`
SubnetId string `tfschema:"subnet_id"`
Expand Down Expand Up @@ -229,7 +230,12 @@ func (r ManagedLustreFileSystemResource) Arguments() map[string]*pluginsdk.Schem
}

func (r ManagedLustreFileSystemResource) Attributes() map[string]*pluginsdk.Schema {
return map[string]*pluginsdk.Schema{}
return map[string]*pluginsdk.Schema{
"mgs_address": {
Type: pluginsdk.TypeString,
Computed: true,
},
}
}

func (r ManagedLustreFileSystemResource) CustomizeDiff() sdk.ResourceFunc {
Expand Down Expand Up @@ -393,6 +399,9 @@ func (r ManagedLustreFileSystemResource) Read() sdk.ResourceFunc {
state.SubnetId = properties.FilesystemSubnet
state.StorageCapacityInTb = int64(properties.StorageCapacityTiB)
state.MaintenanceWindow = flattenManagedLustreFileSystemMaintenanceWindow(properties.MaintenanceWindow)
if properties.ClientInfo != nil && properties.ClientInfo.MgsAddress != nil {
state.MgsAddress = *properties.ClientInfo.MgsAddress
}
state.HsmSetting = flattenManagedLustreFileSystemHsmSetting(properties.Hsm)
state.Zones = pointer.From(model.Zones)
state.EncryptionKey = flattenManagedLustreFileSystemEncryptionKey(properties.EncryptionSettings)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func TestAccManagedLustreFileSystem_basic(t *testing.T) {
Config: r.basic(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
check.That(data.ResourceName).Key("mgs_address").IsNotEmpty(),
),
},
data.ImportStep(),
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/managed_lustre_file_system.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ In addition to the Arguments listed above - the following Attributes are exporte

* `id` - The ID of the Azure Managed Lustre File System.

* `mgs_address` - IP Address of Managed Lustre File System Services.

## Timeouts

The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions:
Expand Down

0 comments on commit 97f6cc8

Please sign in to comment.