{Redshiftクラスタ}Managing clusters using the AWS CLI and Amazon Redshift API

-- 1. クラスターの作成

aws redshift create-cluster \
--db-name test \
--cluster-identifier redshift01 \
--cluster-type single-node \
--node-type dc2.large \
--master-username test \
--master-user-password 'password' \
--no-allow-version-upgrade \
--no-publicly-accessible


-- 2. クラスター一覧
aws redshift describe-clusters
aws redshift describe-clusters --cluster-identifier redshift01


-- 3. クラスターの再起動
aws redshift reboot-cluster --cluster-identifier redshift01


-- 4. スナップショットの作成
※一時停止できるためにはスナップショットが必要

※一時停止できるためには自動スナップショット保存期間が1日以上必要

aws redshift create-cluster-snapshot \
--cluster-identifier redshift01 \
--snapshot-identifier snap01

aws redshift describe-cluster-snapshots

-- 5. クラスターの一時停止
aws redshift pause-cluster --cluster-identifier redshift01


-- 6. クラスターの再開

aws redshift resume-cluster --cluster-identifier redshift01


-- 7. クラスターの削除
aws redshift delete-cluster \
--cluster-identifier redshift01 \
--skip-final-cluster-snapshot


-- 8. スナップショットの削除
aws redshift delete-cluster-snapshot --snapshot-identifier snap01