<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aliasgar K C</title>
    <description>The latest articles on DEV Community by Aliasgar K C (@aliasgarkc).</description>
    <link>https://dev.to/aliasgarkc</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F672637%2Fc75d86ce-a67b-4c3e-86f4-14a7cd9261cb.jpg</url>
      <title>DEV Community: Aliasgar K C</title>
      <link>https://dev.to/aliasgarkc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aliasgarkc"/>
    <language>en</language>
    <item>
      <title>Unlocking Data at Scale: A Complete Guide to Amazon Redshift Spectrum with AWS Glue and Lake Formation</title>
      <dc:creator>Aliasgar K C</dc:creator>
      <pubDate>Mon, 04 Aug 2025 10:08:58 +0000</pubDate>
      <link>https://dev.to/aliasgarkc/unlocking-data-at-scale-a-complete-guide-to-amazon-redshift-spectrum-with-aws-glue-and-lake-3gdi</link>
      <guid>https://dev.to/aliasgarkc/unlocking-data-at-scale-a-complete-guide-to-amazon-redshift-spectrum-with-aws-glue-and-lake-3gdi</guid>
      <description>&lt;p&gt;Amazon Redshift Spectrum brings powerful analytics directly to the data stored in your Amazon S3 data lake. This feature allows you to run complex SQL queries on vast amounts of structured and semi-structured data in S3, without moving or loading the data into your Redshift cluster.&lt;/p&gt;

&lt;p&gt;However, setting up Redshift Spectrum with modern AWS services like Lake Formation and AWS Glue can be challenging due to complex permission requirements. This comprehensive guide walks you through the complete process, from basic concepts to production-ready implementation.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is Redshift Spectrum?
&lt;/h2&gt;

&lt;p&gt;Redshift Spectrum extends Amazon Redshift's analytics capabilities seamlessly into your S3 data lake. Instead of loading all your data into Redshift tables, you can define external tables that reference S3 files directly and query them using standard SQL. Key highlights include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Query Across S3 and Redshift Data:&lt;/strong&gt; Run ad-hoc analytics pulling together data in both Redshift and S3.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost Efficiency:&lt;/strong&gt; Only pay for the amount of data scanned in S3, with no persistent compute cost if not in use.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability:&lt;/strong&gt; Redshift Spectrum harnesses thousands of AWS-managed nodes for massively parallel query processing. It can scale to exabyte-level datasets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance:&lt;/strong&gt; Compute-intensive work such as filtering and aggregation is pushed to the Spectrum layer, freeing Redshift cluster resources.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Modern Architecture: How the Components Work Together
&lt;/h2&gt;

&lt;p&gt;Understanding the data flow is crucial for successful implementation:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;AWS Glue Crawler&lt;/strong&gt; → Discovers your S3 data and creates table metadata in the Glue Data Catalog&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lake Formation&lt;/strong&gt; → Manages fine-grained permissions for catalog data and S3 locations&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Redshift Spectrum&lt;/strong&gt; → Queries external tables using Glue Catalog metadata with Lake Formation permissions&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This integration provides enterprise-grade security and governance while maintaining performance and scalability.&lt;/p&gt;

&lt;h2&gt;
  
  
  Redshift Spectrum: Typical Use Case
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Scenario: Seamless Analysis of Historical Website Clickstream Data
&lt;/h3&gt;

&lt;p&gt;Imagine an e-commerce company tracking website visitor behavior. Recent data (current year) resides in Amazon Redshift tables for quick analysis, but years of historical clickstream logs are archived in compressed Parquet format in S3. Analysts want to compare recent trends with multi-year history without having to reload terabytes of old data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;With Redshift Spectrum:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Analysts can create external tables referencing raw S3 data.&lt;/li&gt;
&lt;li&gt;Run SQL queries joining fresh Redshift data with archived S3 logs.&lt;/li&gt;
&lt;li&gt;Gain immediate, full-history insights using a single query engine.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This hybrid analytics workflow is impossible or cost-prohibitive with traditional ETL pipelines. Spectrum saves significant time and storage costs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Complete Step-by-Step Implementation Guide
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;p&gt;Before starting, ensure you have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data files (CSV, Parquet, JSON, etc.) in an S3 bucket, in the same AWS region as your Redshift cluster&lt;/li&gt;
&lt;li&gt;Administrative access to AWS IAM, Glue, Lake Formation, and Redshift&lt;/li&gt;
&lt;li&gt;AWS CLI configured (optional but recommended for troubleshooting)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 1: Create IAM Role for AWS Glue Crawler
&lt;/h3&gt;

