@@ -163,6 +163,52 @@ func TestAccCognitoIDPManagedLoginBranding_settings(t *testing.T) {
163
163
})
164
164
}
165
165
166
+ func TestAccCognitoIDPManagedLoginBranding_updateFromBasic (t * testing.T ) {
167
+ ctx := acctest .Context (t )
168
+ var v awstypes.ManagedLoginBrandingType
169
+ rName := sdkacctest .RandomWithPrefix (acctest .ResourcePrefix )
170
+ resourceName := "aws_cognito_managed_login_branding.test"
171
+
172
+ resource .ParallelTest (t , resource.TestCase {
173
+ PreCheck : func () { acctest .PreCheck (ctx , t ); testAccPreCheckIdentityProvider (ctx , t ) },
174
+ ErrorCheck : acctest .ErrorCheck (t , names .CognitoIDPServiceID ),
175
+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories ,
176
+ CheckDestroy : testAccCheckManagedLoginBrandingDestroy (ctx ),
177
+ Steps : []resource.TestStep {
178
+ {
179
+ Config : testAccManagedLoginBrandingConfig_basic (rName ),
180
+ Check : resource .ComposeAggregateTestCheckFunc (
181
+ testAccCheckManagedLoginBrandingExists (ctx , resourceName , & v ),
182
+ ),
183
+ ConfigPlanChecks : resource.ConfigPlanChecks {
184
+ PreApply : []plancheck.PlanCheck {
185
+ plancheck .ExpectResourceAction (resourceName , plancheck .ResourceActionCreate ),
186
+ },
187
+ },
188
+ ConfigStateChecks : []statecheck.StateCheck {
189
+ statecheck .ExpectKnownValue (resourceName , tfjsonpath .New ("settings" ), knownvalue .Null ()),
190
+ statecheck .ExpectKnownValue (resourceName , tfjsonpath .New ("use_cognito_provided_values" ), knownvalue .Bool (true )),
191
+ },
192
+ },
193
+ {
194
+ Config : testAccManagedLoginBrandingConfig_settings (rName ),
195
+ Check : resource .ComposeAggregateTestCheckFunc (
196
+ testAccCheckManagedLoginBrandingExists (ctx , resourceName , & v ),
197
+ ),
198
+ ConfigPlanChecks : resource.ConfigPlanChecks {
199
+ PreApply : []plancheck.PlanCheck {
200
+ plancheck .ExpectResourceAction (resourceName , plancheck .ResourceActionUpdate ),
201
+ },
202
+ },
203
+ ConfigStateChecks : []statecheck.StateCheck {
204
+ statecheck .ExpectKnownValue (resourceName , tfjsonpath .New ("settings" ), knownvalue .NotNull ()),
205
+ statecheck .ExpectKnownValue (resourceName , tfjsonpath .New ("use_cognito_provided_values" ), knownvalue .Bool (false )),
206
+ },
207
+ },
208
+ },
209
+ })
210
+ }
211
+
166
212
func testAccCheckManagedLoginBrandingDestroy (ctx context.Context ) resource.TestCheckFunc {
167
213
return func (s * terraform.State ) error {
168
214
conn := acctest .Provider .Meta ().(* conns.AWSClient ).CognitoIDPClient (ctx )
0 commit comments