将 Redshift Spectrum 与 Cloud Formation 结合使用

Using Redshift Spectrum with Cloud Formation

我想使用 Cloud Formation 模板配置 RedShift Spectrum 资源。这样做的 CF 模板参数是什么?

例如,一个普通的 RedShift 可以是 templated 像,

myCluster: 
  Type: "AWS::Redshift::Cluster"
  Properties:
    DBName: "mydb"
    MasterUsername: "master"
    MasterUserPassword: 
      Ref: "MasterUserPassword"
    NodeType: "dw.hs1.xlarge"
    ClusterType: "single-node"
    Tags:
      - Key: foo
        Value: bar

什么是等效频谱?

Amazon Redshift Spectrum 是 Amazon Redshift 的功能

只需启动一个普通的 Amazon Redshift 集群,即可使用 Amazon Redshift Spectrum 的功能。

来自Getting Started with Amazon Redshift Spectrum

To use Redshift Spectrum, you need an Amazon Redshift cluster and a SQL client that's connected to your cluster so that you can execute SQL commands.

您的模板看起来不错,但还需要考虑一件事,即需要的 IAM 角色(IAMRoles 数组),CF 文档将其列为附加参数。

myCluster: 
  Type: "AWS::Redshift::Cluster"
  Properties:
    DBName: "mydb"
    MasterUsername: "master"
    MasterUserPassword: 
      Ref: "MasterUserPassword"
    NodeType: "dw.hs1.xlarge"
    ClusterType: "single-node"
    IamRoles:
      - "arn:aws:iam::123456789012:role/S3Access"
    Tags:
      - Key: foo
        Value: bar

需要 IAM 角色才能与 Glue / Athena 目录对话并根据 S3 中的数据验证您的请求。