amazon-web-services - 创建 firehose cloudformation 模板时出错

标签 amazon-web-services aws-cloudformation

我正在创建一个“firehose”cloudformation 模板,最终将数据推送到 redshift

它看起来像这样:

{
  "Resources": {
     "Role1" : {},// this role permits access to S3 and Redshift

     "S3Bucket" : {} // configuration for S3 bucket where firehose places data before pushing it to redshift

     "RedshiftCluster": {} // configuration for redshift cluster

     "FirehoseStream": {
        ... some properties here
       "RedshiftDestinationConfiguration" : {
           "ClusterJDBCURL": {
            "Fn::GetAtt": [
              "RedshiftCluster",
              "ClusterJDBCURL"
            ]
         }

        },

     }
  }


}

我收到的错误是:

Template validation error: Template error: resource RedshiftCluster does not support attribute type ClusterJDBCURL in Fn::GetAtt

根据文档,ClusterJDBCURL 的值必须是“字符串”。但是,在设置 redshift 集群之前我不会知道该字符串的值。

那么我应该如何提供这个值?

最佳答案

AWS::Redshift::Cluster类型没有 ClusterJDBCURL 属性。 然而,我们可以使用 Fn::Sub 构建一个.

基于Obtain the JDBC Url文档中,JDBC Url 的格式为 jdbc:redshift://<endpoint>:<port>/<database> .

所以,如果你替换 <database>在以下带有数据库名称的示例中,您应该会得到您要查找的内容。

{
  "Resources": {
    "Role1" : {},// this role permits access to S3 and Redshift
    "S3Bucket" : {} // configuration for S3 bucket where firehose places data before pushing it to redshift

    "RedshiftCluster": {} // configuration for redshift cluster

    "FirehoseStream": {
        ... some properties here
      "RedshiftDestinationConfiguration" : {
        "ClusterJDBCURL": {
          "Fn::Sub": "jdbc:redshift://${RedshiftCluster.Endpoint.Address}:${RedshiftCluster.Endpoint.Port}/<database>"
        }
      },
    }
  }
}

关于amazon-web-services - 创建 firehose cloudformation 模板时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46921451/

相关文章:

amazon-web-services - 解决 AWS CloudFormation 中的循环依赖问题

amazon-web-services - AWS API网关需要手动部署吗?

amazon-web-services - 如何以其他用户身份在 EC2 上的 Cloudformation 中运行用户数据命令?

amazon-web-services - 使用cloudformation对IAM用户组的aws lambda权限

amazon-web-services - 模板的资源 block 中 Unresolved 资源依赖性 [RestAPIDeployment]

ios - dynamodb,MobileHub 不工作

PHP AWS SNS SDK - 徽章

node.js - AWS Lambda : How to store secret to external API?

amazon-web-services - 当我在 AWS Step Functions 中停止执行时会发生什么?

amazon-web-services - 如何在 EC2 t2micro 实例上组装 Spark(并避免 "java.lang.OutOfMemoryError: Java heap space"错误)?