def METHOD_NAME(
    cfg_element: model.alicloud.AlicloudConfig,
    cfg_factory: model.ConfigFactory,
) ->  typing.Tuple[cfg_mgmt.revert_function, dict, model.NamedModelElement]:
    client = aliyunsdkcore.client.AcsClient(
        ak=cfg_element.access_key_id(),
        secret=cfg_element.access_key_secret(),
    )
    request = CreateAccessKeyRequest()
    try:
        response = client.do_action_with_exception(request)
    except ServerException as e:
        if e.get_http_status() == 403:
            logger.warning(
                'User is not allowed to create a new access key. Please make sure that the '
                'Account is configured to allow users to manage their own keys.'
            )
        raise
    response: CreateAccessKeyResponse = dacite.from_dict(
        data_class=CreateAccessKeyResponse,
        data=json.loads(response),
        config=dacite.Config(check_types=False),
    )
    access_key = response.AccessKey
    raw_cfg = copy.deepcopy(cfg_element.raw)
    new_element = model.alicloud.AlicloudConfig(
        name=cfg_element.name(), raw_dict=raw_cfg, type_name=cfg_element._type_name
    )
    new_element.raw['access_key_id'] = access_key.AccessKeyId
    new_element.raw['access_key_secret'] = access_key.AccessKeySecret
    def revert_function():
        request = DeleteAccessKeyRequest()
        request.set_UserAccessKeyId(access_key.AccessKeyId)
        client.do_action_with_exception(request)
    secret_id = {'accessKeyId': cfg_element.access_key_id()}
    return revert_function, secret_id, new_element