Skip to content

Ministack: Free, open-source local AWS emulator - 60+ services, Terraform compatible, real databases. Free forever. MIT licensed.

fix(cfn): remove extra provisioners in git merge (#1635)

Nahuel Nucera81a1a8cf937a
diff --git a/ministack/services/cloudformation/provisioners.py b/ministack/services/cloudformation/provisioners.py
index 705f069f..41496582 100644
--- a/ministack/services/cloudformation/provisioners.py
+++ b/ministack/services/cloudformation/provisioners.py
@@ -7933,103 +7933,6 @@ def _cognito_identity_pool_principal_tag_delete(physical_id, props):
# the engine now deletes in its cleanup phase.
# ---------------------------------------------------------------------------
-def _cognito_user_pool_update(physical_id, old_props, new_props, stack_name):
- pool = _cognito._user_pools.get(physical_id)
- if pool is None:
- return _cognito_user_pool_create(physical_id, new_props, stack_name)
- if "PoolName" in new_props:
- pool["Name"] = new_props["PoolName"]
- for prop, key in (("Policies", "Policies"),
- ("AutoVerifiedAttributes", "AutoVerifiedAttributes"),
- ("AliasAttributes", "AliasAttributes"),
- ("UsernameAttributes", "UsernameAttributes"),
- ("MfaConfiguration", "MfaConfiguration"),
- ("UserPoolTags", "UserPoolTags"),
- ("AdminCreateUserConfig", "AdminCreateUserConfig"),
- ("LambdaConfig", "LambdaConfig")):
- if prop in new_props:
- pool[key] = new_props[prop]
- if "SOFTWARE_TOKEN_MFA" in (new_props.get("EnabledMfas") or []):
- pool["SoftwareTokenMfaConfiguration"] = {"Enabled": True}
- elif "EnabledMfas" in new_props:
- pool.pop("SoftwareTokenMfaConfiguration", None)
- pool["LastModifiedDate"] = _cognito._now_epoch()
- provider_name = f"cognito-idp.{get_region()}.amazonaws.com/{physical_id}"
- return physical_id, {"Arn": pool["Arn"], "ProviderName": provider_name}
-
-
-def _cognito_user_pool_client_update(physical_id, old_props, new_props, stack_name):
- pid = new_props.get("UserPoolId", old_props.get("UserPoolId", ""))
- pool = _cognito._user_pools.get(pid)
- client = (pool or {}).get("_clients", {}).get(physical_id)
- if client is None:
- return _cognito_user_pool_client_create(physical_id, new_props, stack_name)
- for prop, key in (("ClientName", "ClientName"),
- ("ExplicitAuthFlows", "ExplicitAuthFlows"),
- ("AllowedOAuthFlows", "AllowedOAuthFlows"),
- ("AllowedOAuthScopes", "AllowedOAuthScopes"),
- ("CallbackURLs", "CallbackURLs"),
- ("LogoutURLs", "LogoutURLs"),
- ("SupportedIdentityProviders", "SupportedIdentityProviders")):
- if prop in new_props:
- client[key] = new_props[prop]
- client["LastModifiedDate"] = _cognito._now_epoch()
- return physical_id, {}
-
-
-def _cognito_identity_pool_update(physical_id, old_props, new_props, stack_name):
- pool = _cognito._identity_pools.get(physical_id)
- if pool is None:
- return _cognito_identity_pool_create(physical_id, new_props, stack_name)
- for prop in ("IdentityPoolName", "AllowUnauthenticatedIdentities",
- "AllowClassicFlow", "SupportedLoginProviders",
- "DeveloperProviderName", "OpenIdConnectProviderARNs",
- "CognitoIdentityProviders", "SamlProviderARNs",
- "IdentityPoolTags"):
- if prop in new_props:
- pool[prop] = new_props[prop]
- return physical_id, {}
-
-
-def _cognito_user_pool_group_update(physical_id, old_props, new_props, stack_name):
- pid = new_props.get("UserPoolId", old_props.get("UserPoolId", ""))
- pool = _cognito._user_pools.get(pid)
- group = (pool or {}).get("_groups", {}).get(physical_id)
- new_name = new_props.get("GroupName") or physical_id
- if group is None or new_name != physical_id:
- # Name change is a replacement; the engine deletes the old group.
- return _cognito_user_pool_group_create(physical_id, new_props, stack_name)
- for prop in ("Description", "RoleArn", "Precedence"):
- if prop in new_props:
- group[prop] = new_props[prop]
- group["LastModifiedDate"] = _cognito._now_epoch()
- return physical_id, {}
-
-
-def _sm_secret_update(physical_id, old_props, new_props, stack_name):
- secret = _sm._secrets.get(physical_id)
- new_name = new_props.get("Name") or _physical_name(stack_name, physical_id)
- if secret is None or (old_props.get("Name") or physical_id) != new_name and "Name" in new_props:
- # Name is create-only: replacement, predecessor cleaned by the engine.
- return _sm_secret_create(physical_id, new_props, stack_name)
- for prop in ("Description", "KmsKeyId"):
- if prop in new_props:
- secret[prop] = new_props[prop]
- if "Tags" in new_props:
- secret["Tags"] = new_props["Tags"]
- if "SecretString" in new_props and new_props["SecretString"] != old_props.get("SecretString"):
- # A changed value becomes the new AWSCURRENT version; history is kept.
- import time as _time
- for version in secret.get("Versions", {}).values():
- version["Stages"] = [s for s in version.get("Stages", []) if s != "AWSCURRENT"]
- secret["Versions"][new_uuid()] = {
- "SecretString": new_props["SecretString"],
- "SecretBinary": None,
- "CreatedDate": int(_time.time()),
- "Stages": ["AWSCURRENT"],
- }
- secret["LastChangedDate"] = int(_time.time())
- return physical_id, {"Arn": secret["ARN"]}
def _kinesis_stream_update(physical_id, old_props, new_props, stack_name):