

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 建置 AWS 基礎設施
<a name="building-infrastructure"></a>

您可以使用許多 AWS 服務 來建置 Web 爬蟲基礎設施。本指南的[架構](architecture.md)區段包含一個提議的解決方案。建議您考慮使用下列項目 AWS 服務 來建置 Web 爬蟲程式的支援基礎設施：
+ 使用 Amazon Virtual Private Cloud (Amazon VPC) 建立 [VPC](https://docs.aws.amazon.com/vpc/latest/userguide/configure-your-vpc.html) [和子網路](https://docs.aws.amazon.com/vpc/latest/userguide/configure-subnets.html)。
+ 使用 [Amazon EventBridge 排程器](https://docs.aws.amazon.com/eventbridge/latest/userguide/using-eventbridge-scheduler.html)啟動爬取程序。
+ 使用 AWS Batch [任務](https://docs.aws.amazon.com/batch/latest/userguide/jobs.html)和任務[佇列來管理 Web 爬蟲程式任務](https://docs.aws.amazon.com/batch/latest/userguide/job_queues.html)。
+ 使用下列其中一個解決方案來執行 Web 爬蟲程式任務：
  + 上的 Amazon Elastic Container Service (Amazon ECS) 容器 [AWS Fargate](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html)
  + Amazon Elastic Compute Cloud (Amazon EC2) [執行個體](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Instances.html)
**注意**  
如果您的應用程式可以處理中斷，請考慮透過 Spot Fleet 使用 Amazon EC2 [Spot 執行個體](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances.html)。 [https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/work-with-spot-fleets.html](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/work-with-spot-fleets.html)Spot 執行個體機群可協助您大幅節省運算成本。
  + AWS Lambda [函數](https://docs.aws.amazon.com/lambda/latest/dg/lambda-functions.html)
+ 將擷取的資料和原始檔案存放在 Amazon Simple Storage Service (Amazon S3) 儲存[貯](https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-buckets-s3.html)體中。