AWS中使用CloudFront分发API Gateway

首先需要准备一个Lambda function(Lambda->Functions)

还要准备一个证书,要覆盖子域名(AWS Certificate Manager->Certificates)。

1、API Gateway->Create API->REST API->Build->API endpoint type( Edge-optimized )->Create API

2、Resources->Create method->Method type(GET)->Integration type(Lambda function)->

Create method

3、Resources->/->GET(/ - GET - Method execution)->Test->结果正确否

4、Resources->Deploy API->Stage(*New Stage*)->Stage name(prod)

5、Stages->prod->/->GET->Invoke URL(https://xxxxxxxx.execute-api.us-east-1.amazonaws.com/prod/),复制地址能访问否

至此,API Gateway已创建完毕

6、CloudFront->Distributions->Create distribution->Origin domain(你的API Gateway)->Origin path - optional(/prod)-> Viewer protocol policy(HTTPS only)->Web Application Firewall (WAF)(Do not enable security protections)->Price class(Use only North America and Europe)->Alternate domain name (CNAME) - optional-> Add item(abc.yourdomain.com)->Custom SSL certificate *- optional->*Create distribution

7、CloudFront->Distributions->Domain name(xxxxxx.cloudfront.net)->复制备用

8、Route 53->Hosted zones->yourdomain.com->Create record->Record name(abc)->Record type(CNAME)->Value(复制备用的xxxxxx.cloudfront.net)->Create records

9、访问abc.yourdomain.com

10、nslookup abc.yourdomain.com

相关推荐
科技云报道5 小时前
AI+云计算互融共生,2025AI云产业发展大会即将举行
人工智能·云计算
AWS官方合作商6 小时前
突破性价比壁垒!AWS Graviton2驱动的C6g实例,为计算密集型工作负载注入“核”动力
云计算·aws
AWS官方合作商6 小时前
HPC性能新纪元!AWS Hpc7g实例: Graviton3E芯片开启200Gbps超算之旅
云计算·aws
竹君子6 小时前
研发管理知识库(13)阿里云的DevOps工具介绍
阿里云·云计算·devops
小毅&Nora7 小时前
【云计算】【Kubernetes】 ① K8S的架构、应用及源码解析 - 核心架构与组件全景图
架构·kubernetes·云计算
suki_lynn9 小时前
Facebook 引流脚本:功能、风险与合规使用指南
android·云计算
wanhengidc10 小时前
云手机是真实手机吗
运维·服务器·游戏·智能手机·云计算
wanhengidc10 小时前
云手机 服务器网络安全
运维·服务器·安全·web安全·智能手机·云计算
wanhengidc12 小时前
云手机的核心价值
运维·游戏·智能手机·云计算
Lynnxiaowen12 小时前
今天我们开始学习ansible之playbook的简单运用
linux·运维·学习·云计算·ansible