【发布时间】:2022-11-08 20:37:05
【问题描述】:
我的任务是为某些域设置通配符 SSL。这些域通过 AWS Route53 托管。
我在用证书机器人在一个Ubuntu 20.4托管应用程序的机器。我还为 Certbot 安装了 Route53 DNS 插件。
我运行这个命令:
sudo certbot certonly --dns-route53 --email 'me@derp.com' --domain 'mywebsite.rocks' --domain '*.mywebsite.rocks' --agree-tos --non-interactive
出于安全原因删除真实域
我收到此错误:
An error occurred (AccessDenied) when calling the ListHostedZones operation: User: arn:aws:sts::789148085273:assumed-role/AmazonLightsailInstanceRole/i-0871f2572906140c4 is not authorized to perform: route53:ListHostedZones because no identity-based policy allows the route53:ListHostedZones action
让我先解释一下我是如何在 AWS 控制台中设置 IAM 用户的。
- 我使用此配置创建了一个新策略
{ "Version": "2012-10-17", "Statement": [ { "Sid": "derp0", "Effect": "Allow", "Action": [ "route53:GetHostedZone", "route53:ChangeResourceRecordSets", "route53:ListResourceRecordSets" ], "Resource": "arn:aws:route53:::hostedzone/WHAT-EVER-MY-ID-IS-HERE" }, { "Sid": "derp1", "Effect": "Allow", "Action": "route53:ListHostedZones", "Resource": "*" } ] }用我的实际域的托管区域 ID 替换
WHAT-EVER-MY-ID-IS-HERE-
然后我创建了一个新的IAM 用户在设置过程中,我将上述策略附加给用户。
-
然后我创建了一个访问密钥对于我的新用户并记下
AccessKeyId和SecretAccessKey。这有权以编程方式使用。 -
在服务器上,我按照文档中的说明在
/root/.aws/config创建了一个配置文件。我也试过~/.aws/config但是当我使用sudo时,前者似乎是首选位置(不过我可能是错的,在我的测试期间,无论如何都没有工作)
如前所述,我运行命令并得到错误。
在网上到处搜索解决方案,但找不到。
感谢我从民间获得的任何帮助。
-
【问题讨论】:
标签: amazon-web-services amazon-route53 certbot