标签:域名解析 http line 构建 静态网页 gevent led site eve
一、架构图很简单,写个表名,写个主键即可,其他默认。
Table name:posts
Primary key:id
我们创建两个 S3 存储桶,一个用来存放静态网页,一个用来存放语音合成的音频。
{
"Version": "2012-10-17",
"Id": "Policy1562738599054",
"Statement": [
{
"Sid": "Stmt1562738571491",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::wz-pollywebsite/*"
}
]
}
从架构图得知,我们的 Lambda 函数和多个组件进行交互,需要有相关的权限才行,我们通过 IAM 为其创建一个 Role。
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"s3:PutObject",
"polly:SynthesizeSpeech",
"logs:CreateLogStream",
"sns:Publish",
"dynamodb:PutItem",
"dynamodb:Scan",
"dynamodb:Query",
"dynamodb:UpdateItem",
"s3:GetBucketLocation",
"logs:CreateLogGroup",
"logs:PutLogEvents",
"s3:PutObjectAcl"
],
"Resource": "*"
}
]
}
wz_GetPosts
函数,添加 URL Query String Parameters;{
"postId" : "$input.params(‘postId‘)"
}
wz_GetPosts
函数。测试地址:
标签:域名解析 http line 构建 静态网页 gevent led site eve
原文地址:https://blog.51cto.com/wzlinux/2419078