@@ -209,6 +209,52 @@ func TestAccCognitoIDPManagedLoginBranding_updateFromBasic(t *testing.T) {
209
209
})
210
210
}
211
211
212
+ func TestAccCognitoIDPManagedLoginBranding_updateToBasic (t * testing.T ) {
213
+ ctx := acctest .Context (t )
214
+ var v awstypes.ManagedLoginBrandingType
215
+ rName := sdkacctest .RandomWithPrefix (acctest .ResourcePrefix )
216
+ resourceName := "aws_cognito_managed_login_branding.test"
217
+
218
+ resource .ParallelTest (t , resource.TestCase {
219
+ PreCheck : func () { acctest .PreCheck (ctx , t ); testAccPreCheckIdentityProvider (ctx , t ) },
220
+ ErrorCheck : acctest .ErrorCheck (t , names .CognitoIDPServiceID ),
221
+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories ,
222
+ CheckDestroy : testAccCheckManagedLoginBrandingDestroy (ctx ),
223
+ Steps : []resource.TestStep {
224
+ {
225
+ Config : testAccManagedLoginBrandingConfig_settings (rName ),
226
+ Check : resource .ComposeAggregateTestCheckFunc (
227
+ testAccCheckManagedLoginBrandingExists (ctx , resourceName , & v ),
228
+ ),
229
+ ConfigPlanChecks : resource.ConfigPlanChecks {
230
+ PreApply : []plancheck.PlanCheck {
231
+ plancheck .ExpectResourceAction (resourceName , plancheck .ResourceActionCreate ),
232
+ },
233
+ },
234
+ ConfigStateChecks : []statecheck.StateCheck {
235
+ statecheck .ExpectKnownValue (resourceName , tfjsonpath .New ("settings" ), knownvalue .NotNull ()),
236
+ statecheck .ExpectKnownValue (resourceName , tfjsonpath .New ("use_cognito_provided_values" ), knownvalue .Bool (false )),
237
+ },
238
+ },
239
+ {
240
+ Config : testAccManagedLoginBrandingConfig_basic (rName ),
241
+ Check : resource .ComposeAggregateTestCheckFunc (
242
+ testAccCheckManagedLoginBrandingExists (ctx , resourceName , & v ),
243
+ ),
244
+ ConfigPlanChecks : resource.ConfigPlanChecks {
245
+ PreApply : []plancheck.PlanCheck {
246
+ plancheck .ExpectResourceAction (resourceName , plancheck .ResourceActionUpdate ),
247
+ },
248
+ },
249
+ ConfigStateChecks : []statecheck.StateCheck {
250
+ statecheck .ExpectKnownValue (resourceName , tfjsonpath .New ("settings" ), knownvalue .Null ()),
251
+ statecheck .ExpectKnownValue (resourceName , tfjsonpath .New ("use_cognito_provided_values" ), knownvalue .Bool (true )),
252
+ },
253
+ },
254
+ },
255
+ })
256
+ }
257
+
212
258
func testAccCheckManagedLoginBrandingDestroy (ctx context.Context ) resource.TestCheckFunc {
213
259
return func (s * terraform.State ) error {
214
260
conn := acctest .Provider .Meta ().(* conns.AWSClient ).CognitoIDPClient (ctx )
0 commit comments