Using Redshift Spectrum with Cloud Formation

1.1k views Asked by At

I want to configure a RedShift Spectrum resource with a Cloud Formation template. What are the CF template parameters to do so?

For example, a normal RedShift can be templated like,

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

What is the Spectrum equivalent?

2

There are 2 answers

0
grundprinzip On BEST ANSWER

Your template looks ok, but there is one more thing to consider which is the IAM role (IAMRoles array) that is needed the CF documentation lists this as an additional parameter.

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

The IAM role is needed to talk to the Glue / Athena catalog and authenticate your requests against your data in S3.

0
John Rotenstein On

Amazon Redshift Spectrum is a feature of Amazon Redshift.

Simply launch a normal Amazon Redshift cluster and the features of Amazon Redshift Spectrum are available to you.

From 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.