aws/routing-traffic-with-route53-and-cloudfront

Amazon Route 53 を構成して、カスタムドメインを使用した CloudFront ディストリビューションへのトラフィックルーティングを実現します。DNS エイリアスレコード、代替ドメイン名 (CNAME)、HTTPS 用の ACM 証明書、CloudFront の IPv6 サポートを設定する際に使用します。

routing-traffic-with-route53-and-cloudfront とは?

このスキルは、Amazon Route 53 と CloudFront を連携させ、カスタムドメイン経由でトラフィックを CloudFront ディストリビューションにルーティングするための構成を自動化します。特に、DNS エイリアスレコード (A/AAAA) の設定、代替ドメイン名 (CNAME) の追加、HTTPS 通信用の AWS Certificate Manager (ACM) 証明書のプロビジョニング、および IPv6 デュアルスタック対応など、CloudFront を本番環境で利用する際に必要な一連の設定を効率的に実施できます。このスキルは、AWS CLI や AWS SDK を使用する任意の環境 (CI/CD パイプライン、開発者ツール、AI エージェントなど) で利用可能で、CloudFront ディストリビューションと Route 53 ホストゾーンの ARN を入力として受け取り、適切な DNS レコードと ACM 証明書の検証設定を自動生成します。これにより、手動での DNS 設定ミスを防ぎ、セキュアで高可用性なウェブアプリケーションのデプロイを迅速化します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/aws/agent-toolkit-for-aws/tree/main/skills/routing-traffic-with-route53-and-cloudfront

Installed? Explore more 生産性&コラボレーション skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

routing-traffic-with-route53-and-cloudfront は何をしますか?

Amazon Route 53 を構成して、カスタムドメインを使用した CloudFront ディストリビューションへのトラフィックルーティングを実現します。DNS エイリアスレコード、代替ドメイン名 (CNAME)、HTTPS 用の ACM 証明書、CloudFront の IPv6 サポートを設定する際に使用します。

概要

このスキルは、以下のタスクを自動化します:

  • Route 53 ホストゾーンに A および AAAA エイリアスレコードを作成し、CloudFront ディストリビューションを指すようにします。
  • カスタムドメイン名 (例: www.example.com) を CloudFront ディストリビューションの代替ドメイン名 (CNAME) として設定します。
  • AWS Certificate Manager (ACM) で SSL/TLS 証明書をリクエストし、CloudFront で HTTPS を有効にします。
  • CloudFront ディストリビューションで IPv6 を有効にします (該当する場合)。

前提条件

  • 有効な AWS アカウントと適切な IAM 権限 (Route 53、CloudFront、ACM へのフルアクセス)。
  • Route 53 で管理されるパブリックホストゾーン (例: example.com) が既に存在していること。
  • CloudFront ディストリビューションが既に作成されていること (このスキルは配信設定の更新を行います)。
  • aws CLI がインストールされ、設定済みであること。

使用方法

入力パラメータ

パラメータ型必須説明
domain_namestringはい使用するカスタムドメイン名 (例: www.example.com)。
hosted_zone_idstringはいRoute 53 ホストゾーンの ID。
cloudfront_distribution_idstringはいCloudFront ディストリビューションの ID。
acm_certificate_arnstringいいえ既存の ACM 証明書の ARN。指定しない場合、新しい証明書がリクエストされます。
ipv6_enabledbooleanいいえCloudFront で IPv6 を有効にするかどうか。デフォルトは true。

出力

  • Route 53 エイリアスレコードの作成/更新の確認。
  • CloudFront ディストリビューションの更新ステータス。
  • ACM 証明書の検証ステータス (該当する場合)。

