json - 属性服务 token 不能为空

标签 json amazon-web-services aws-cloudformation devops aws-cloudformation-custom-resource

"certificatefordns":{
  "Type" : "AWS::CertificateManager::Certificate",
  "Properties" : {
      "DomainName" : "*.test-elb.acb.com",
      "ValidationMethod" : "DNS"
},
 "CertificateDNSRecord":{
    "Type": "Custom::CertificateDNSRecord",
   "Properties": {
      "CertificateArn": {
        "Ref": "certificatefordns"
      },
      "DomainName": "*.test-elb.acb.com"
   }},
"DNS": {
            "Type": "AWS::Route53::RecordSetGroup",
            "Properties": {
                "HostedZoneId": "Z01724793QXGY7AZ",
                "RecordSets": [
                    {
                        "Name": {
                            "Ref": "AlternateDomainNames"
                        },
                        "Type": "A",
                        "AliasTarget": {
                            "HostedZoneId": "Z23TAZ6MNIO",
                            "DNSName": {
                                "Fn::GetAtt": [
                                    "WebLoadBalancer",
                                    "DNSName"
                                ]
                            }
                        }
                    },
                    {
                      "Name": {
                        "Fn::Sub": "${CertificateDNSRecord.Name}"
                    },
                    "Type": {
                        "Fn::Sub": "${CertificateDNSRecord.Type}"
                    },
                    "TTL": "60",
                    "Weight": 1,
                    "SetIdentifier": "*.test-elb.acb.com",
                    "ResourceRecords": [
                        {
                            "Fn::Sub": "${CertificateDNSRecord.Value}"
                        }
                    ]
                    }
                ]
            }
        }

嗨,团队, 我想为负载均衡器创建一个新的证书,在这个 json 代码的帮助下,我可以创建该证书,但一段时间后它会出现 property servicetoken 不能为空 的错误,所以正如我搜索后我很困惑我需要创建 lambda 函数还是什么? 或者有没有其他方法可以拒绝这个错误。 请指导我。

最佳答案

CloudFormation 中的

自定义资源需要 ServiceToken :

  • 服务提供商向模板开发人员提供用于访问服务的服务 token ,例如 Amazon SNS 主题 ARNLambda 函数 ARN。服务 token 必须来自您创建堆栈的同一区域。

您的 Custom::CertificateDNSRecord 缺少它。因此你必须提供它。

如果自定义资源用于验证 ACM 认证,您可以选中新选项,该选项不需要自定义 lambda 函数:

关于json - 属性服务 token 不能为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63243402/

相关文章:

aws-cloudformation - 如何在 awsm.json 中拥有多个带有 GET 请求的 API 网关路径?

amazon-web-services - CodePipeline : What is taskdef. json 和 appspec.yml 的用途?

amazon-web-services - AWS 雅典娜 - HIVE_UNKNOWN_ERROR : Unable to create input format on Athena

json - Express bodyParser 无法正常工作

php - Vicidial PHP/Json/Mysql 组合在监视器中提取数据

amazon-web-services - 位于独立 Kubernetes 集群中的两个 Pod 之间的连接

amazon-web-services - KMS 加密后 Aws S3 etag 不匹配 md5

amazon-web-services - 如何使用 Cloudformation 模板在 AWS Elastic Beanstalk 中包含粘性 session

json - 客户端生成的 JSON 存储在 MongoDB 服务器端,application/json 无法正确解析?

javascript - 如何在jade中渲染json对象并循环结果