有没有办法使用 cli 关闭和启动 AWS redshift 集群?

Is there a way to shutdown and start an AWS redshift cluster with the cli?

我只是启动一个 redshift 集群来开始开发工作,并且通常使用 cron 服务在工作时间以外关闭我的所有开发资源以节省资金。

当我浏览 aws cli 帮助时:

aws redshift help

我没有看到任何停止或关闭我的测试集群的选项,就像我在控制台中看到的那样。

如果没有办法做到这一点,有人知道他们为什么不提供此功能吗?这些实例保持在线状态非常昂贵,我不想每晚都手动关闭它们。

听起来您正在寻找:

来自 aws-cli aws redshift delete-cluster documentation:

If you want to shut down the cluster and retain it for future use, set SkipFinalClusterSnapshot to "false" and specify a name for FinalClusterSnapshotIdentifier . You can later restore this snapshot to resume using the cluster. If a final cluster snapshot is requested, the status of the cluster will be "final-snapshot" while the snapshot is being taken, then it's "deleting" once Amazon Redshift begins deleting the cluster.

示例用法,再次来自文档:

# When shutting down at night...
aws redshift delete-cluster --cluster-identifier mycluster --final-cluster-snapshot-identifier my-snapshot-id

# When starting up in the morning...
aws redshift restore-from-cluster-snapshot --cluster-identifier mycluster --snapshot-identifier my-snapshot-id