AWS(Amazon Web Services)は世界シェアNo.1のクラウドプラットフォームです。2026年現在、エンジニアとしてAWSスキルは必須といっても過言ではありません。本記事では完全な初心者向けに、AWSの基礎から主要サービスの使い方まで解説します。
AWSとは?クラウドコンピューティングの基礎
AWSはAmazonが提供するクラウドコンピューティングサービスです。サーバー、ストレージ、データベース、AIなど200以上のサービスを従量課金で利用できます。
AWSの主要サービス一覧(2026年版)
コンピューティング
- EC2:仮想サーバー。t3.micro(無料枠)から大型インスタンスまで
- Lambda:サーバーレス関数実行。コードを書くだけで実行環境不要
- ECS/EKS:Docker/Kubernetesのマネージドサービス
- App Runner:コンテナアプリの超簡単デプロイ
ストレージ
- S3:オブジェクトストレージ。静的ファイル、バックアップ、画像配信
- EBS:EC2用ブロックストレージ
- EFS:複数EC2で共有できるNFS
データベース
- RDS:マネージドDB(MySQL、PostgreSQL、Aurora)
- DynamoDB:NoSQL。高速・低コスト・スケーラブル
- ElastiCache:Redis/Memcachedのマネージドキャッシュ
ネットワーキング
- VPC:仮想プライベートクラウド。ネットワーク分離
- CloudFront:CDN。静的コンテンツの高速配信
- Route 53:DNS管理
- ALB/NLB:ロードバランサー
AWS CLI セットアップ
# AWS CLIインストール(Mac)
brew install awscli
# 認証情報の設定
aws configure
# AWS Access Key ID: xxxxx
# AWS Secret Access Key: xxxxx
# Default region name: ap-northeast-1
# Default output format: json
# 設定確認
aws sts get-caller-identity
S3バケットの作成とファイル操作
# バケット作成
aws s3 mb s3://my-unique-bucket-name-2026 --region ap-northeast-1
# ファイルアップロード
aws s3 cp ./file.txt s3://my-bucket/file.txt
# ディレクトリ同期(静的サイトのデプロイなどに便利)
aws s3 sync ./dist s3://my-bucket/ --delete
# ファイル一覧
aws s3 ls s3://my-bucket/
# パブリックアクセス設定(静的サイトホスティング)
aws s3 website s3://my-bucket --index-document index.html --error-document 404.html
EC2インスタンスの起動(AWS CLI)
# 最新のAmazon Linux 2023 AMI IDを取得
aws ssm get-parameter \
--name /aws/service/ami-amazon-linux-latest/al2023-ami-kernel-default-x86_64 \
--query Parameter.Value --output text
# EC2インスタンス起動
aws ec2 run-instances \
--image-id ami-0123456789abcdef \
--instance-type t3.micro \
--key-name my-keypair \
--security-group-ids sg-xxxxxx \
--subnet-id subnet-xxxxxx \
--tag-specifications "ResourceType=instance,Tags=[{Key=Name,Value=MyServer}]"
# インスタンス一覧
aws ec2 describe-instances --output table
AWS Lambda:サーバーレス関数
import json
import boto3
def handler(event, context):
"""S3に画像がアップロードされた際に呼び出されるLambda"""
s3 = boto3.client("s3")
# イベントからS3情報を取得
bucket = event["Records"][0]["s3"]["bucket"]["name"]
key = event["Records"][0]["s3"]["object"]["key"]
print(f"処理開始: s3://{bucket}/{key}")
# 画像リサイズ処理(PIL使用)
# ...
return {
"statusCode": 200,
"body": json.dumps({"message": "処理完了", "key": key})
}
Infrastructure as Code:Terraformでインフラ管理
# main.tf
provider "aws" {
region = "ap-northeast-1"
}
# S3バケット
resource "aws_s3_bucket" "static_site" {
bucket = "my-static-site-2026"
}
# CloudFrontディストリビューション
resource "aws_cloudfront_distribution" "cdn" {
origin {
domain_name = aws_s3_bucket.static_site.bucket_regional_domain_name
origin_id = "S3-static-site"
}
enabled = true
default_root_object = "index.html"
default_cache_behavior {
target_origin_id = "S3-static-site"
viewer_protocol_policy = "redirect-to-https"
allowed_methods = ["GET", "HEAD"]
cached_methods = ["GET", "HEAD"]
}
restrictions {
geo_restriction { restriction_type = "none" }
}
viewer_certificate {
cloudfront_default_certificate = true
}
}
AWSコスト最適化のベストプラクティス
- ✅ 無料利用枠を活用:12ヶ月間、EC2 t2.micro 750時間/月など
- ✅ リザーブドインスタンス:1年・3年契約で最大75%割引
- ✅ スポットインスタンス:中断可能な処理に最大90%割引
- ✅ AWS Cost Explorer:毎週コストを確認して異常を検知
- ✅ S3ライフサイクル:古いデータを低コストストレージに自動移行
AWS認定資格:キャリアアップへの近道
- AWS Cloud Practitioner(CLF-C02):入門。合格率高め
- AWS Solutions Architect Associate(SAA-C03):最も人気。転職に有利
- AWS Developer Associate(DVA-C02):開発者向け
- AWS SysOps Administrator:運用管理者向け
AWSを習得することで、フリーランスエンジニアとして月単価80〜120万円の案件獲得も現実的です。まずはAWS無料枠を使って実際に手を動かしてみましょう。