@@ -1010,7 +1010,7 @@ func TestAccFSxLustreFileSystem_metadataConfig(t *testing.T) {
1010
1010
ImportStateVerifyIgnore : []string {names .AttrSecurityGroupIDs },
1011
1011
},
1012
1012
{
1013
- Config : testAccLustreFileSystemConfig_metadata_iops (rName , "USER_PROVISIONED" , 1500 ),
1013
+ Config : testAccLustreFileSystemConfig_metadata_iops (rName , "USER_PROVISIONED" , 1500 , 1200 ),
1014
1014
Check : resource .ComposeTestCheckFunc (
1015
1015
testAccCheckLustreFileSystemExists (ctx , resourceName , & filesystem2 ),
1016
1016
testAccCheckLustreFileSystemNotRecreated (& filesystem1 , & filesystem2 ),
@@ -1036,7 +1036,7 @@ func TestAccFSxLustreFileSystem_metadataConfig_increase(t *testing.T) {
1036
1036
CheckDestroy : testAccCheckLustreFileSystemDestroy (ctx ),
1037
1037
Steps : []resource.TestStep {
1038
1038
{
1039
- Config : testAccLustreFileSystemConfig_metadata_iops (rName , "USER_PROVISIONED" , 1500 ),
1039
+ Config : testAccLustreFileSystemConfig_metadata_iops (rName , "USER_PROVISIONED" , 1500 , 1200 ),
1040
1040
Check : resource .ComposeTestCheckFunc (
1041
1041
testAccCheckLustreFileSystemExists (ctx , resourceName , & filesystem1 ),
1042
1042
resource .TestCheckResourceAttr (resourceName , "metadata_configuration.#" , "1" ),
@@ -1051,7 +1051,7 @@ func TestAccFSxLustreFileSystem_metadataConfig_increase(t *testing.T) {
1051
1051
ImportStateVerifyIgnore : []string {names .AttrSecurityGroupIDs },
1052
1052
},
1053
1053
{
1054
- Config : testAccLustreFileSystemConfig_metadata_iops (rName , "USER_PROVISIONED" , 3000 ),
1054
+ Config : testAccLustreFileSystemConfig_metadata_iops (rName , "USER_PROVISIONED" , 3000 , 1200 ),
1055
1055
Check : resource .ComposeTestCheckFunc (
1056
1056
testAccCheckLustreFileSystemExists (ctx , resourceName , & filesystem2 ),
1057
1057
testAccCheckLustreFileSystemNotRecreated (& filesystem1 , & filesystem2 ),
@@ -1077,7 +1077,7 @@ func TestAccFSxLustreFileSystem_metadataConfig_decrease(t *testing.T) {
1077
1077
CheckDestroy : testAccCheckLustreFileSystemDestroy (ctx ),
1078
1078
Steps : []resource.TestStep {
1079
1079
{
1080
- Config : testAccLustreFileSystemConfig_metadata_iops (rName , "USER_PROVISIONED" , 3000 ),
1080
+ Config : testAccLustreFileSystemConfig_metadata_iops (rName , "USER_PROVISIONED" , 3000 , 1200 ),
1081
1081
Check : resource .ComposeTestCheckFunc (
1082
1082
testAccCheckLustreFileSystemExists (ctx , resourceName , & filesystem1 ),
1083
1083
resource .TestCheckResourceAttr (resourceName , "metadata_configuration.#" , "1" ),
@@ -1092,7 +1092,7 @@ func TestAccFSxLustreFileSystem_metadataConfig_decrease(t *testing.T) {
1092
1092
ImportStateVerifyIgnore : []string {names .AttrSecurityGroupIDs },
1093
1093
},
1094
1094
{
1095
- Config : testAccLustreFileSystemConfig_metadata_iops (rName , "USER_PROVISIONED" , 1500 ),
1095
+ Config : testAccLustreFileSystemConfig_metadata_iops (rName , "USER_PROVISIONED" , 1500 , 1200 ),
1096
1096
Check : resource .ComposeTestCheckFunc (
1097
1097
testAccCheckLustreFileSystemExists (ctx , resourceName , & filesystem2 ),
1098
1098
testAccCheckLustreFileSystemRecreated (& filesystem1 , & filesystem2 ),
@@ -1105,6 +1105,44 @@ func TestAccFSxLustreFileSystem_metadataConfig_decrease(t *testing.T) {
1105
1105
})
1106
1106
}
1107
1107
1108
+ func TestAccFSxLustreFileSystem_metadataConfig_increaseWithStorageCapacity (t * testing.T ) {
1109
+ ctx := acctest .Context (t )
1110
+ var filesystem1 , filesystem2 awstypes.FileSystem
1111
+ resourceName := "aws_fsx_lustre_file_system.test"
1112
+ rName := sdkacctest .RandomWithPrefix (acctest .ResourcePrefix )
1113
+
1114
+ resource .ParallelTest (t , resource.TestCase {
1115
+ PreCheck : func () { acctest .PreCheck (ctx , t ); acctest .PreCheckPartitionHasService (t , names .FSxEndpointID ) },
1116
+ ErrorCheck : acctest .ErrorCheck (t , names .FSxServiceID ),
1117
+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories ,
1118
+ CheckDestroy : testAccCheckLustreFileSystemDestroy (ctx ),
1119
+ Steps : []resource.TestStep {
1120
+ {
1121
+ Config : testAccLustreFileSystemConfig_metadata_iops (rName , "USER_PROVISIONED" , 1500 , 1200 ),
1122
+ Check : resource .ComposeTestCheckFunc (
1123
+ testAccCheckLustreFileSystemExists (ctx , resourceName , & filesystem1 ),
1124
+ resource .TestCheckResourceAttr (resourceName , "metadata_configuration.#" , "1" ),
1125
+ resource .TestCheckResourceAttr (resourceName , "metadata_configuration.0.mode" , "USER_PROVISIONED" ),
1126
+ resource .TestCheckResourceAttr (resourceName , "metadata_configuration.0.iops" , "1500" ),
1127
+ resource .TestCheckResourceAttr (resourceName , "storage_capacity" , "1200" ),
1128
+ ),
1129
+ },
1130
+ {
1131
+ // When storage_capacity is increased to 2400, IOPS must be increased to at least 3000.
1132
+ Config : testAccLustreFileSystemConfig_metadata_iops (rName , "USER_PROVISIONED" , 3000 , 2400 ),
1133
+ Check : resource .ComposeTestCheckFunc (
1134
+ testAccCheckLustreFileSystemExists (ctx , resourceName , & filesystem2 ),
1135
+ testAccCheckLustreFileSystemNotRecreated (& filesystem1 , & filesystem2 ),
1136
+ resource .TestCheckResourceAttr (resourceName , "metadata_configuration.#" , "1" ),
1137
+ resource .TestCheckResourceAttr (resourceName , "metadata_configuration.0.mode" , "USER_PROVISIONED" ),
1138
+ resource .TestCheckResourceAttr (resourceName , "metadata_configuration.0.iops" , "3000" ),
1139
+ resource .TestCheckResourceAttr (resourceName , "storage_capacity" , "2400" ),
1140
+ ),
1141
+ },
1142
+ },
1143
+ })
1144
+ }
1145
+
1108
1146
func TestAccFSxLustreFileSystem_rootSquashConfig (t * testing.T ) {
1109
1147
ctx := acctest .Context (t )
1110
1148
var filesystem awstypes.FileSystem
@@ -2015,10 +2053,10 @@ resource "aws_fsx_lustre_file_system" "test" {
2015
2053
` , rName , mode ))
2016
2054
}
2017
2055
2018
- func testAccLustreFileSystemConfig_metadata_iops (rName , mode string , iops int ) string {
2056
+ func testAccLustreFileSystemConfig_metadata_iops (rName , mode string , iops , storageCapacity int ) string {
2019
2057
return acctest .ConfigCompose (testAccLustreFileSystemConfig_base (rName ), fmt .Sprintf (`
2020
2058
resource "aws_fsx_lustre_file_system" "test" {
2021
- storage_capacity = 1200
2059
+ storage_capacity = %[4]d
2022
2060
subnet_ids = aws_subnet.test[*].id
2023
2061
deployment_type = "PERSISTENT_2"
2024
2062
per_unit_storage_throughput = 125
@@ -2032,7 +2070,7 @@ resource "aws_fsx_lustre_file_system" "test" {
2032
2070
Name = %[1]q
2033
2071
}
2034
2072
}
2035
- ` , rName , mode , iops ))
2073
+ ` , rName , mode , iops , storageCapacity ))
2036
2074
}
2037
2075
2038
2076
func testAccLustreFileSystemConfig_rootSquash (rName , uid string ) string {
0 commit comments