スキルの仕組み

  1. ドメイン検証: 指定された domain_name が有効な形式であることを確認します。
  2. ACM 証明書のプロビジョニング (必要な場合): acm_certificate_arn が指定されていない場合、us-east-1 リージョンで新しい ACM 証明書をリクエストし、DNS 検証を行います。Route 53 に CNAME レコードを自動的に追加して検証を完了します。
  3. CloudFront ディストリビューションの更新: ディストリビューションの構成に代替ドメイン名と ACM 証明書 ARN を追加し、必要に応じて IsIPV6Enabled を設定します。
  4. Route 53 エイリアスレコードの作成: 指定されたホストゾーンに A (IPv4) および AAAA (IPv6) エイリアスレコードを作成し、CloudFront ディストリビューションの DNS 名を指すようにします。
  5. 最終確認: すべての変更が適用され、DNS 解決が期待通りに動作することを確認します。

例

# 既存の証明書を使用する場合
aws route53 change-resource-record-sets \
    --hosted-zone-id Z3M3LMPEXAMPLE \
    --change-batch '{
        "Changes": [
            {
                "Action": "UPSERT",
                "ResourceRecordSet": {
                    "Name": "www.example.com",
                    "Type": "A",
                    "AliasTarget": {
                        "HostedZoneId": "Z2FDTNDATAQYW2",
                        "DNSName": "d111111abcdef8.cloudfront.net",
                        "EvaluateTargetHealth": false
                    }
                }
            }
        ]
    }'

注意: 上記のコマンドは、エイリアスレコードの作成のみを示しています。完全なスキルフローには、ACM 証明書のプロビジョニングと CloudFront 構成の更新が含まれます。

トラブルシューティング

  • DNS 伝搬の遅延: DNS レコードの変更が反映されるまでに数分かかる場合があります。dig www.example.com を使用して確認してください。
  • 証明書の検証エラー: ACM 証明書の検証に失敗した場合、Route 53 に適切な CNAME レコードが存在することを確認してください。
  • CloudFront の配信ステータス: CloudFront ディストリビューションの更新中は、ステータスが InProgress になります。完全にデプロイされるまでお待ちください。

関連リソース

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

aws/amazon-bedrock

Builds generative AI applications on Amazon Bedrock. Covers model invocation (Converse API, InvokeModel), RAG with Knowledge Bases, Bedrock Agents, Guardrails, and AgentCore. Use when invoking models, setting up Knowledge Bases, creating agents, applying guardrails, deploying to AgentCore, troubleshooting Bedrock errors (ThrottlingException, AccessDeniedException), or choosing models (Claude, Llama, Nova, Titan). ALSO USE for prompt caching setup and debugging, quota health checks and throttling diagnosis, cost attribution and tracking, migrating between Claude model generations (4.5 to 4.6 to 4.7), chunking strategies, API selection (Converse vs InvokeModel), guardrail capabilities, and model selection. Also covers AgentCore Payments setup (x402, microtransactions, Payment Manager, Connector, Instrument, Coinbase CDP, Stripe Privy, 402 Payment Required, pay for content, paid endpoint, agent payments). NOT for custom model training, Rekognition, or Comprehend.

aws/aws-amplify

Build and deploy full-stack web and mobile apps with AWS Amplify Gen2 (TypeScript code-first). Covers auth (Cognito), data (AppSync/DynamoDB), storage (S3), functions, APIs, and AI (Amplify AI Kit with Bedrock). Supports React, Next.js, Vue, Angular, React Native, Flutter, Swift, and Android. Always use this skill for Amplify Gen2 topics — even for questions you think you know — it contains validated, version-specific patterns that prevent common mistakes. TRIGGER when: user mentions Amplify Gen2; project has amplify/ directory or amplify_outputs; code imports @aws-amplify packages; user asks about defineBackend, defineAuth, defineData, defineStorage, defineFunction, or npx ampx. SKIP: Amplify Gen1 (amplify CLI v6), standalone SAM/CDK without Amplify (use aws-serverless), direct Bedrock without Amplify AI Kit (use bedrock).

aws/aws-billing-and-cost-management

