1
0
Fork 0
mirror of https://github.com/nickpoida/og-aws.git synced 2025-03-09 15:40:06 +00:00

Update ru.md

This commit is contained in:
Nikolay Poida 2020-03-11 15:10:10 +06:00 committed by GitHub
parent 8188b837b2
commit 84aa7c143e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1542,35 +1542,35 @@ Lambda
- [Serverless](https://github.com/serverless/serverless) - один из наиболее популярных фреймворков для создания бессерверных приложений используя AWS Lambda или другой вариант бессерверных вычислений and other serverless compute options.
- [Другие полезные фреймворки.](https://github.com/anaibol/awesome-serverless#frameworks)
### Lambda Alternatives and Lock-in
### Альтернативы Lambda и привязки
- 🚪Other clouds offer similar services with different names, including [Google Cloud Functions](https://cloud.google.com/functions/), [Azure Functions](https://azure.microsoft.com/en-us/services/functions/), and [IBM OpenWhisk](http://www.ibm.com/cloud-computing/bluemix/openwhisk/). Also if your are running Kubernetes another Lambda alternative is [OpenFaaS](https://github.com/openfaas/faas)
- 🚪Другие облачные провайдеры также предоставляют подобные сервисы под разными именами, включая [Google Cloud Functions](https://cloud.google.com/functions/), [Azure Functions](https://azure.microsoft.com/en-us/services/functions/), и [IBM OpenWhisk](http://www.ibm.com/cloud-computing/bluemix/openwhisk/). Также, если вы используете Kubernetes, другой альтернативой Lambda является [OpenFaaS] (https://github.com/openfaas/faas)
### Lambda Gotchas and Limitations
### Ошибки и ограничения, связанные с Lambda
- 🔸Testing Lambdas, locally and remotely, can be a challenge. Several tools are available to make this easier, including the officially supported [SAM Local](https://github.com/awslabs/aws-sam-local).
- 🔸Managing lots of Lambda functions is a workflow challenge, and tooling to manage Lambda deployments is still immature.
- 🔸AWS official workflow around managing function [versioning and aliases](https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html) is painful. One option is to avoid Lambda versioning by abstracting your deployment workflow outside of Lambda. One way this can be accomplished is by deploying your application in successive stages, with a distinct AWS account per stage, where each account only needs to be aware of the latest version, and rollbacks and updates are handled by external tooling.
- 🔸As of Oct 2017, the minimum charge for a Lambda invocation is 100ms, so there is no cost-benefit to reducing your run time below that.
- 🔸While adding/removing S3 buckets as triggers for Lambda function, this error may occur: "There was an error creating the trigger: Configuration is ambiguously defined. Cannot have overlapping suffixes in two rules if the prefixes are overlapping for the same event type." In this case, you can manually remove the Lambda event in the "Events" tab in the "Properties" section of the S3 bucket.
- 🔸Managing the size of your deployment artifact can be a challenge, especially if using Java. Options to mitigate this include [proguard](https://www.guardsquare.com/en/proguard) and loading dependencies at runtime into /tmp.
- When using DynamoDB as a trigger for your Lambda functions, this error may occur: "PROBLEM: internal Lambda error. Please contact Lambda customer support." This usually just means that Lambda can't detect anything in the DynamoDB stream within the last 48 hours. If the issue persists, deleting and recreating your trigger may help.
- 🔸If your lambda needs access to resources in a VPC (for example ElastiCache or RDS), it will need to be deployed within it. This will increase cold-start times as an Elastic Network Interface (ENI) will have to be registered within the VPC for each concurrent function. AWS also has a relatively low initial limit (350) on the number ENI's that can be created within an VPC, however this can be increased to the 1000s if a good case is made to AWS support.
- 🔸 Lambda has several [**resource limits**](http://docs.aws.amazon.com/lambda/latest/dg/limits.html) as of 2017-06:
- A **6MB** request or response payload size.
- A **50 MB** limit on the compressed .zip/.jar file deployment package size.
- A **250 MB** limit on the code/dependencies in the package before compression.
- A **500 MB** limit on local storage in /tmp.
- 🔸Тестирование Lambda-функций, как локально, так и удаленно, может быть сложным. Для облегчения этой задачи доступно несколько инструментов, включая официально поддерживаемый [SAM Local](https://github.com/awslabs/aws-sam-local).
- 🔸Управление большим количеством функций Lambda - это сложный рабочий процесс, а инструменты для управления развертываниями Lambda все еще не совершенны.
- 🔸Официальный рабочий процесс AWS относительно управления функцией [версионности и псевднонимов](https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html) полон боли. Один из вариантов - избежать создания версий Lambda, абстрагируя рабочий процесс развертывания от Lambda. Одним из способов достижения этого является развертывание приложения на последовательных этапах, с отдельной учетной записью AWS для каждого этапа, где каждая учетная запись должна знать только о последней версии, а откаты и обновления обрабатываются с помощью внешних инструментов.
- 🔸По состоянию на октябрь 2017 год, минимальная плата взымается за вызов Lambda за 100 миллисекунд, так что уменьшение срока запуска ниже этого времени ни принесет никаких преимуществ.
- 🔸При добавлении/удалении S3 бакетов в качестве триггеров для Lambda-функции может возникнуть эта ошибка: "There was an error creating the trigger: Configuration is ambiguously defined. Cannot have overlapping suffixes in two rules if the prefixes are overlapping for the same event type." В этом случае вы можете вручную удалить событие Lambda на вкладке "Events" в разделе "Properties" S3 бакета.
- 🔸Управление размером артефактов развертывания может быть проблемой, особенно при использовании Java. Вариантом смягчения этой проблемы является включение [proguard](https://www.guardsquare.com/en/proguard) и загрузка зависимостей в среду выполнения в /tmp.
- Когда вы используете DynamoDB, как триггер для вашей Lambda-функции, может возникнуть следующая ошибка: "PROBLEM: internal Lambda error. Please contact Lambda customer support." Обычно это просто означает, что Lambda не может обнаружить что-либо в потоке DynamoDB за последние 48 часов. Если проблема не устранена, удаление и повторное создание триггера может помочь.
- 🔸Если вашей Lambda-функции нужен доступ к ресурсам в VPC (например, ElastiCache или RDS), ее необходимо будет развернуть в нем. Это повышает время холодного старта, так как Эластичный сетевой интерфейс(Elastic Network Interface (ENI)) должен быть зарегистрирован в VPC для каждой конкурентной функции. AWS также имеет относительно низкий начальный предел (350) для числа ENI, которые могут быть созданы в VPC, однако его можно увеличить до 1000, если для поддержки AWS будет подготовлено хорошее обоснование.
- 🔸 Lambda также имеет несколько [**ресурсных ограничений(resource limits)**](http://docs.aws.amazon.com/lambda/latest/dg/limits.html) по состоянию на июнь 2017 года:
- **6MB** - размер полезной нагрузки запроса или ответа.
- **50 MB** - ограничение на размер сжатого .zip/.jar файла пакета развертывания.
- **250 MB** - ограничение на размер кода/зависимостей в пакете до сжатия.
- **500 MB** - ограничение локального хранилища в /tmp.
### Lambda Code Samples
### Примеры Lambda-кода
- [Fan-out](https://github.com/awslabs/aws-lambda-fanout) is an example of using Lambda to “fan-out” or copy data from one service, in this case Kinesis, to multiple other AWS data services. Destinations for fan-out data in the sample include IoT, SQS and more.
- This [AWS limit monitor using Lambdas](https://github.com/awslabs/aws-limit-monitor) shows use of multiple Lambdas for monitoring.
- This [Lambda ECS Worker Pattern](https://github.com/awslabs/lambda-ecs-worker-pattern) shows use of Lambda in a workflow where data from S3 is picked up by the Lambda, pushed to a queue, then sent to ECS for more processing.
- The [Secure Pet Store](https://github.com/awslabs/api-gateway-secure-pet-store) is a sample Java application which uses Lambda and API Gateway with Cognito (for user identity).
- [aws-lambda-list](https://github.com/unixorn/aws-lambda-list) is a list of "hopefully useful AWS lambdas and lambda-related resources". Quite a few code samples here; as usual, not guaranteed tested. Caveat Emptor.
- [Fan-out](https://github.com/awslabs/aws-lambda-fanout) Пример использования Lambda для “разветвления” или копирования данных из одной службы, в данном случае Kinesis, в несколько других служб данных AWS. Направлениями для разветвления данных в этом примере включают IoT, SQS и прочие.
- Этот [AWS limit monitor using Lambdas](https://github.com/awslabs/aws-limit-monitor) показывает использование нескольких Lambda-функций для мониторинга.
- Этот [Lambda ECS Worker Pattern](https://github.com/awslabs/lambda-ecs-worker-pattern) показывает использования Lambda в рабочем процессе, где данные берутся из S3 Lambda-функцией, отправляются в очередь, а затем передаются в ECS для дальнейшей обработки.
- [Secure Pet Store](https://github.com/awslabs/api-gateway-secure-pet-store) простое приложение на Java, которое использует Lambda и API Gateway с Cognito (для аутентификации пользователей).
- [aws-lambda-list](https://github.com/unixorn/aws-lambda-list) - список "надеюсь полезных AWS Lambda-функций и ресурсов о Lambda". Довольно таки много примеров кода; как обычно, никто не гарантирует, что код тестирован. Будьте бдительны.
🚧 [*Please help expand this incomplete section.*](CONTRIBUTING.md)
🚧 [*Пожалуйста помогите дополнить этот неполный раздел.*](CONTRIBUTING.md)
API Gateway
-----------