certificatemanager:changeResourceRecordSets 用户无权访问此资源

时间:2021-04-06 11:28:12

标签: amazon-web-services amazon-route53 aws-certificate-manager

尝试使用 Amazon Certificate Manager 创建 SSL 证书,按照此处 -

https://medium.com/swlh/aws-website-hosting-with-cloudformation-guide-36cac151d1af

我有一个具有以下策略的部署用户 -

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "cloudformation:*",
                "s3:*",
                "route53:*",
                "acm:*"
            ],
            "Effect": "Allow",
            "Resource": "*"
        }
    ]
}

但是当我部署时我得到以下 -

API: certificatemanager:changeResourceRecordSets User #{my_IAM_deploy_user} is not authorized to access this resource      

尽管有 acm:* 访问权限,但我怎么会收到此错误?

(想知道是否与 Why changeResourceRecordSets gets not authorized to access this resource? 有关,但不知道具体如何)

(下面的 Cloudformation 模板)

---
AWSTemplateFormatVersion: '2010-09-09'
Description: cloudfront-route53-demo-cert
Parameters:
  DomainName:
    Type: String
  HostedZoneId:
    Type: String
    Default: Z1BKCTXD74EZPE  # eu-west-1; https://docs.aws.amazon.com/general/latest/gr/s3.html#s3_website_region_endpoints
Outputs:
  CertificateARN:
    Value:
      Ref: Certificate  # returns ARN
Resources:
  Certificate:
    Type: AWS::CertificateManager::Certificate
    Properties:
      DomainName:
        Ref: DomainName
      DomainValidationOptions:
        - DomainName:
            Ref: DomainName
          HostedZoneId:
            Ref: HostedZoneId
      ValidationMethod: DNS

1 个答案:

答案 0 :(得分:0)

我误解了 HostedZoneId 是什么。我认为这是某种 route53 区域特定的单例,但(doh)结果证明它只是我创建的 route53 HostedZone 的 id。确实有点明显。