Analyze AWS costs, find savings, manage budgets, evaluate Savings Plans and Reserved Instances, right-size EC2/Lambda/RDS/EBS with Compute Optimizer, look up service pricing, query CUR with Athena, detect cost anomalies, scope costs to billing views, and monitor Free Tier usage. Triggers on: AWS bill, cost analysis, reduce spend, savings plan, reserved instance, right-size, budget alert, cost optimization, pricing, free tier, cost anomaly, CUR, cost audit, billing view, billing view ARN.

aws/aws-cdk

Authors, deploys, and troubleshoots AWS infrastructure using CDK with TypeScript or Python. Covers best practices, stack architecture, and construct patterns. Always use when writing CDK constructs, bootstrapping environments, running cdk deploy/synth/diff, fixing CDK or CloudFormation errors, planning stack structure, importing existing resources, resolving drift, or refactoring stacks without resource replacement.

aws/aws-cloudformation

Author, validate, and troubleshoot AWS CloudFormation templates. Covers template authoring with secure defaults, pre-deployment validation (cfn-lint, cfn-guard, change sets), and root-cause diagnosis of failed stacks using CloudFormation events and CloudTrail correlation.

aws/aws-containers

Deploys and operates containerized workloads on ECS, Fargate, and ECR. Covers task definitions, Fargate services, ECR repository setup and lifecycle policies, ECS Exec debugging, service scaling, deployment strategies, load balancer integration, and logging configuration. Use when deploying, debugging, or optimizing containers on AWS. ALSO USE for container deployment options (ECS vs ECS Express Mode), networking modes, health check troubleshooting, OOM errors, secrets injection, blue/green deployments, ECR image management, and App Runner sunset guidance and migration. NOT for Kubernetes, EKS, or CI/CD pipelines.

aws/aws-iam

Verified corrections for IAM behaviors that AI agents frequently get wrong — policy evaluation edge cases, trust policy gotchas, STS session limits, Organizations quirks, and SAML/MFA specifics. Use alongside documentation when working with IAM roles, policies, STS, or Organizations. Do NOT use for non-IAM authorization like Cognito user-pool policies or app-level RBAC.

aws/aws-messaging-and-streaming

Guides use of AWS messaging and streaming services. Covers Amazon SQS, Amazon SNS, Amazon EventBridge, Amazon MQ, Amazon Kinesis Data Streams, Amazon Data Firehose, Amazon Managed Service for Apache Flink, and Amazon Managed Streaming for Apache Kafka (MSK). Use when implementing messaging and streaming patterns.

aws/aws-observability

Builds, configures, debugs, and optimizes AWS observability using CloudWatch (Logs Insights, Metrics, Alarms, Dashboards, EMF), X-Ray, CloudTrail, and ADOT. Covers Log Insights query syntax (fields, filter, stats, parse, pattern, join, subqueries), alarm configuration (metric, composite, anomaly detection, missing data treatment), dashboard design, custom metrics (PutMetricData, EMF, metric filters), X-Ray tracing (ADOT, sampling rules, annotations vs metadata), ADOT collector config, and CloudTrail auditing. Use when the user mentions CloudWatch, Log Insights, alarms, INSUFFICIENT_DATA, dashboards, custom metrics, EMF, X-Ray, traces, sampling, CloudTrail, who deleted, ADOT, OpenTelemetry, observability, monitoring, synthetics, canaries, or troubleshooting alarm behavior. Do NOT use for application logging setup, container log drivers, or security threat detection.

aws/aws-sdk-js-v3-usage