&lt;h2&gt;
  
  
  Part 1: Setting Up IAM Roles and Permissions
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Navigate to IAM Console → Roles → Create role&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Role Configuration:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Trusted entity&lt;/strong&gt;: AWS service&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use case&lt;/strong&gt;: Glue&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Role name&lt;/strong&gt;: &lt;code&gt;AWSGlueServiceRole-akc&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Required Policies:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;AWS Managed Policy&lt;/strong&gt;: &lt;code&gt;AWSGlueServiceRole&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom S3 Access Policy&lt;/strong&gt; (&lt;code&gt;S3-access-policy&lt;/code&gt;):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2012-10-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Statement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Sid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Statement1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"s3:GetObject"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"s3:ListBucket"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:s3:::your-bucket-name"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:s3:::your-bucket-name/*"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Glue Catalog Permissions&lt;/strong&gt; (&lt;code&gt;Table-policy&lt;/code&gt;):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2012-10-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Statement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Sid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Statement1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"glue:GetTable"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"glue:GetTables"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"glue:GetDatabase"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"glue:GetDatabases"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"glue:CreateTable"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"glue:UpdateTable"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"glue:DeleteTable"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"glue:GetPartition"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"glue:GetPartitions"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"glue:CreatePartition"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"glue:UpdatePartition"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"glue:DeletePartition"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:glue:us-east-1:ACCOUNT-ID:catalog"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:glue:us-east-1:ACCOUNT-ID:database/your-database"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:glue:us-east-1:ACCOUNT-ID:table/your-database/*"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Lake Formation Access&lt;/strong&gt; (&lt;code&gt;Lakeformation-policy&lt;/code&gt;):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2012-10-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Statement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Sid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Statement1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"lakeformation:GetDataAccess"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"*"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Create IAM Role for Redshift Spectrum
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Navigate to IAM Console → Roles → Create role&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Role Configuration:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Trusted entity&lt;/strong&gt;: AWS service&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use case&lt;/strong&gt;: Redshift - Customizable&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Role name&lt;/strong&gt;: &lt;code&gt;SpectrumRole&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Required Policies:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;AWS Managed Policy&lt;/strong&gt;: &lt;code&gt;AmazonS3ReadOnlyAccess&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Glue Access Policy&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2012-10-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Statement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"glue:GetDatabase"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"glue:GetDatabases"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"glue:GetTable"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"glue:GetTables"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"glue:GetPartition"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"glue:GetPartitions"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"glue:CreateDatabase"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:glue:us-east-1:ACCOUNT-ID:catalog"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:glue:us-east-1:ACCOUNT-ID:database/*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:glue:us-east-1:ACCOUNT-ID:table/*/*"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Lake Formation Access Policy&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2012-10-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Statement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"lakeformation:GetDataAccess"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"*"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Part 2: Setting up the Redshift Cluster
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 3: Create Redshift Namespace and Workgroup
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Namespace Configuration:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Namespace name&lt;/strong&gt;: &lt;code&gt;spectrum-analytics-namespace&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database name&lt;/strong&gt;: &lt;code&gt;analytics_db&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Admin user name&lt;/strong&gt;: &lt;code&gt;admin_user&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Admin user password&lt;/strong&gt;: Create a secure password&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Associated IAM roles&lt;/strong&gt;: We'll add the Spectrum role later&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Permissions and encryption:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Manage IAM roles&lt;/strong&gt;: Skip for now (we'll configure later)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Encryption&lt;/strong&gt;: Use AWS managed key (default)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Log exports&lt;/strong&gt;: Enable audit logging and user activity logging (recommended)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Click &lt;strong&gt;Create namespace&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Workspace Configuration:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Navigate to Amazon Redshift Console → Serverless dashboard → Create workgroup&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4: Associate Redshift Role with Cluster
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Navigate to Redshift Console → Clusters → [Your Cluster] → Properties → Security&lt;/span&gt;
&lt;span class="c"&gt;# Manage IAM roles → Associate IAM roles → Select Spectrum-role&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Part 3: Setting Up AWS Glue Data Catalog
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 5: Create Glue Database
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Navigate to AWS Glue Console → Databases → Add database&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Database Configuration:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Name&lt;/strong&gt;: &lt;code&gt;your-database&lt;/code&gt; (e.g., &lt;code&gt;akc-db&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Description&lt;/strong&gt;: &lt;code&gt;Database for analytics data&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Location&lt;/strong&gt;: Leave empty&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6cy6nse9lla1brwc5kfs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6cy6nse9lla1brwc5kfs.png" alt="Database Configuration" width="800" height="490"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 6: Configure Lake Formation Permissions
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Grant Database Permissions to Crawler:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Navigate to Lake Formation Console → Permissions → Grant&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Principal&lt;/strong&gt;: &lt;code&gt;AWSGlueServiceRole-akc&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LF-Tags or catalog resources&lt;/strong&gt;: Catalog resources&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Databases&lt;/strong&gt;: Select your database&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database permissions&lt;/strong&gt;: ✓ &lt;code&gt;Create table&lt;/code&gt;, &lt;code&gt;Alter&lt;/code&gt;, &lt;code&gt;Drop&lt;/code&gt;, &lt;code&gt;Describe&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqqxbbxwi12y402l68bl1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqqxbbxwi12y402l68bl1.png" alt=" " width="800" height="468"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frx08miq2hs8bk785ug3o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frx08miq2hs8bk785ug3o.png" alt=" " width="800" height="579"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Grant Data Location Access to Crawler:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Navigate to Lake Formation Console → Permissions → Grant&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Principal&lt;/strong&gt;: &lt;code&gt;AWSGlueServiceRole-akc&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LF-Tags or catalog resources&lt;/strong&gt;: Data locations&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Amazon S3 path&lt;/strong&gt;: &lt;code&gt;s3://your-bucket-name/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data location permissions&lt;/strong&gt;: ✓ &lt;code&gt;Data location access&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F22h6svb56uct3tbgemzo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F22h6svb56uct3tbgemzo.png" alt=" " width="800" height="719"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Grant Permissions to Redshift Spectrum Role:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Navigate to Lake Formation Console → Permissions → Grant&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Principal&lt;/strong&gt;: &lt;code&gt;Spectrum-role&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database&lt;/strong&gt;: Your database&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database permissions&lt;/strong&gt;: ✓ &lt;code&gt;Describe&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tables&lt;/strong&gt;: All tables&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Table permissions&lt;/strong&gt;: ✓ &lt;code&gt;Select&lt;/code&gt;, &lt;code&gt;Describe&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2gi5ilglt6lrc10rhojs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2gi5ilglt6lrc10rhojs.png" alt=" " width="800" height="747"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Grant Data Location Access to Spectrum Role:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Navigate to Lake Formation Console → Permissions → Grant&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Principal&lt;/strong&gt;: &lt;code&gt;Spectrum-role&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LF-Tags or catalog resources&lt;/strong&gt;: Data locations&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Amazon S3 path&lt;/strong&gt;: &lt;code&gt;s3://your-bucket-name/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data location permissions&lt;/strong&gt;: ✓ &lt;code&gt;Data location access&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbge4lfoz3ebhnxoqjjlv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbge4lfoz3ebhnxoqjjlv.png" alt=" " width="800" height="545"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 7: Create and Run Glue Crawler
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Navigate to AWS Glue Console → Crawlers → Create crawler&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Crawler Configuration:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Name&lt;/strong&gt;: &lt;code&gt;akc-crawler&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Description&lt;/strong&gt;: &lt;code&gt;Crawler for analytics data&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4yly822jt19nj75o4bmj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4yly822jt19nj75o4bmj.png" alt=" " width="800" height="478"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Sources:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Data source&lt;/strong&gt;: S3&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Location of S3 data&lt;/strong&gt;: &lt;code&gt;s3://your-bucket-name/your-folder/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Subsequent crawler runs&lt;/strong&gt;: Crawl all folders&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpyeggumva9kx9ftydjd6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpyeggumva9kx9ftydjd6.png" alt=" " width="800" height="552"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Security Settings:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;IAM role&lt;/strong&gt;: &lt;code&gt;AWSGlueServiceRole-akc&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fixsjgr2yt86o9p6i29ho.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fixsjgr2yt86o9p6i29ho.png" alt=" " width="800" height="504"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output and Scheduling:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Target database&lt;/strong&gt;: Your database&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Table name prefix&lt;/strong&gt;: Leave empty&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Crawler schedule&lt;/strong&gt;: On demand&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ttx86zu0uy35k1towbu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ttx86zu0uy35k1towbu.png" alt=" " width="800" height="536"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Run the Crawler:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Navigate to AWS Glue Console → Crawlers → your-data-crawler → Run crawler&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5cup33yckim5zkl5bqtl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5cup33yckim5zkl5bqtl.png" alt=" " width="800" height="392"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 8: Verify Table Creation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Navigate to AWS Glue Console → Databases → your-database → Tables&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see a table created based on your data file. Click on it to verify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Column names and data types&lt;/li&gt;
&lt;li&gt;S3 location&lt;/li&gt;
&lt;li&gt;File format&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjj2ml1pvanbd1iliysd8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjj2ml1pvanbd1iliysd8.png" alt=" " width="800" height="526"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 3: Setting Up Redshift Spectrum
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 9: Create External Schema in Redshift
&lt;/h3&gt;

&lt;p&gt;Connect to your Redshift cluster and execute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;EXTERNAL&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="n"&gt;spectrum_schema&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="k"&gt;DATA&lt;/span&gt; &lt;span class="k"&gt;CATALOG&lt;/span&gt;
&lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="s1"&gt;'your-database'&lt;/span&gt;
&lt;span class="n"&gt;IAM_ROLE&lt;/span&gt; &lt;span class="s1"&gt;'arn:aws:iam::ACCOUNT-ID:role/Spectrum-role'&lt;/span&gt;
&lt;span class="n"&gt;REGION&lt;/span&gt; &lt;span class="s1"&gt;'us-east-1'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F82s08zfja101o9izkj9d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F82s08zfja101o9izkj9d.png" alt=" " width="800" height="523"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 10: Query Your Data
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Basic Query:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;spectrum_schema&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;your_table_name&lt;/span&gt; &lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffjf53efbn8y217rprp6c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffjf53efbn8y217rprp6c.png" alt=" " width="800" height="496"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check Table Structure:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;SVV_EXTERNAL_COLUMNS&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;schemaname&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'spectrum_schema'&lt;/span&gt;
&lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;tablename&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'your_table_name'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx7ttg7ojwymgh4jg52xn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx7ttg7ojwymgh4jg52xn.png" alt=" " width="800" height="415"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Analytics Queries:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;
&lt;span class="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;page_views&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt;
&lt;span class="n"&gt;spectrum_schema&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;akc_bucket_rs&lt;/span&gt; &lt;span class="k"&gt;c&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt;
&lt;span class="n"&gt;event_time&lt;/span&gt; &lt;span class="k"&gt;BETWEEN&lt;/span&gt; &lt;span class="s1"&gt;'2025-01-01'&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="s1"&gt;'2025-06-30'&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt;
&lt;span class="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyj5ahcq99wsgmoau4zbo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyj5ahcq99wsgmoau4zbo.png" alt=" " width="800" height="513"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Amazon Redshift Spectrum, when properly configured with AWS Glue and Lake Formation, provides a powerful platform for modern data analytics. The integration enables organizations to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scale analytics&lt;/strong&gt; across petabytes of S3 data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reduce costs&lt;/strong&gt; by avoiding data movement&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Implement governance&lt;/strong&gt; with fine-grained access controls&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accelerate insights&lt;/strong&gt; with familiar SQL interfaces&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;While the initial setup involves multiple services and complex permissions, following this comprehensive guide ensures a robust, production-ready implementation. The key to success lies in understanding the relationship between IAM, Lake Formation, Glue, and Redshift, and systematically configuring each component.&lt;/p&gt;

&lt;p&gt;By implementing the best practices outlined in this guide, you'll have a scalable, secure, and cost-effective data analytics platform that can grow with your organization's needs. Start with a simple use case, validate the setup, and gradually expand to more complex scenarios as your team becomes comfortable with the architecture.&lt;/p&gt;

&lt;p&gt;Remember: proper planning and permission management are crucial for success. Take time to understand each component's role, test thoroughly in development environments, and monitor performance in production.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ready to unlock the full potential of your data lake? Start implementing Redshift Spectrum today and transform your organization's approach to large-scale data analytics.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>redshiftspectrum</category>
      <category>dataengineering</category>
      <category>redshift</category>
      <category>aws</category>
    </item>
    <item>
      <title>Building a Classic Tetris Game with Amazon Q – A Fun Coding Adventure</title>
      <dc:creator>Aliasgar K C</dc:creator>
      <pubDate>Sat, 24 May 2025 10:23:00 +0000</pubDate>
      <link>https://dev.to/aliasgarkc/building-a-classic-tetris-game-with-amazon-q-a-fun-coding-adventure-n41</link>
      <guid>https://dev.to/aliasgarkc/building-a-classic-tetris-game-with-amazon-q-a-fun-coding-adventure-n41</guid>
      <description>&lt;p&gt;Recently, I took on a fun challenge — building a simple 2D Tetris game using Amazon Q, Amazon's generative AI coding assistant. As part of their developer challenge, I wanted to explore how well it could help with game development, and the result was surprisingly delightful.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Prompt
&lt;/h2&gt;

&lt;p&gt;All I started with was a simple request:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Can you build a basic 2D game like Tetris in Python?&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That’s it. No complex specifications, no detailed requirements — just a clear idea and curiosity.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Experience
&lt;/h2&gt;

&lt;p&gt;From the moment I submitted the prompt, Amazon Q was impressively intuitive. It quickly scaffolded the game logic, using pygame to create the Tetris grid, handle block movements, and implement game-over conditions. I learned a lot by reading through the code it generated and tweaking the logic to suit my style.&lt;/p&gt;

&lt;p&gt;I was especially impressed with how easy it was to iterate, making small changes to the mechanics or visuals felt seamless. It was like pair programming with a supercharged assistant.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Building this Tetris clone wasn’t just about nostalgia—it was a fun way to explore Amazon Q's capabilities creatively and hands-on. Whether you're prototyping games or building serious applications, tools like &lt;strong&gt;Amazon Q&lt;/strong&gt; can make the process more enjoyable and efficient.&lt;/p&gt;

&lt;p&gt;If you're curious, I highly recommend giving it a try — sometimes, all it takes is a single prompt to start building something cool.&lt;/p&gt;

&lt;p&gt;Github link: &lt;a href="https://github.com/aliasgar-kaeed-challawala/tetris-game" rel="noopener noreferrer"&gt;Tetris game&lt;/a&gt;&lt;/p&gt;

</description>
      <category>awschallenge</category>
      <category>aws</category>
      <category>amazonq</category>
      <category>python</category>
    </item>
    <item>
      <title>The Week in Review</title>
      <dc:creator>Aliasgar K C</dc:creator>
      <pubDate>Tue, 31 Aug 2021 05:49:15 +0000</pubDate>
      <link>https://dev.to/aliasgarkc/the-week-in-review-klm</link>
      <guid>https://dev.to/aliasgarkc/the-week-in-review-klm</guid>
      <description>&lt;p&gt;It was the 4th week of the &lt;strong&gt;100DaysofCode&lt;/strong&gt; challenge and it turned out to be the most productive week in the entire challenge. I learned about REST API and defining RESTful routes. To practice defining RESTful routes, I made a project involving CRUD operations where the user could post a comment, edit the comment, view and delete comments. Though there were not any authentication and user account features, it was sufficient to get an idea about defining RESTful routes and passing data. In addition to this, I also solved 40 problems on arrays on geeksforgeeks and leetcode. Also focused on personal development and made it a habit to read at least 20 pages a day.   &lt;/p&gt;

</description>
      <category>programming</category>
      <category>webdev</category>
      <category>coding</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>Day 4/100</title>
      <dc:creator>Aliasgar K C</dc:creator>
      <pubDate>Mon, 26 Jul 2021 10:44:37 +0000</pubDate>
      <link>https://dev.to/aliasgarkc/day-4-100-281h</link>
      <guid>https://dev.to/aliasgarkc/day-4-100-281h</guid>
      <description>&lt;p&gt;4 days and now I have started gathering momentum. Started the day with solving some problems on Hackerrank. Then watched some some tutorials on arrays and practiced the most frequently array problems on Leetcode. Initially, I solved the problems with a &lt;em&gt;bruteforce&lt;/em&gt; approach but then I tried to solve it more efficiently. I solved more problems today than usual, but what makes me more happy is that I was able to solve them efficiently after coming up with bruteforce approaches. Coming on to the web course, I learnt about classes in Javascript and also about the &lt;strong&gt;extends&lt;/strong&gt; and &lt;strong&gt;super&lt;/strong&gt; keyword based on the concept of inheritance. Also came across some of the basics terminal commands that will be used further when I move on to Node and Express. In the end, I revised the concepts which I learnt previously. &lt;/p&gt;

&lt;p&gt;check out my portfolio:&lt;br&gt;
&lt;a href="https://aliasgarkc.netlify.app/" rel="noopener noreferrer"&gt;https://aliasgarkc.netlify.app/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>100daysofcode</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Day 3/100</title>
      <dc:creator>Aliasgar K C</dc:creator>
      <pubDate>Sun, 25 Jul 2021 10:20:33 +0000</pubDate>
      <link>https://dev.to/aliasgarkc/day-3-100-2fbo</link>
      <guid>https://dev.to/aliasgarkc/day-3-100-2fbo</guid>
      <description>&lt;p&gt;The third day of the challenge and the schedule did go haywire😓... Slept late at night and consequently woke up late and then went on to revise what I learnt in the past 2 days, practiced some basic array problems and made one more project ( A jokes website). The same concept of APIs was used. Had a tough time recollecting all the previously learnt topics, but in the end... I came out on top😉.Also made a list of tasks to be performed in the upcoming days. My consistency was tested today ... But I am pretty contented that the process continued. &lt;/p&gt;

&lt;p&gt;Check out my portfolio: &lt;a href="https://aliasgarkc.netlify.app/" rel="noopener noreferrer"&gt;https://aliasgarkc.netlify.app/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>Day 2/100</title>
      <dc:creator>Aliasgar K C</dc:creator>
      <pubDate>Sat, 24 Jul 2021 11:00:03 +0000</pubDate>
      <link>https://dev.to/aliasgarkc/day-2-100-2po4</link>
      <guid>https://dev.to/aliasgarkc/day-2-100-2po4</guid>
      <description>&lt;p&gt;Day 2 of the challenge started as usual, by solving problems on leetcode and hackerrank. Also revised arrays and practiced some problems on it.  Then, I went on to continue my web development course and learnt about object oriented programming in JavaScript along with prototypes. I then started working on a TV Show search project which made use of APIs and also styled it with bootstrap and some custom CSS and published it on Github and hosted the site on Netlify. Finally, I went through what I learnt yesterday. So far so good, hope that I remain consistent and cover most of the concepts in the upcoming days.&lt;/p&gt;

&lt;p&gt;TV Show search Website Link : &lt;a href="https://showsearch.netlify.app/" rel="noopener noreferrer"&gt;https://showsearch.netlify.app/&lt;/a&gt;&lt;br&gt;
Check out my portfolio : &lt;a href="https://aliasgarkc.netlify.app" rel="noopener noreferrer"&gt;https://aliasgarkc.netlify.app&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>100daysofcode</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Day 1 / 100</title>
      <dc:creator>Aliasgar K C</dc:creator>
      <pubDate>Fri, 23 Jul 2021 11:39:55 +0000</pubDate>
      <link>https://dev.to/aliasgarkc/day-1-100-k4p</link>
      <guid>https://dev.to/aliasgarkc/day-1-100-k4p</guid>
      <description>&lt;p&gt;So, Finally after so many days of procrastination, here I am taking up the 100DaysOfCode challenge. Today was the day 1 of the challenge. I started with solving some problems on Hackerrank and then went on to watch some tutorials on data structures and algorithms, specifically on time and space complexity. After that I continued learning JavaScript on Udemy, had a quick glance on the basics(which I already learnt before) and then went on to learn about AJAX and APIs. I also learned to use Postman, which I believe is pretty useful when working with APIs. Pretty satisfied with what I learnt today and hoping to do the same for rest of the challenge and also continue after the challenge ends. &lt;/p&gt;

</description>
      <category>100daysofcode</category>
      <category>programming</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
