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

相关推荐
闰土小蒋15 分钟前
thinkphp5对接阿里云ocr试卷切题
阿里云·云计算·ocr
虾米神探16 分钟前
unity接入阿里云语音转文字,文字转语音功能
阿里云·云计算
夏尔Gaesar1 小时前
阿里云ubuntu-releases镜像
ubuntu·阿里云·云计算
厚德云3 小时前
OpenAI 最后一代非推理模型:OpenAI 发布 GPT-4.5预览版
人工智能·ai·语言模型·云计算·aigc
佛州小李哥15 小时前
构建逻辑思维链(CoT)为金融AI消除幻觉(保险赔付篇)
人工智能·科技·ai·金融·云计算·aws·亚马逊云科技
心对元&鑫鑫18 小时前
云计算第二周学习问题总结
学习·云计算
csdn56597385018 小时前
1024阿里云活动集锦
阿里云·云计算·1024·云上实操
Elastic 中国社区官方博客18 小时前
Elasticsearch:使用阿里云 AI 服务进行嵌入和重新排名
大数据·数据库·人工智能·elasticsearch·搜索引擎·阿里云·云计算
AWS官方合作商21 小时前
DeepSeek on AWS:解锁高效AI训练与部署的云端密码
人工智能·云计算·aws
山塘小鱼儿2 天前
RAG 阿里云
人工智能·阿里云·云计算