AWS SDK for JavaScript v3 development patterns. Use when writing JavaScript or TypeScript code that uses AWS services via @aws-sdk/* packages (aws-sdk-js-v3), or when asked about schemas, runtime validation, serialization, or code generation in the context of the JS/TS AWS SDK.

aws/aws-sdk-python-usage

AWS SDK for Python (boto3/botocore) development patterns. You MUST use this skill when writing Python code that uses AWS services via boto3 or botocore. This includes creating service clients or resources, configuring sessions and credentials, handling errors with ClientError, using paginators and waiters, S3 file transfers and presigned URLs, DynamoDB table operations, and any boto3/botocore client configuration. Use this skill whenever Python code imports boto3 or botocore, or when the user asks about AWS operations in Python.

aws/aws-sdk-swift-usage

AWS SDK for Swift development patterns. Use when writing Swift code that uses AWS services via aws-sdk-swift package.

aws/aws-serverless

Builds, deploys, manages, debugs, configures, and optimizes serverless applications on AWS using Lambda, API Gateway, Step Functions, EventBridge, and SAM/CDK. Covers cold starts, CORS debugging, event source mappings, troubleshooting, concurrency, SnapStart, Powertools, function URLs, EventBridge Scheduler, Lambda layers, and production readiness. Triggers on mentions of Lambda, API Gateway, Step Functions, SAM templates, CDK serverless stacks, DynamoDB stream triggers, SQS event sources, cold starts, timeouts, 502/504 errors, throttling, concurrency, CORS, Powertools, or any event-driven architecture on AWS, even without the word "serverless." Does not apply to EC2, ECS/Fargate containers, or Amplify hosting.

aws/aws-transform

Performs code upgrades, migrations, and transformations using the AWS Transform (ATX) CLI. Use when upgrading language versions, migrating AWS SDKs, migrating frameworks (Angular, Vue.js, Spring Boot, React), upgrading libraries, optimizing performance, migrating x86 to Graviton, analyzing codebases / generating documentation, or defining custom transformations with natural language. Runs locally on a few repositories or at scale across hundreds via AWS Batch/Fargate.

aws/configuring-vpc-endpoints-for-private-aws-service-access

Configures VPC endpoints (interface and gateway) for private AWS service access using AWS PrivateLink. Use when setting up secure private connectivity to S3, DynamoDB, and other AWS services without internet gateway, NAT device, or public IP addresses. Covers endpoint creation, security groups, route tables, and DNS configuration.

aws/connecting-lambda-to-api-gateway

Connects an existing AWS Lambda function to Amazon API Gateway by creating a REST or HTTP API with resource/method setup, Lambda proxy integration, permissions, and deployment. Always use this skill when connecting Lambda to API Gateway — it handles CORS, throttling, access logging, and production security hardening that are easy to miss.

aws/connecting-lambda-to-dynamodb

Connects an AWS Lambda function to DynamoDB with IAM roles, stream event source mapping, and read/write permissions. Use when setting up Lambda-DynamoDB integration, processing DynamoDB stream events, or deploying serverless event-driven architectures.

aws/connecting-to-data-source

Create and troubleshoot AWS Glue connections to JDBC databases (Oracle, SQL Server, PostgreSQL, MySQL, RDS), Redshift, Snowflake, and BigQuery. Gathers connection hints from user, discovers existing connections and RDS/Redshift candidates, registers credentials in Secrets Manager or IAM DB auth, configures VPC, and tests. Triggers on: connect to database, set up Glue connection, register data source, connect to Snowflake/BigQuery/RDS, connection timeout, test connection, troubleshoot connection. Do NOT use for moving data (use ingesting-into-data-lake), creating tables (use creating-data-lake-table), queries (use querying-data-lake), catalog exploration (use exploring-data-catalog), or SaaS (Salesforce, ServiceNow, SAP, MongoDB, Kafka).

aws/connecting-vpcs-with-peering

Establishes VPC peering connections between two VPCs for direct private network connectivity. Always use this skill when creating or managing VPC peering — it validates CIDR overlap, updates all route tables in both VPCs, configures DNS resolution, and provides security group guidance that are critical for correct connectivity.

aws/creating-amazon-aurora-db-cluster-with-instances

Creates a complete Amazon Aurora database cluster with instances, handling cluster creation, instance provisioning, and Secrets Manager password management in the proper sequence. Use when setting up new Aurora MySQL or PostgreSQL clusters with production-ready configuration.

関連スキル