Skip to main content

CDK construct for creating an analysis environment using DuckDB for S3 data

Project description

CloudDuck Icon

CloudDuck is a simple and easy-to-use analysis environment for S3 data, featuring DuckDB with built-in authentication.

CloudDuck Display Image

Architecture

Architecture

Installation

npm i cloud-duck

Setup

Deploy

import { CloudDuck } from 'cloud-duck';

declare const logBucket: s3.IBucket;

new CloudDuck(this, 'CloudDuck', {
  // The S3 bucket to analyze
  // CloudDuck can access to all of the buckets in the account by default.
  // If you want to restrict the access, you can use the targetBuckets property.
  targetBuckets: [logBucket],
});

Add user to the Cognito User Pool

Add user to the Cognito User Pool to access the CloudDuck.

aws cognito-idp admin-create-user \
--user-pool-id "us-east-1_XXXXX" \
--username "naonao@example.com" \
--user-attributes Name=email,Value="naonao@example.com" Name=email_verified,Value=true \
--message-action SUPPRESS \
--temporary-password Password1!

Access

Access to the CloudDuck with the cloudfront URL.

 npx cdk deploy
...
AwsStack.CloudDuckDistributionUrl84FC8296 = https://dosjykpv096qr.cloudfront.net
Stack ARN:
arn:aws:cloudformation:us-east-1:123456789012:stack/AwsStack/dd0960c0-b3d5-11ef-bcfc-12cf7722116f

✨  Total time: 73.59s

Enter the username and password.

Login

When you log in at the first time, you need to change the password.

Change Password

Play with the CloudDuck!

CloudDuck

Usage

Query

You can query the S3 data with SQL.

SELECT * FROM read_csv_auto('s3://your-bucket-name/your-file.csv');
SELECT * FROM parquet_scan('s3://your-bucket-name/your-file.parquet');

Ofcourse, you can store the result as a new table.

CREATE TABLE new_table AS SELECT * FROM read_csv_auto('s3://your-bucket-name/your-file.csv');

Persistence

All query results are persisted in individual DuckDB files for each user. Therefore, you can freely save your query results without worrying about affecting other users.

Note

CloudDuck is still under development. Updates may include breaking changes. If you encounter any bugs, please report them via issues.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cloud_duck-0.0.2.tar.gz (8.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cloud_duck-0.0.2-py3-none-any.whl (8.7 MB view details)

Uploaded Python 3

File details

Details for the file cloud_duck-0.0.2.tar.gz.

File metadata

  • Download URL: cloud_duck-0.0.2.tar.gz
  • Upload date:
  • Size: 8.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for cloud_duck-0.0.2.tar.gz
Algorithm Hash digest
SHA256 7626016f7628d0a2700fb4d67055627e74a0df8646387bc08f929e6e89b93532
MD5 fba9028637f54b0a522927617f5b086f
BLAKE2b-256 644cc5f2732d6542234aa5bb8a616a8f9ca822f99d7e5f265e3cba5769228b42

See more details on using hashes here.

File details

Details for the file cloud_duck-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: cloud_duck-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for cloud_duck-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 14b2460e85dd77abb777fa1144791d419b2747836dfbb37fd4fb37cdc1baddb1
MD5 04e129e07373a3c2771087265a305925
BLAKE2b-256 8d4b507457862bb77d6e7e788bf77407666a09e7d36902d157dd3fad875887df

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page