There are more AWS SDK examples available in the AWS Doc SDK Examples
Amazon Redshift examples using AWS CLI
The following code examples show you how to perform actions and implement common scenarios by using the AWS Command Line Interface with Amazon Redshift.
Actions are code excerpts from larger programs and must be run in context. While actions show you how to call individual service functions, you can see actions in context in their related scenarios.
Each example includes a link to the complete source code, where you can find instructions on how to set up and run the code in context.
Topics
Actions
The following code example shows how to use accept-reserved-node-exchange.
- AWS CLI
-
To accept reserved node exchange
The following
accept-reserved-node-exchangeexample accepts exchange of a DC1 reserved node for a DC2 reserved node.aws redshift accept-reserved-node-exchange \ --reserved-node-id12345678-12ab-12a1-1a2a-12ab-12a12EXAMPLE\ --target-reserved-node-offering-id12345678-12ab-12a1-1a2a-12ab-12a12EXAMPLEOutput:
{ "ExchangedReservedNode": { "ReservedNodeId": "12345678-12ab-12a1-1a2a-12ab-12a12EXAMPLE", "ReservedNodeOfferingId": "12345678-12ab-12a1-1a2a-12ab-12a12EXAMPLE", "NodeType": "dc2.large", "StartTime": "2019-12-06T21:17:26Z", "Duration": 31536000, "FixedPrice": 0.0, "UsagePrice": 0.0, "CurrencyCode": "USD", "NodeCount": 1, "State": "exchanging", "OfferingType": "All Upfront", "RecurringCharges": [ { "RecurringChargeAmount": 0.0, "RecurringChargeFrequency": "Hourly" } ], "ReservedNodeOfferingType": "Regular" } }For more information, see Upgrading Reserved Nodes With the AWS CLI in the Amazon Redshift Cluster Management Guide.
-
For API details, see AcceptReservedNodeExchange
in AWS CLI Command Reference.
-
The following code example shows how to use authorize-cluster-security-group-ingress.
- AWS CLI
-
Example 1: To authorize access to an EC2 security group
The following
authorize-cluster-security-group-ingressexample authorizes access to a named Amazon EC2 security group.aws redshift authorize-cluster-security-group-ingress \ --cluster-security-group-namemysecuritygroup\ --ec2-security-group-namemyec2securitygroup\ --ec2-security-group-owner-id123456789012Output:
{ "ClusterSecurityGroup": { "ClusterSecurityGroupName": "mysecuritygroup", "Description": "This is my cluster security group", "EC2SecurityGroups": [ { "Status": "authorizing", "EC2SecurityGroupName": "myec2securitygroup", "EC2SecurityGroupOwnerId": "123456789012", "Tags": [] } ], "IPRanges": [], "Tags": [] } }For more information, see Infrastructure security in Amazon Redshift in the Amazon Redshift Management Guide.
Example 2: To authorize access to a CIDR range
The following
authorize-cluster-security-group-ingressexample authorizes access to a CIDR range.aws redshift authorize-cluster-security-group-ingress \ --cluster-security-group-namemysecuritygroup\ --cidrip192.168.100.100/32Output:
{ "ClusterSecurityGroup": { "ClusterSecurityGroupName": "mysecuritygroup", "Description": "This is my cluster security group", "EC2SecurityGroups": [], "IPRanges": [ { "Status": "authorizing", "CIDRIP": "192.168.100.100/32", "Tags": [] } ], "Tags": [] } }For more information, see Infrastructure security in Amazon Redshift in the Amazon Redshift Management Guide.
-
For API details, see AuthorizeClusterSecurityGroupIngress
in AWS CLI Command Reference.
-
The following code example shows how to use authorize-snapshot-access.
- AWS CLI
-
To authorize an AWS account to restore a snapshot
The following
authorize-snapshot-accessexample authorizes the AWS account123456789111to restore the snapshotmy-snapshot-id. By default, the output is in JSON format.aws redshift authorize-snapshot-access \ --snapshot-idmy-snapshot-id\ --account-with-restore-access123456789111Output:
{ "Snapshot": { "Status": "available", "SnapshotCreateTime": "2013-07-17T22:04:18.947Z", "EstimatedSecondsToCompletion": 0, "AvailabilityZone": "us-west-2a", "ClusterVersion": "1.0", "MasterUsername": "adminuser", "Encrypted": false, "OwnerAccount": "123456789012", "BackupProgressInMegaBytes": 11.0, "ElapsedTimeInSeconds": 0, "DBName": "dev", "CurrentBackupRateInMegaBytesPerSecond": 0.1534, "ClusterCreateTime": "2013-01-22T21:59:29.559Z", "ActualIncrementalBackupSizeInMegaBytes": 11.0, "SnapshotType": "manual", "NodeType": "dw.hs1.xlarge", "ClusterIdentifier": "mycluster", "TotalBackupSizeInMegaBytes": 20.0, "Port": 5439, "NumberOfNodes": 2, "SnapshotIdentifier": "my-snapshot-id" } }For more information, see Sharing a snapshot in the Amazon Redshift Management Guide.
-
For API details, see AuthorizeSnapshotAccess
in AWS CLI Command Reference.
-
The following code example shows how to use batch-delete-cluster-snapshots.
- AWS CLI
-
To delete a set of cluster snapshots
The following
batch-delete-cluster-snapshotsexample deletes a set of manual cluster snapshots.aws redshift batch-delete-cluster-snapshots \ --identifiersSnapshotIdentifier=mycluster-2019-11-06-14-12SnapshotIdentifier=mycluster-2019-11-06-14-20Output:
{ "Resources": [ "mycluster-2019-11-06-14-12", "mycluster-2019-11-06-14-20" ] }For more information, see Amazon Redshift Snapshots in the Amazon Redshift Cluster Management Guide.
-
For API details, see BatchDeleteClusterSnapshots
in AWS CLI Command Reference.
-
The following code example shows how to use batch-modify-cluster-snapshots.
- AWS CLI
-
To modify a set of cluster snapshots
The following
batch-modify-cluster-snapshotsexample modifies the settings for a set of cluster snapshots.aws redshift batch-modify-cluster-snapshots \ --snapshot-identifier-listmycluster-2019-11-06-16-31mycluster-2019-11-06-16-32\ --manual-snapshot-retention-period30Output:
{ "Resources": [ "mycluster-2019-11-06-16-31", "mycluster-2019-11-06-16-32" ], "Errors": [] }For more information, see Amazon Redshift Snapshots in the Amazon Redshift Cluster Management Guide.
-
For API details, see BatchModifyClusterSnapshots
in AWS CLI Command Reference.
-
The following code example shows how to use cancel-resize.
- AWS CLI
-
To cancel resize of a cluster
The following
cancel-resizeexample cancels a classic resize operation for a cluster.aws redshift cancel-resize \ --cluster-identifiermyclusterOutput:
{ "TargetNodeType": "dc2.large", "TargetNumberOfNodes": 2, "TargetClusterType": "multi-node", "Status": "CANCELLING", "ResizeType": "ClassicResize", "TargetEncryptionType": "NONE" }For more information, see Resizing a cluster in the Amazon Redshift Cluster Management Guide.
-
For API details, see CancelResize
in AWS CLI Command Reference.
-
The following code example shows how to use copy-cluster-snapshot.
- AWS CLI
-
To copy a cluster snapshot
The following
copy-cluster-snapshotexample creates a copy of the automated snapshotcm:examplecluster-2013-01-22-19-27-58namedmy-saved-snapshot-copy. By default, the output is in JSON format.aws redshift copy-cluster-snapshot \ --source-snapshot-identifiercm:examplecluster-2013-01-22-19-27-58\ --target-snapshot-identifiermy-saved-snapshot-copyOutput:
{ "Snapshot": { "Status": "available", "SnapshotCreateTime": "2013-01-22T19:27:58.931Z", "AvailabilityZone": "us-west-2c", "ClusterVersion": "1.0", "MasterUsername": "adminuser", "DBName": "dev", "ClusterCreateTime": "2013-01-22T19:23:59.368Z", "SnapshotType": "manual", "NodeType": "dw.hs1.xlarge", "ClusterIdentifier": "examplecluster", "Port": 5439, "NumberOfNodes": 2, "SnapshotIdentifier": "my-saved-snapshot-copy" } }For more information, see Copying an automated snapshot in the Amazon Redshift Management Guide.
-
For API details, see CopyClusterSnapshot
in AWS CLI Command Reference.
-
The following code example shows how to use create-cluster-parameter-group.
- AWS CLI
-
To create a cluster parameter group
The following
create-cluster-parameter-groupexample creates a new cluster parameter group.aws redshift create-cluster-parameter-group \ --parameter-group-namemyclusterparametergroup\ --parameter-group-familyredshift-1.0\ --description"My first cluster parameter group"Output:
{ "ClusterParameterGroup": { "ParameterGroupFamily": "redshift-1.0", "Description": "My first cluster parameter group", "ParameterGroupName": "myclusterparametergroup" } }For more information, see Amazon Redshift parameter groups in the Amazon Redshift Management Guide.
-
For API details, see CreateClusterParameterGroup
in AWS CLI Command Reference.
-
The following code example shows how to use create-cluster-security-group.
- AWS CLI
-
To create a cluster security group
The following
create-cluster-security-groupexample creates a new cluster security group. By default, the output is in JSON format.aws redshift create-cluster-security-group \ --cluster-security-group-namemysecuritygroup\ --description"This is my cluster security group"Output:
{ "ClusterSecurityGroup": { "ClusterSecurityGroupName": "mysecuritygroup", "Description": "This is my cluster security group", "EC2SecurityGroups": [], "IPRanges": [], "Tags": [] } }You can also obtain the same information in text format using the
--output textoption.aws redshift create-cluster-security-group \ --cluster-security-group-namemysecuritygroup\ --description"This is my cluster security group"\ --outputtextOutput:
This is my cluster security group 123456789012 mysecuritygroupFor more information, see Infrastructure security in Amazon Redshift in the Amazon Redshift Management Guide.
-
For API details, see CreateClusterSecurityGroup
in AWS CLI Command Reference.
-
The following code example shows how to use create-cluster-snapshot.
- AWS CLI
-
To create a cluster snapshot
The following
create-cluster-snapshotexample creates a new cluster snapshot. By default, the output is in JSON format.aws redshift create-cluster-snapshot \ --cluster-identifiermycluster\ --snapshot-identifiermy-snapshot-idOutput:
{ "Snapshot": { "Status": "creating", "SnapshotCreateTime": "2013-01-22T22:20:33.548Z", "AvailabilityZone": "us-west-2a", "ClusterVersion": "1.0", "MasterUsername": "adminuser", "DBName": "dev", "ClusterCreateTime": "2013-01-22T21:59:29.559Z", "SnapshotType": "manual", "NodeType": "dw.hs1.xlarge", "ClusterIdentifier": "mycluster", "Port": 5439, "NumberOfNodes": 2, "SnapshotIdentifier": "my-snapshot-id" } }For more information, see Creating a manual snapshot in the Amazon Redshift Management Guide.
-
For API details, see CreateClusterSnapshot
in AWS CLI Command Reference.
-
The following code example shows how to use create-cluster-subnet-group.
- AWS CLI
-
To create a cluster subnet group
The following
create-cluster-subnet-groupexample creates a new cluster subnet group.aws redshift create-cluster-subnet-group \ --cluster-subnet-group-namemysubnetgroup\ --description"My subnet group"\ --subnet-idssubnet-763fdd1cOutput:
{ "ClusterSubnetGroup": { "Subnets": [ { "SubnetStatus": "Active", "SubnetIdentifier": "subnet-763fdd1c", "SubnetAvailabilityZone": { "Name": "us-west-2a" } } ], "VpcId": "vpc-7e3fdd14", "SubnetGroupStatus": "Complete", "Description": "My subnet group", "ClusterSubnetGroupName": "mysubnetgroup" } }For more information, see Subnets for Redshift resources in the Amazon Redshift Management Guide.
-
For API details, see CreateClusterSubnetGroup
in AWS CLI Command Reference.
-
The following code example shows how to use create-cluster.
- AWS CLI
-
To create a cluster with minimal parameters
The following
create-clusterexample creates a cluster with the minimal set of parameters. By default, the output is in JSON format.aws redshift create-cluster \ --node-typedw.hs1.xlarge\ --number-of-nodes2\ --master-usernameadminuser\ --master-user-passwordTopSecret1\ --cluster-identifiermyclusterOutput:
{ "Cluster": { "NodeType": "dw.hs1.xlarge", "ClusterVersion": "1.0", "PubliclyAccessible": true, "MasterUsername": "adminuser", "ClusterParameterGroups": [ { "ParameterApplyStatus": "in-sync", "ParameterGroupName": "default.redshift-1.0" } ], "ClusterSecurityGroups": [ { "Status": "active", "ClusterSecurityGroupName": "default" } ], "AllowVersionUpgrade": true, "VpcSecurityGroups": [], "PreferredMaintenanceWindow": "sat:03:30-sat:04:00", "AutomatedSnapshotRetentionPeriod": 1, "ClusterStatus": "creating", "ClusterIdentifier": "mycluster", "DBName": "dev", "NumberOfNodes": 2, "PendingModifiedValues": { "MasterUserPassword": "****" } } }For more information, see Creating a cluster in the Amazon Redshift Management Guide.
-
For API details, see CreateCluster
in AWS CLI Command Reference.
-
The following code example shows how to use create-event-subscription.
- AWS CLI
-
To create a notification subscription for an event
The following
create-event-subscriptionexample creates an event notification subscription.aws redshift create-event-subscription \ --subscription-namemysubscription\ --sns-topic-arnarn:aws:sns:us-west-2:123456789012:MySNStopic\ --source-typecluster\ --source-idsmyclusterOutput:
{ "EventSubscription": { "CustomerAwsId": "123456789012", "CustSubscriptionId": "mysubscription", "SnsTopicArn": "arn:aws:sns:us-west-2:123456789012:MySNStopic", "Status": "active", "SubscriptionCreationTime": "2019-12-09T20:05:19.365Z", "SourceType": "cluster", "SourceIdsList": [ "mycluster" ], "EventCategoriesList": [], "Severity": "INFO", "Enabled": true, "Tags": [] } }For more information, see Subscribing to Amazon Redshift Event Notifications in the Amazon Redshift Cluster Management Guide.
-
For API details, see CreateEventSubscription
in AWS CLI Command Reference.
-
The following code example shows how to use create-hsm-client-certificate.
- AWS CLI
-
To create an HSM client certificate
The following
create-hsm-client-certificateexample generates an HSM client certificate that a cluster can use to connect to an HSM.aws redshift create-hsm-client-certificate \ --hsm-client-certificate-identifiermyhsmclientcertOutput:
{ "HsmClientCertificate": { "HsmClientCertificateIdentifier": "myhsmclientcert", "HsmClientCertificatePublicKey": "-----BEGIN CERTIFICATE-----\nMIICiEXAMPLECQD6m7oRw0uXOjANBgkqhkiG9w0BAQUFADCBiDELMAkGA1UEBhMC\nVVMxCzAJBgNVBAgTEXAMPLEwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6\nb24xFDASBgNVBAsTC0lBTSBDb25EXAMPLEIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAd\nBgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5jb2EXAMPLETEwNDI1MjA0NTIxWhcN\nMTIwNDI0MjA0NTIxWjCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBEXAMPLEMRAwDgYD\nEXAMPLETZWF0dGxlMQ8wDQYDVQQKEwZBbWF6b24xFDASBgNVBAsTC0lBTSBDb25z\nb2xlMRIwEAEXAMPLEwlUZXN0Q2lsYWMxHzAdBgkqhkiG9w0BCQEWEG5vb25lQGFt\nYXpvbi5jb20wgZ8wDQYJKEXAMPLEAQEBBQADgY0AMIGJAoGBAMaK0dn+a4GmWIWJ\n21uUSfwfEvySWtC2XADZ4nB+BLYgVIk6EXAMPLE3G93vUEIO3IyNoH/f0wYK8m9T\nrDHudUZg3qX4waLG5M43q7Wgc/MbQITxOUSQv7c7ugEXAMPLEzZswY6786m86gpE\nIbb3OhjZnzcvQAaRHhdlQWIMm2nrAgMBAAEwDQYJKoZIhvcNAQEEXAMPLEEAtCu4\nnUhVVxYUEXAMPLEh8Mg9q6q+auNKyExzyLwaxlAoo7TJHidbtS4J5iNmZgXL0Fkb\nFFBjvSfpJIlJ00zbhNYS5f6GEXAMPLEl0ZxBHjJnyp378OD8uTs7fLvjx79LjSTb\nNYiytVbZPQUQ5Yaxu2jXnimvw3rEXAMPLE=\n-----END CERTIFICATE-----\n", "Tags": [] } }For more information, see Amazon Redshift API Permissions Reference in the Amazon Redshift Cluster Management Guide.
-
For API details, see CreateHsmClientCertificate
in AWS CLI Command Reference.
-
The following code example shows how to use create-hsm-configuration.
- AWS CLI
-
To create an HSM configuration
The following
create-hsm-configurationexample creates the specified HSM configuration that contains information required by a cluster to store and use database encryption keys in a hardware security module (HSM).aws redshift create-hsm-configuration \ --hsm-configuration-identifiermyhsmconnection\ --description"My HSM connection"\ --hsm-ip-address192.0.2.09\ --hsm-partition-namemyhsmpartition\ --hsm-partition-passwordA1b2c3d4\ --hsm-server-public-certificatemyhsmclientcertOutput:
{ "HsmConfiguration": { "HsmConfigurationIdentifier": "myhsmconnection", "Description": "My HSM connection", "HsmIpAddress": "192.0.2.09", "HsmPartitionName": "myhsmpartition", "Tags": [] } }For more information, see Amazon Redshift database encryption in the Amazon Redshift Management Guide.
-
For API details, see CreateHsmConfiguration
in AWS CLI Command Reference.
-
The following code example shows how to use create-snapshot-copy-grant.
- AWS CLI
-
To create a snapshot copy grant
The following
create-snapshot-copy-grantexample creates a snapshot copy grant and encrypts copied snapshots in a destination AWS Region.aws redshift create-snapshot-copy-grant \ --snapshot-copy-grant-namemysnapshotcopygrantnameOutput:
{ "SnapshotCopyGrant": { "SnapshotCopyGrantName": "mysnapshotcopygrantname", "KmsKeyId": "arn:aws:kms:us-west-2:123456789012:key/bPxRfih3yCo8nvbEXAMPLEKEY", "Tags": [] } }For more information, see Amazon Redshift Database Encryption in the Amazon Redshift Cluster Management Guide.
-
For API details, see CreateSnapshotCopyGrant
in AWS CLI Command Reference.
-
The following code example shows how to use create-snapshot-schedule.
- AWS CLI
-
To create snapshot schedule
The following
create-snapshot-scheduleexample creates a snapshot schedule with the specified description and a rate of every 12 hours.aws redshift create-snapshot-schedule \ --schedule-definitions"rate(12 hours)"\ --schedule-identifiermysnapshotschedule\ --schedule-description"My schedule description"Output:
{ "ScheduleDefinitions": [ "rate(12 hours)" ], "ScheduleIdentifier": "mysnapshotschedule", "ScheduleDescription": "My schedule description", "Tags": [] }For more information, see Automated Snapshot Schedules in the Amazon Redshift Cluster Management Guide.
-
For API details, see CreateSnapshotSchedule
in AWS CLI Command Reference.
-
The following code example shows how to use create-tags.
- AWS CLI
-
To create tags for a cluster
The following
create-tagsexample adds the specified tag key/value pair to the specified cluster.aws redshift create-tags \ --resource-namearn:aws:redshift:us-west-2:123456789012:cluster:mycluster\ --tags "Key"="mytags","Value"="tag1"This command produces no output.
For more information, see Tagging Resources in Amazon Redshift in the Amazon Redshift Cluster Management Guide.
-
For API details, see CreateTags
in AWS CLI Command Reference.
-
The following code example shows how to use delete-cluster-parameter-group.
- AWS CLI
-
To delete a cluster parameter group
The following
delete-cluster-parameter-groupexample deletes a cluster parameter group.aws redshift delete-cluster-parameter-group \ --parameter-group-namemyclusterparametergroupThis command produces no output.
For more information, see Amazon Redshift parameter groups in the Amazon Redshift Management Guide.
-
For API details, see DeleteClusterParameterGroup
in AWS CLI Command Reference.
-
The following code example shows how to use delete-cluster-security-group.
- AWS CLI
-
To delete a cluster security group
The following
delete-cluster-security-groupexample deletes a cluster security group.aws redshift delete-cluster-security-group \ --cluster-security-group-namemysecuritygroupThis command produces no output.
For more information, see Infrastructure security in Amazon Redshift in the Amazon Redshift Management Guide.
-
For API details, see DeleteClusterSecurityGroup
in AWS CLI Command Reference.
-
The following code example shows how to use delete-cluster-snapshot.
- AWS CLI
-
To delete a cluster snapshot
The following
delete-cluster-snapshotexample deletes a cluster snapshot.aws redshift delete-cluster-snapshot \ --snapshot-identifiermy-snapshot-idOutput:
{ "Snapshot": { "SnapshotIdentifier": "my-snapshot-id", "ClusterIdentifier": "mycluster", "SnapshotCreateTime": "2013-01-22T22:20:33.548Z", "Status": "deleted", "Port": 5439, "AvailabilityZone": "us-west-2a", "ClusterCreateTime": "2013-01-22T21:59:29.559Z", "MasterUsername": "adminuser", "ClusterVersion": "1.0", "SnapshotType": "manual", "NodeType": "dc2.large", "NumberOfNodes": 2, "DBName": "dev", "Encrypted": false, "EncryptedWithHSM": false, "OwnerAccount": "123456789012", "TotalBackupSizeInMegaBytes": 20.0, "ActualIncrementalBackupSizeInMegaBytes": 20.0, "BackupProgressInMegaBytes": 20.0, "CurrentBackupRateInMegaBytesPerSecond": 0.0, "EstimatedSecondsToCompletion": -1, "ElapsedTimeInSeconds": 0, "Tags": [], "EnhancedVpcRouting": false, "MaintenanceTrackName": "current", "ManualSnapshotRetentionPeriod": -1 } }For more information, see Deleting a manual snapshot in the Amazon Redshift Management Guide.
-
For API details, see DeleteClusterSnapshot
in AWS CLI Command Reference.
-
The following code example shows how to use delete-cluster-subnet-group.
- AWS CLI
-
To delete a cluster subnet group
The following
delete-cluster-subnet-groupexample deletes a cluster subnet group.aws redshift delete-cluster-subnet-group \ --cluster-subnet-group-namemysubnetgroupThis command produces no output.
For more information, see Subnets for Redshift resources in the Amazon Redshift Management Guide.
-
For API details, see DeleteClusterSubnetGroup
in AWS CLI Command Reference.
-
The following code example shows how to use delete-cluster.
- AWS CLI
-
Example 1: To delete a cluster with no final cluster snapshot
The following
delete-clusterexample deletes a cluster, forcing data deletion so no final cluster snapshot is created.aws redshift delete-cluster \ --cluster-identifiermycluster\ --skip-final-cluster-snapshotOutput:
{ "Cluster": { "ClusterIdentifier": "mycluster", "NodeType": "dc2.large", "ClusterStatus": "deleting", "ClusterAvailabilityStatus": "Modifying", "MasterUsername": "adminuser", "DBName": "dev", "Endpoint": { "Address": "mycluster.c1a2b3c4d5e6.us-west-2.redshift.amazonaws.com", "Port": 5439 }, "ClusterCreateTime": "2019-12-23T21:42:51.430Z", "AutomatedSnapshotRetentionPeriod": 1, "ManualSnapshotRetentionPeriod": -1, "ClusterSecurityGroups": [], "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sg-0a1b2c3d4e5f6a7b8", "Status": "active" } ], "ClusterParameterGroups": [ { "ParameterGroupName": "default.redshift-1.0", "ParameterApplyStatus": "in-sync" } ], "ClusterSubnetGroupName": "default", "VpcId": "vpc-0a1b2c3d4e5f6a7b8", "AvailabilityZone": "us-west-2a", "PreferredMaintenanceWindow": "sat:03:30-sat:04:00", "PendingModifiedValues": {}, "ClusterVersion": "1.0", "AllowVersionUpgrade": true, "NumberOfNodes": 2, "PubliclyAccessible": false, "Encrypted": false, "Tags": [], "EnhancedVpcRouting": false, "IamRoles": [], "MaintenanceTrackName": "current", "DeferredMaintenanceWindows": [], "NextMaintenanceWindowStartTime": "2019-12-28T03:30:00Z" } }For more information, see Shutting down and deleting a cluster in the Amazon Redshift Management Guide.
Example 2: To delete a cluster, allowing a final cluster snapshot
The following
delete-clusterexample deletes a cluster, but specifies a final cluster snapshot.aws redshift delete-cluster \ --cluster-identifiermycluster\ --final-cluster-snapshot-identifiermyfinalsnapshotOutput:
{ "Cluster": { "ClusterIdentifier": "mycluster", "NodeType": "dc2.large", "ClusterStatus": "deleting", "ClusterAvailabilityStatus": "Modifying", "MasterUsername": "adminuser", "DBName": "dev", "Endpoint": { "Address": "mycluster.c1a2b3c4d5e6.us-west-2.redshift.amazonaws.com", "Port": 5439 }, "ClusterCreateTime": "2019-12-23T21:42:51.430Z", "AutomatedSnapshotRetentionPeriod": 1, "ManualSnapshotRetentionPeriod": -1, "ClusterSecurityGroups": [], "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sg-0a1b2c3d4e5f6a7b8", "Status": "active" } ], "ClusterParameterGroups": [ { "ParameterGroupName": "default.redshift-1.0", "ParameterApplyStatus": "in-sync" } ], "ClusterSubnetGroupName": "default", "VpcId": "vpc-0a1b2c3d4e5f6a7b8", "AvailabilityZone": "us-west-2a", "PreferredMaintenanceWindow": "sat:03:30-sat:04:00", "PendingModifiedValues": {}, "ClusterVersion": "1.0", "AllowVersionUpgrade": true, "NumberOfNodes": 2, "PubliclyAccessible": false, "Encrypted": false, "Tags": [], "EnhancedVpcRouting": false, "IamRoles": [], "MaintenanceTrackName": "current", "DeferredMaintenanceWindows": [], "NextMaintenanceWindowStartTime": "2019-12-28T03:30:00Z" } }For more information, see Shutting down and deleting a cluster in the Amazon Redshift Management Guide.
-
For API details, see DeleteCluster
in AWS CLI Command Reference.
-
The following code example shows how to use delete-event-subscription.
- AWS CLI
-
To delete event subscription
The following
delete-event-subscriptionexample deletes the specified event notification subscription.aws redshift delete-event-subscription \ --subscription-namemysubscriptionThis command produces no output.
For more information, see Subscribing to Amazon Redshift Event Notifications in the Amazon Redshift Cluster Management Guide.
-
For API details, see DeleteEventSubscription
in AWS CLI Command Reference.
-
The following code example shows how to use delete-hsm-client-certificate.
- AWS CLI
-
To delete HSM client certificate
The following
delete-hsm-client-certificateexample deletes an HSM client certificate.aws redshift delete-hsm-client-certificate \ --hsm-client-certificate-identifiermyhsmclientcertThis command produces no output.
For more information, see Amazon Redshift API Permissions Reference in the Amazon Redshift Cluster Management Guide.
-
For API details, see DeleteHsmClientCertificate
in AWS CLI Command Reference.
-
The following code example shows how to use delete-hsm-configuration.
- AWS CLI
-
To delete an HSM configuration
The following
delete-hsm-configurationexample deletes the specified HSM configuration from the current AWS account.aws redshift delete-hsm-configuration \ --hsm-configuration-identifiermyhsmconnectionThis command produces no output.
For more information, see Amazon Redshift database encryption in the Amazon Redshift Management Guide.
-
For API details, see DeleteHsmConfiguration
in AWS CLI Command Reference.
-
The following code example shows how to use delete-scheduled-action.
- AWS CLI
-
To delete scheduled action
The following
delete-scheduled-actionexample deletes the specified scheduled action.aws redshift delete-scheduled-action \ --scheduled-action-namemyscheduledactionThis command produces no output.
For more information, see Scheduling a resize in the Amazon Redshift Management Guide.
-
For API details, see DeleteScheduledAction
in AWS CLI Command Reference.
-
The following code example shows how to use delete-snapshot-copy-grant.
- AWS CLI
-
To delete snapshot copy grant
The following
delete-snapshot-copy-grantexample deletes the specified snapshot copy grant.aws redshift delete-snapshot-copy-grant \ --snapshot-copy-grant-namemysnapshotcopygrantnameThis command produces no output.
For more information, see Amazon Redshift Database Encryption in the Amazon Redshift Cluster Management Guide.
-
For API details, see DeleteSnapshotCopyGrant
in AWS CLI Command Reference.
-
The following code example shows how to use delete-snapshot-schedule.
- AWS CLI
-
To delete snapshot schedule
The following
delete-snapshot-scheduleexample deletes the specified snapshot schedule. You must disassociate clusters before deleting the schedule.aws redshift delete-snapshot-schedule \ --schedule-identifiermysnapshotscheduleThis command produces no output.
For more information, see Automated Snapshot Schedules in the Amazon Redshift Cluster Management Guide.
-
For API details, see DeleteSnapshotSchedule
in AWS CLI Command Reference.
-
The following code example shows how to use delete-tags.
- AWS CLI
-
To delete tags from a cluster
The following
delete-tagsexample deletes the tags with the specified key names from the specified cluster.aws redshift delete-tags \ --resource-namearn:aws:redshift:us-west-2:123456789012:cluster:mycluster\ --tag-keys"clustertagkey""clustertagvalue"This command produces no output.
For more information, see Tagging Resources in Amazon Redshift in the Amazon Redshift Cluster Management Guide.
-
For API details, see DeleteTags
in AWS CLI Command Reference.
-
The following code example shows how to use describe-account-attributes.
- AWS CLI
-
To describe attributes of an AWS account
The following
describe-account-attributesexample displays the attributes attached to the calling AWS account.aws redshift describe-account-attributesOutput:
{ "AccountAttributes": [ { "AttributeName": "max-defer-maintenance-duration", "AttributeValues": [ { "AttributeValue": "45" } ] } ] }For more information, see Considerations for using Amazon Redshift provisioned clusters in the Amazon Redshift Management Guide.
-
For API details, see DescribeAccountAttributes
in AWS CLI Command Reference.
-
The following code example shows how to use describe-cluster-db-revisions.
- AWS CLI
-
To describe DB revisions for a cluster
The following
describe-cluster-db-revisionsexample displays the details of an array ofClusterDbRevisionobjects for the specified cluster.aws redshift describe-cluster-db-revisions \ --cluster-identifiermyclusterOutput:
{ "ClusterDbRevisions": [ { "ClusterIdentifier": "mycluster", "CurrentDatabaseRevision": "11420", "DatabaseRevisionReleaseDate": "2019-11-22T16:43:49.597Z", "RevisionTargets": [] } ] }For more information, see Cluster versions for Amazon Redshift in the Amazon Redshift Management Guide.
-
For API details, see DescribeClusterDbRevisions
in AWS CLI Command Reference.
-
The following code example shows how to use describe-cluster-parameter-groups.
- AWS CLI
-
To get a description of all cluster parameter groups
The following
describe-cluster-parameter-groupsexample returns a description of all cluster parameter groups for the account, with column headers. By default, the output is in JSON format.aws redshift describe-cluster-parameter-groupsOutput:
{ "ParameterGroups": [ { "ParameterGroupFamily": "redshift-1.0", "Description": "My first cluster parameter group", "ParameterGroupName": "myclusterparametergroup" } ] }You can also obtain the same information in text format using the
--output textoption.aws redshift describe-cluster-parameter-groups \ --outputtextOutput:
redshift-1.0 My first cluster parameter group myclusterparametergroupFor more information, see Amazon Redshift parameter groups in the Amazon Redshift Management Guide.
-
For API details, see DescribeClusterParameterGroups
in AWS CLI Command Reference.
-
The following code example shows how to use describe-cluster-parameters.
- AWS CLI
-
To retrieve the parameters for a specified cluster parameter group
The following
describe-cluster-parametersexample retrieves the parameters for the named parameter group. By default, the output is in JSON format.aws redshift describe-cluster-parameters \ --parameter-group-namemyclusterparametergroupOutput:
{ "Parameters": [ { "Description": "Sets the display format for date and time values.", "DataType": "string", "IsModifiable": true, "Source": "engine-default", "ParameterValue": "ISO, MDY", "ParameterName": "datestyle" }, { "Description": "Sets the number of digits displayed for floating-point values", "DataType": "integer", "IsModifiable": true, "AllowedValues": "-15-2", "Source": "engine-default", "ParameterValue": "0", "ParameterName": "extra_float_digits" } ] }You can also obtain the same information in text format using the
--output textoption.aws redshift describe-cluster-parameters \ --parameter-group-namemyclusterparametergroup\ --outputtextOutput:
RESPONSEMETADATA a1b2c3d4-5678-90ab-cdef-EXAMPLE11111 Sets the display format for date and time values. string True engine-default ISO, MDY datestyle Sets the number of digits displayed for floating-point values integer True -15-2 engine-default 0 extra_float_digits This parameter applies a user-defined label to a group of queries that are run during the same session.. string True engine-default default query_group require ssl for all databaseconnections boolean True true,false engine-default false require_ssl Sets the schema search order for names that are not schema-qualified. string True engine-default $user, public search_path Aborts any statement that takes over the specified number of milliseconds. integer True engine-default 0 statement_timeout wlm json configuration string True engine-default \[{"query_concurrency":5}] wlm_json_configurationFor more information, see Amazon Redshift parameter groups in the Amazon Redshift Management Guide.
-
For API details, see DescribeClusterParameters
in AWS CLI Command Reference.
-
The following code example shows how to use describe-cluster-security-groups.
- AWS CLI
-
To get a description of all cluster security groups
The following
describe-cluster-security-groupsexample returns a description of all cluster security groups for the account. By default, the output is in JSON format.aws redshift describe-cluster-security-groupsOutput:
{ "ClusterSecurityGroups": [ { "Description": "default", "ClusterSecurityGroupName": "default", "EC2SecurityGroups": [], "IPRanges": [ { "Status": "authorized", "CIDRIP": "0.0.0.0/0" } ] }, { "Description": "This is my cluster security group", "ClusterSecurityGroupName": "mysecuritygroup", "EC2SecurityGroups": [], "IPRanges": [] } ] }For more information, see Infrastructure security in Amazon Redshift in the Amazon Redshift Management Guide.
-
For API details, see DescribeClusterSecurityGroups
in AWS CLI Command Reference.
-
The following code example shows how to use describe-cluster-snapshots.
- AWS CLI
-
To get a description of all cluster snapshots
The following
describe-cluster-snapshotsexample returns a description of all cluster snapshots for the account. By default, the output is in JSON format.aws redshift describe-cluster-snapshotsOutput:
{ "Snapshots": [ { "Status": "available", "SnapshotCreateTime": "2013-07-17T22:02:22.852Z", "EstimatedSecondsToCompletion": -1, "AvailabilityZone": "us-west-2a", "ClusterVersion": "1.0", "MasterUsername": "adminuser", "Encrypted": false, "OwnerAccount": "123456789012", "BackupProgressInMegaBytes": 20.0, "ElapsedTimeInSeconds": 0, "DBName": "dev", "CurrentBackupRateInMegaBytesPerSecond": 0.0, "ClusterCreateTime": "2013-01-22T21:59:29.559Z", "ActualIncrementalBackupSizeInMegaBytes": 20.0, "SnapshotType": "automated", "NodeType": "dw.hs1.xlarge", "ClusterIdentifier": "mycluster", "Port": 5439, "TotalBackupSizeInMegaBytes": 20.0, "NumberOfNodes": 2, "SnapshotIdentifier": "cm:mycluster-2013-01-22-22-04-18" }, { "EstimatedSecondsToCompletion": 0, "OwnerAccount": "123456789012", "CurrentBackupRateInMegaBytesPerSecond": 0.1534, "ActualIncrementalBackupSizeInMegaBytes": 11.0, "NumberOfNodes": 2, "Status": "available", "ClusterVersion": "1.0", "MasterUsername": "adminuser", "AccountsWithRestoreAccess": [ { "AccountId": "123456789111" } ], "TotalBackupSizeInMegaBytes": 20.0, "DBName": "dev", "BackupProgressInMegaBytes": 11.0, "ClusterCreateTime": "2013-01-22T21:59:29.559Z", "ElapsedTimeInSeconds": 0, "ClusterIdentifier": "mycluster", "SnapshotCreateTime": "2013-07-17T22:04:18.947Z", "AvailabilityZone": "us-west-2a", "NodeType": "dw.hs1.xlarge", "Encrypted": false, "SnapshotType": "manual", "Port": 5439, "SnapshotIdentifier": "my-snapshot-id" } ] }For more information, see Amazon Redshift snapshots and backups in the Amazon Redshift Management Guide.
-
For API details, see DescribeClusterSnapshots
in AWS CLI Command Reference.
-
The following code example shows how to use describe-cluster-subnet-groups.
- AWS CLI
-
To get a description of all cluster subnet groups
The following
describe-cluster-subnet-groupsexample returns a description of all cluster subnet groups. By default, the output is in JSON format.aws redshift describe-cluster-subnet-groupsOutput:
{ "ClusterSubnetGroups": [ { "Subnets": [ { "SubnetStatus": "Active", "SubnetIdentifier": "subnet-763fdd1c", "SubnetAvailabilityZone": { "Name": "us-west-2a" } } ], "VpcId": "vpc-7e3fdd14", "SubnetGroupStatus": "Complete", "Description": "My subnet group", "ClusterSubnetGroupName": "mysubnetgroup" } ] }For more information, see Subnets for Redshift resources in the Amazon Redshift Management Guide.
-
For API details, see DescribeClusterSubnetGroups
in AWS CLI Command Reference.
-
The following code example shows how to use describe-cluster-tracks.
- AWS CLI
-
To describe cluster tracks
The following
describe-cluster-tracksexample displays details of the available maintenance tracks.aws redshift describe-cluster-tracks \ --maintenance-track-namecurrentOutput:
{ "MaintenanceTracks": [ { "MaintenanceTrackName": "current", "DatabaseVersion": "1.0.11420", "UpdateTargets": [ { "MaintenanceTrackName": "preview_features", "DatabaseVersion": "1.0.11746", "SupportedOperations": [ { "OperationName": "restore-from-cluster-snapshot" } ] }, { "MaintenanceTrackName": "trailing", "DatabaseVersion": "1.0.11116", "SupportedOperations": [ { "OperationName": "restore-from-cluster-snapshot" }, { "OperationName": "modify-cluster" } ] } ] } ] }For more information, see Choosing Cluster Maintenance Tracks in the Amazon Redshift Cluster Management Guide.
-
For API details, see DescribeClusterTracks
in AWS CLI Command Reference.
-
The following code example shows how to use describe-cluster-versions.
- AWS CLI
-
To get a description of all cluster versions
The following
describe-cluster-versionsexample returns a description of all cluster versions. By default, the output is in JSON format.aws redshift describe-cluster-versionsOutput:
{ "ClusterVersions": [ { "ClusterVersion": "1.0", "Description": "Initial release", "ClusterParameterGroupFamily": "redshift-1.0" } ] }For more information, see Cluster versions for Amazon Redshift in the Amazon Redshift Management Guide.
-
For API details, see DescribeClusterVersions
in AWS CLI Command Reference.
-
The following code example shows how to use describe-clusters.
- AWS CLI
-
To get a description of all clusters
The following
describe-clustersexample returns a description of all clusters for the account. By default, the output is in JSON format.aws redshift describe-clustersOutput:
{ "Clusters": [ { "NodeType": "dw.hs1.xlarge", "Endpoint": { "Port": 5439, "Address": "mycluster.coqoarplqhsn.us-west-2.redshift.amazonaws.com" }, "ClusterVersion": "1.0", "PubliclyAccessible": true, "MasterUsername": "adminuser", "ClusterParameterGroups": [ { "ParameterApplyStatus": "in-sync", "ParameterGroupName": "default.redshift-1.0" } ], "ClusterSecurityGroups": [ { "Status": "active", "ClusterSecurityGroupName": "default" } ], "AllowVersionUpgrade": true, "VpcSecurityGroups": [], "AvailabilityZone": "us-west-2a", "ClusterCreateTime": "2013-01-22T21:59:29.559Z", "PreferredMaintenanceWindow": "sat:03:30-sat:04:00", "AutomatedSnapshotRetentionPeriod": 1, "ClusterStatus": "available", "ClusterIdentifier": "mycluster", "DBName": "dev", "NumberOfNodes": 2, "PendingModifiedValues": {} } ] }You can also obtain the same information in text format using the
--output textoption.aws redshift describe-clusters \ --outputtextOutput:
dw.hs1.xlarge 1.0 true adminuser True us-west-2a 2013-01-22T21:59:29.559Z sat:03:30-sat:04:00 1 available mycluster dev 2 ENDPOINT 5439 mycluster.coqoarplqhsn.us-west-2.redshift.amazonaws.com in-sync default.redshift-1.0 active default PENDINGMODIFIEDVALUESFor more information, see Amazon Redshift provisioned clusters in the Amazon Redshift Management Guide.
-
For API details, see DescribeClusters
in AWS CLI Command Reference.
-
The following code example shows how to use describe-default-cluster-parameters.
- AWS CLI
-
To get a description of default cluster parameters
The following
describe-default-cluster-parametersexample returns a description of the default cluster parameters for theredshift-1.0family. By default, the output is in JSON format.aws redshift describe-default-cluster-parameters \ --parameter-group-familyredshift-1.0Output:
{ "DefaultClusterParameters": { "ParameterGroupFamily": "redshift-1.0", "Parameters": [ { "Description": "Sets the display format for date and time values.", "DataType": "string", "IsModifiable": true, "Source": "engine-default", "ParameterValue": "ISO, MDY", "ParameterName": "datestyle" }, { "Description": "Sets the number of digits displayed for floating-point values", "DataType": "integer", "IsModifiable": true, "AllowedValues": "-15-2", "Source": "engine-default", "ParameterValue": "0", "ParameterName": "extra_float_digits" } ] } }To see a list of valid parameter group families, use the
describe-cluster-parameter-groupscommand.For more information, see Amazon Redshift parameter groups in the Amazon Redshift Management Guide.
-
For API details, see DescribeDefaultClusterParameters
in AWS CLI Command Reference.
-
The following code example shows how to use describe-event-categories.
- AWS CLI
-
To describe event categories for a cluster
The following
describe-event-categoriesexample displays details for the event categories for a cluster.aws redshift describe-event-categories \ --source-typeclusterOutput:
{ "EventCategoriesMapList": [ { "SourceType": "cluster", "Events": [ { "EventId": "REDSHIFT-EVENT-2000", "EventCategories": [ "management" ], "EventDescription": "Cluster <cluster name> created at <time in UTC>.", "Severity": "INFO" }, { "EventId": "REDSHIFT-EVENT-2001", "EventCategories": [ "management" ], "EventDescription": "Cluster <cluster name> deleted at <time in UTC>.", "Severity": "INFO" }, { "EventId": "REDSHIFT-EVENT-3625", "EventCategories": [ "monitoring" ], "EventDescription": "The cluster <cluster name> can't be resumed with its previous elastic network interface <ENI id>. We will allocate a new elastic network interface and associate it with the cluster node.", "Severity": "INFO" } ] } ] }For more information, see Amazon Redshift provisioned cluster event notifications in the Amazon Redshift Management Guide.
-
For API details, see DescribeEventCategories
in AWS CLI Command Reference.
-
The following code example shows how to use describe-event-subscriptions.
- AWS CLI
-
To describe event subscriptions
The following
describe-event-subscriptionsexample displays event notification subscriptions for the specified subscription.aws redshift describe-event-subscriptions \ --subscription-namemysubscriptionOutput:
{ "EventSubscriptionsList": [ { "CustomerAwsId": "123456789012", "CustSubscriptionId": "mysubscription", "SnsTopicArn": "arn:aws:sns:us-west-2:123456789012:MySNStopic", "Status": "active", "SubscriptionCreationTime": "2019-12-09T21:50:21.332Z", "SourceIdsList": [], "EventCategoriesList": [ "management" ], "Severity": "ERROR", "Enabled": true, "Tags": [] } ] }For more information, see Subscribing to Amazon Redshift Event Notifications in the Amazon Redshift Cluster Management Guide.
-
For API details, see DescribeEventSubscriptions
in AWS CLI Command Reference.
-
The following code example shows how to use describe-events.
- AWS CLI
-
To describe all events
The following
describe-eventsexample returns all events. By default, the output is in JSON format.aws redshift describe-eventsOutput:
{ "Events": [ { "Date": "2013-01-22T19:17:03.640Z", "SourceIdentifier": "myclusterparametergroup", "Message": "Cluster parameter group myclusterparametergroup has been created.", "SourceType": "cluster-parameter-group" } ] }You can also obtain the same information in text format using the
--output textoption.aws redshift describe-events \ --outputtextOutput:
2013-01-22T19:17:03.640Z myclusterparametergroup Cluster parameter group myclusterparametergroup has been created. cluster-parameter-groupFor more information, see Amazon Redshift events in the Amazon Redshift Management Guide.
-
For API details, see DescribeEvents
in AWS CLI Command Reference.
-
The following code example shows how to use describe-hsm-client-certificates.
- AWS CLI
-
To describe HSM client certificates
The following
describe-hsm-client-certificatesexample displays details for the specified HSM client certificate.aws redshift describe-hsm-client-certificates \ --hsm-client-certificate-identifiermyhsmclientcertOutput:
{ "HsmClientCertificates": [ { "HsmClientCertificateIdentifier": "myhsmclientcert", "HsmClientCertificatePublicKey": "-----BEGIN CERTIFICATE-----\nEXAMPLECAfICCQD6m7oRw0uXOjANBgkqhkiG9w0BAQUFADCBiDELMAkGA1UEBhMC\nVVMxCzAJBgNVBAEXAMPLERAwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6\nb24xFDASBgNVBAsTC0lBTSBDb25zEXAMPLEwEAYDVQQDEwlUZXN0Q2lsYWMxHzAd\nBgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5jb20wHhEXAMPLEDI1MjA0EXAMPLEN\nEXAMPLE0MjA0NTIxWjCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAwDgYD\nVQQHEwdTZWF0dGEXAMPLEQYDVQQKEwZBbWF6b24xFDASBgNVBAsTC0lBTSBDb25z\nb2xlMRIwEAYDVQQDEwlUZXN0Q2lsEXAMPLEdBgkqhkiG9w0BCQEWEG5vb25lQGFt\nYXpvbi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIEXAMPLEMaK0dn+a4GmWIWJ\n21uUSfwfEvySWtC2XADZ4nB+BLYgVIk60CpiwsZ3G93vUEIO3IyNoH/f0wYK8m9T\nrDHudUZg3qX4waLG5M43q7Wgc/MbQITxOUSQv7c7ugFFDzQGBzZswY67EXAMPLEE\nEXAMPLEZnzcvQAaRHhdlQWIMm2nrAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAtCu4\nnUhVVxYUntneD9EXAMPLE6q+auNKyExzyLwaxlAoo7TJHidbtS4J5iNmZgXL0Fkb\nFFBjvSfpJIlJ00zbhNYS5f6GuoEDEXAMPLEBHjJnyp378OD8uTs7fLvjx79LjSTb\nNYiytVbZPQUQ5Yaxu2jXnimvw3rEXAMPLE=\n-----END CERTIFICATE-----\n", "Tags": [] } ] }For more information, see Amazon Redshift API Permissions Reference in the Amazon Redshift Cluster Management Guide.
-
For API details, see DescribeHsmClientCertificates
in AWS CLI Command Reference.
-
The following code example shows how to use describe-hsm-configurations.
- AWS CLI
-
To describe HSM configurations
The following
describe-hsm-configurationsexample displays details for the available HSM configurations for the calling AWS account.aws redshift describe-hsm-configurations \ --hsm-configuration-identifiermyhsmconnectionOutput:
{ "HsmConfigurations": [ { "HsmConfigurationIdentifier": "myhsmconnection", "Description": "My HSM connection", "HsmIpAddress": "192.0.2.09", "HsmPartitionName": "myhsmpartition", "Tags": [] } ] }For more information, see Encryption using hardware security modules in the Amazon Redshift Management Guide.
-
For API details, see DescribeHsmConfigurations
in AWS CLI Command Reference.
-
The following code example shows how to use describe-logging-status.
- AWS CLI
-
To describe logging status for a cluster
The following
describe-logging-statusexample displays whether information, such as queries and connection attempts, is being logged for a cluster.aws redshift describe-logging-status \ --cluster-identifiermyclusterOutput:
{ "LoggingEnabled": false }For more information, see Database Audit Logging in the Amazon Redshift Cluster Management Guide.
-
For API details, see DescribeLoggingStatus
in AWS CLI Command Reference.
-
The following code example shows how to use describe-node-configuration-options.
- AWS CLI
-
To describe node configuration options
The following
describe-node-configuration-optionsexample displays the properties of possible node configurations such as node type, number of nodes, and disk usage for the specified cluster snapshot.aws redshift describe-node-configuration-options \ --action-typerestore-cluster\ --snapshot-identifierrs:mycluster-2019-12-09-16-42-43Output:
{ "NodeConfigurationOptionList": [ { "NodeType": "dc2.large", "NumberOfNodes": 2, "EstimatedDiskUtilizationPercent": 19.61 }, { "NodeType": "dc2.large", "NumberOfNodes": 4, "EstimatedDiskUtilizationPercent": 9.96 }, { "NodeType": "ds2.xlarge", "NumberOfNodes": 2, "EstimatedDiskUtilizationPercent": 1.53 }, { "NodeType": "ds2.xlarge", "NumberOfNodes": 4, "EstimatedDiskUtilizationPercent": 0.78 } ] }For more information, see Purchasing Amazon Redshift Reserved Nodes in the Amazon Redshift Cluster Management Guide.
-
For API details, see DescribeNodeConfigurationOptions
in AWS CLI Command Reference.
-
The following code example shows how to use describe-orderable-cluster-options.
- AWS CLI
-
To describe all orderable cluster options
The following
describe-orderable-cluster-optionsexample returns descriptions of all orderable cluster options. By default, the output is in JSON format.aws redshift describe-orderable-cluster-optionsOutput:
{ "OrderableClusterOptions": [ { "NodeType": "dw.hs1.8xlarge", "AvailabilityZones": [ { "Name": "us-west-2a" }, { "Name": "us-west-2b" }, { "Name": "us-west-2c" } ], "ClusterVersion": "1.0", "ClusterType": "multi-node" }, { "NodeType": "dw.hs1.xlarge", "AvailabilityZones": [ { "Name": "us-west-2a" }, { "Name": "us-west-2b" }, { "Name": "us-west-2c" } ], "ClusterVersion": "1.0", "ClusterType": "multi-node" }, { "NodeType": "dw.hs1.xlarge", "AvailabilityZones": [ { "Name": "us-west-2a" }, { "Name": "us-west-2b" }, { "Name": "us-west-2c" } ], "ClusterVersion": "1.0", "ClusterType": "single-node" } ] }You can also obtain the same information in text format using the
--output textoption.aws redshift describe-orderable-cluster-options \ --outputtextOutput:
dw.hs1.8xlarge 1.0 multi-node us-west-2a us-west-2b us-west-2c dw.hs1.xlarge 1.0 multi-node us-west-2a us-west-2b us-west-2c dw.hs1.xlarge 1.0 single-node us-west-2a us-west-2b us-west-2cFor more information, see Amazon Redshift provisioned clusters in the Amazon Redshift Management Guide.
-
For API details, see DescribeOrderableClusterOptions
in AWS CLI Command Reference.
-
The following code example shows how to use describe-reserved-node-offerings.
- AWS CLI
-
To describe reserved node offerings
The following
describe-reserved-node-offeringsexample shows all of the reserved node offerings that are available for purchase.aws redshift describe-reserved-node-offeringsOutput:
{ "ReservedNodeOfferings": [ { "OfferingType": "Heavy Utilization", "FixedPrice": 3000.0, "NodeType": "dw.hs1.xlarge", "UsagePrice": 0.0, "RecurringCharges": [ { "RecurringChargeAmount": 0.114, "RecurringChargeFrequency": "Hourly" } ], "Duration": 31536000, "ReservedNodeOfferingId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" }, { "OfferingType": "Heavy Utilization", "FixedPrice": 24000.0, "NodeType": "dw.hs1.8xlarge", "UsagePrice": 0.0, "RecurringCharges": [ { "RecurringChargeAmount": 0.912, "RecurringChargeFrequency": "Hourly" } ], "Duration": 31536000, "ReservedNodeOfferingId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222" } ] }If you want to purchase a reserved node offering, you can call
purchase-reserved-node-offeringusing a valid ReservedNodeOfferingId.For more information, see Reserved nodes in the Amazon Redshift Management Guide.
-
For API details, see DescribeReservedNodeOfferings
in AWS CLI Command Reference.
-
The following code example shows how to use describe-reserved-nodes.
- AWS CLI
-
To describe reserved nodes
The following
describe-reserved-nodesexample shows a reserved node offering that has been purchased.aws redshift describe-reserved-nodesOutput:
{ "ReservedNodes": [ { "OfferingType": "Heavy Utilization", "FixedPrice": 3000.0, "NodeType": "dw.hs1.xlarge", "ReservedNodeId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "UsagePrice": 0.0, "RecurringCharges": [ { "RecurringChargeAmount": 0.21, "RecurringChargeFrequency": "Hourly" } ], "NodeCount": 1, "State": "payment-pending", "StartTime": "2013-02-13T17:08:39.051Z", "Duration": 31536000, "ReservedNodeOfferingId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333" } ] }For more information, see Reserved nodes in the Amazon Redshift Management Guide.
-
For API details, see DescribeReservedNodes
in AWS CLI Command Reference.
-
The following code example shows how to use describe-resize.
- AWS CLI
-
To describe a resize
The following
describe-resizeexample describes the latest resize of a cluster. The request was for 3 nodes of typedw.hs1.8xlarge.aws redshift describe-resize \ --cluster-identifiermyclusterOutput:
{ "Status": "NONE", "TargetClusterType": "multi-node", "TargetNodeType": "dw.hs1.8xlarge", "TargetNumberOfNodes": 3 }For more information, see Resizing a cluster in the Amazon Redshift Management Guide.
-
For API details, see DescribeResize
in AWS CLI Command Reference.
-
The following code example shows how to use describe-scheduled-actions.
- AWS CLI
-
To describe scheduled actions
The following
describe-scheduled-actionsexample displays details for any currently scheduled actions.aws redshift describe-scheduled-actionsOutput:
{ "ScheduledActions": [ { "ScheduledActionName": "resizecluster", "TargetAction": { "ResizeCluster": { "ClusterIdentifier": "mycluster", "NumberOfNodes": 4, "Classic": false } }, "Schedule": "at(2019-12-10T00:07:00)", "IamRole": "arn:aws:iam::123456789012:role/myRedshiftRole", "State": "ACTIVE", "NextInvocations": [ "2019-12-10T00:07:00Z" ] } ] }For more information, see Scheduling a resize in the Amazon Redshift Management Guide.
-
For API details, see DescribeScheduledActions
in AWS CLI Command Reference.
-
The following code example shows how to use describe-snapshot-copy-grants.
- AWS CLI
-
To describe snapshot copy grants
The following
describe-snapshot-copy-grantsexample displays details for the specified cluster snapshot copy grant.aws redshift describe-snapshot-copy-grants \ --snapshot-copy-grant-namemysnapshotcopygrantnameOutput:
{ "SnapshotCopyGrants": [ { "SnapshotCopyGrantName": "mysnapshotcopygrantname", "KmsKeyId": "arn:aws:kms:us-west-2:123456789012:key/bPxRfih3yCo8nvbEXAMPLEKEY", "Tags": [] } ] }For more information, see Amazon Redshift Database Encryption in the Amazon Redshift Cluster Management Guide.
-
For API details, see DescribeSnapshotCopyGrants
in AWS CLI Command Reference.
-
The following code example shows how to use describe-snapshot-schedules.
- AWS CLI
-
To describe snapshot schedules
The following
describe-snapshot-schedulesexample displays details for the specified cluster snapshot schedule.aws redshift describe-snapshot-schedules \ --cluster-identifiermycluster\ --schedule-identifiermysnapshotscheduleOutput:
{ "SnapshotSchedules": [ { "ScheduleDefinitions": [ "rate(12 hours)" ], "ScheduleIdentifier": "mysnapshotschedule", "ScheduleDescription": "My schedule description", "Tags": [], "AssociatedClusterCount": 1, "AssociatedClusters": [ { "ClusterIdentifier": "mycluster", "ScheduleAssociationState": "ACTIVE" } ] } ] }For more information, see Automated Snapshot Schedules in the Amazon Redshift Cluster Management Guide.
-
For API details, see DescribeSnapshotSchedules
in AWS CLI Command Reference.
-
The following code example shows how to use describe-storage.
- AWS CLI
-
To describe storage
The following
describe-storageexample displays details about the backup storage and provisional storage sizes for the account.aws redshift describe-storageOutput:
{ "TotalBackupSizeInMegaBytes": 193149.0, "TotalProvisionedStorageInMegaBytes": 655360.0 }For more information, see Managing Snapshot Storage in the Amazon Redshift Cluster Management Guide.
-
For API details, see DescribeStorage
in AWS CLI Command Reference.
-
The following code example shows how to use describe-table-restore-status.
- AWS CLI
-
To describe status of table restore requests from a cluster snapshot
The following
describe-table-restore-statusexample displays details for table restore requests made for the specified cluster.aws redshift describe-table-restore-status \ --cluster-identifiermyclusterOutput:
{ "TableRestoreStatusDetails": [ { "TableRestoreRequestId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "Status": "IN_PROGRESS", "RequestTime": "2019-12-27T18:22:12.257Z", "ClusterIdentifier": "mycluster", "SnapshotIdentifier": "mysnapshotid", "SourceDatabaseName": "dev", "SourceSchemaName": "public", "SourceTableName": "mytable", "TargetDatabaseName": "dev", "TargetSchemaName": "public", "NewTableName": "mytable-clone" } ] }For more information, see Restoring a Table from a Snapshot in the Amazon Redshift Cluster Management Guide.
-
For API details, see DescribeTableRestoreStatus
in AWS CLI Command Reference.
-
The following code example shows how to use describe-tags.
- AWS CLI
-
To describe tags
The following
describe-tagsexample displays the resources the specified cluster associated with the specified tag names and values.aws redshift describe-tags \ --resource-namearn:aws:redshift:us-west-2:123456789012:cluster:mycluster\ --tag-keysclustertagkey\ --tag-valuesclustertagvalueOutput:
{ "TaggedResources": [ { "Tag": { "Key": "clustertagkey", "Value": "clustertagvalue" }, "ResourceName": "arn:aws:redshift:us-west-2:123456789012:cluster:mycluster", "ResourceType": "cluster" } ] }For more information, see Tagging Resources in Amazon Redshift in the Amazon Redshift Cluster Management Guide.
-
For API details, see DescribeTags
in AWS CLI Command Reference.
-
The following code example shows how to use disable-snapshot-copy.
- AWS CLI
-
To disable snapshot copy for a cluster
The following
disable-snapshot-copyexample disables the automatic copy of a snapshot for the specified cluster.aws redshift disable-snapshot-copy \ --cluster-identifiermyclusterOutput:
{ "Cluster": { "ClusterIdentifier": "mycluster", "NodeType": "dc2.large", "ClusterStatus": "available", "ClusterAvailabilityStatus": "Available", "MasterUsername": "adminuser", "DBName": "dev", "Endpoint": { "Address": "mycluster.cmeaswqeuae.us-west-2.redshift.amazonaws.com", "Port": 5439 }, "ClusterCreateTime": "2019-12-05T18:44:36.991Z", "AutomatedSnapshotRetentionPeriod": 3, "ManualSnapshotRetentionPeriod": -1, "ClusterSecurityGroups": [], "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sh-i9b431cd", "Status": "active" } ], "ClusterParameterGroups": [ { "ParameterGroupName": "default.redshift-1.0", "ParameterApplyStatus": "in-sync" } ], "ClusterSubnetGroupName": "default", "VpcId": "vpc-b1fel7t9", "AvailabilityZone": "us-west-2f", "PreferredMaintenanceWindow": "sat:16:00-sat:16:30", "PendingModifiedValues": { "NodeType": "dc2.large", "NumberOfNodes": 2, "ClusterType": "multi-node" }, "ClusterVersion": "1.0", "AllowVersionUpgrade": true, "NumberOfNodes": 4, "PubliclyAccessible": false, "Encrypted": false, "Tags": [ { "Key": "mytags", "Value": "tag1" } ], "EnhancedVpcRouting": false, "IamRoles": [ { "IamRoleArn": "arn:aws:iam::123456789012:role/myRedshiftRole", "ApplyStatus": "in-sync" } ], "MaintenanceTrackName": "current", "DeferredMaintenanceWindows": [], "ExpectedNextSnapshotScheduleTime": "2019-12-10T04:42:43.390Z", "ExpectedNextSnapshotScheduleTimeStatus": "OnTrack", "NextMaintenanceWindowStartTime": "2019-12-14T16:00:00Z" } }For more information, see Copying Snapshots to Another AWS Region in the Amazon Redshift Cluster Management Guide.
-
For API details, see DisableSnapshotCopy
in AWS CLI Command Reference.
-
The following code example shows how to use enable-snapshot-copy.
- AWS CLI
-
To enable snapshot copy for a cluster
The following
enable-snapshot-copyexample enables the automatic copy of a snapshot for the specified cluster.aws redshift enable-snapshot-copy \ --cluster-identifiermycluster\ --destination-regionus-west-1Output:
{ "Cluster": { "ClusterIdentifier": "mycluster", "NodeType": "dc2.large", "ClusterStatus": "available", "ClusterAvailabilityStatus": "Available", "MasterUsername": "adminuser", "DBName": "dev", "Endpoint": { "Address": "mycluster.cmeaswqeuae.us-west-2.redshift.amazonaws.com", "Port": 5439 }, "ClusterCreateTime": "2019-12-05T18:44:36.991Z", "AutomatedSnapshotRetentionPeriod": 3, "ManualSnapshotRetentionPeriod": -1, "ClusterSecurityGroups": [], "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sh-f4c731cd", "Status": "active" } ], "ClusterParameterGroups": [ { "ParameterGroupName": "default.redshift-1.0", "ParameterApplyStatus": "in-sync" } ], "ClusterSubnetGroupName": "default", "VpcId": "vpc-b1ael7t9", "AvailabilityZone": "us-west-2f", "PreferredMaintenanceWindow": "sat:16:00-sat:16:30", "PendingModifiedValues": { "NodeType": "dc2.large", "NumberOfNodes": 2, "ClusterType": "multi-node" }, "ClusterVersion": "1.0", "AllowVersionUpgrade": true, "NumberOfNodes": 4, "PubliclyAccessible": false, "Encrypted": false, "ClusterSnapshotCopyStatus": { "DestinationRegion": "us-west-1", "RetentionPeriod": 7, "ManualSnapshotRetentionPeriod": -1 }, "Tags": [ { "Key": "mytags", "Value": "tag1" } ], "EnhancedVpcRouting": false, "IamRoles": [ { "IamRoleArn": "arn:aws:iam::123456789012:role/myRedshiftRole", "ApplyStatus": "in-sync" } ], "MaintenanceTrackName": "current", "DeferredMaintenanceWindows": [], "ExpectedNextSnapshotScheduleTime": "2019-12-10T04:42:43.390Z", "ExpectedNextSnapshotScheduleTimeStatus": "OnTrack", "NextMaintenanceWindowStartTime": "2019-12-14T16:00:00Z" } }For more information, see Copying Snapshots to Another AWS Region in the Amazon Redshift Cluster Management Guide.
-
For API details, see EnableSnapshotCopy
in AWS CLI Command Reference.
-
The following code example shows how to use get-cluster-credentials.
- AWS CLI
-
To get cluster credentials for an AWS account
The following
get-cluster-credentialsexample retrieves temporary credentials that enable access to an Amazon Redshift database.aws redshift get-cluster-credentials \ --db-useradminuser\ --db-namedev\ --cluster-identifiermyclusterOutput:
{ "DbUser": "IAM:adminuser", "DbPassword": "AMAFUyyuros/QjxPTtgzcsuQsqzIasdzJEN04aCtWDzXx1O9d6UmpkBtvEeqFly/EXAMPLE==", "Expiration": "2019-12-10T17:25:05.770Z" }For more information, see Generating IAM Database Credentials Using the Amazon Redshift CLI or API in the Amazon Redshift Cluster Management Guide.
-
For API details, see GetClusterCredentials
in AWS CLI Command Reference.
-
The following code example shows how to use get-reserved-node-exchange-offerings.
- AWS CLI
-
To get reserved node exchange offerings
The following
get-reserved-node-exchange-offeringsexample retrieves an array ofDC2ReservedNodeOfferingsthat match the specifiedDC1reserved node.aws redshift get-reserved-node-exchange-offerings \ --reserved-node-id12345678-12ab-12a1-1a2a-12ab-12a12EXAMPLEOutput:
{ "ReservedNodeOfferings": [ { "ReservedNodeOfferingId": "12345678-12ab-12a1-1a2a-12ab-12a12EXAMPLE", "NodeType": "dc2.large", "Duration": 31536000, "FixedPrice": 0.0, "UsagePrice": 0.0, "CurrencyCode": "USD", "OfferingType": "All Upfront", "RecurringCharges": [ { "RecurringChargeAmount": 0.0, "RecurringChargeFrequency": "Hourly" } ], "ReservedNodeOfferingType": "Regular" } ] }For more information, see Upgrading Reserved Nodes With the AWS CLI in the Amazon Redshift Cluster Management Guide.
-
For API details, see GetReservedNodeExchangeOfferings
in AWS CLI Command Reference.
-
The following code example shows how to use modify-cluster-iam-roles.
- AWS CLI
-
To modify the IAM role for a cluster
The following
modify-cluster-iam-rolesexample removes the specified AWS IAM role from the specified cluster.aws redshift modify-cluster-iam-roles \ --cluster-identifiermycluster\ --remove-iam-rolesarn:aws:iam::123456789012:role/myRedshiftRoleOutput:
{ "Cluster": { "ClusterIdentifier": "mycluster", "NodeType": "dc2.large", "ClusterStatus": "available", "ClusterAvailabilityStatus": "Available", "MasterUsername": "adminuser", "DBName": "dev", "Endpoint": { "Address": "mycluster.cmeaswqeuae.us-west-2.redshift.amazonaws.com", "Port": 5439 }, "ClusterCreateTime": "2019-12-05T18:44:36.991Z", "AutomatedSnapshotRetentionPeriod": 3, "ManualSnapshotRetentionPeriod": -1, "ClusterSecurityGroups": [], "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sh-f9b731sd", "Status": "active" } ], "ClusterParameterGroups": [ { "ParameterGroupName": "default.redshift-1.0", "ParameterApplyStatus": "in-sync" } ], "ClusterSubnetGroupName": "default", "VpcId": "vpc-b2fal7t9", "AvailabilityZone": "us-west-2f", "PreferredMaintenanceWindow": "sat:16:00-sat:16:30", "PendingModifiedValues": { "NodeType": "dc2.large", "NumberOfNodes": 2, "ClusterType": "multi-node" }, "ClusterVersion": "1.0", "AllowVersionUpgrade": true, "NumberOfNodes": 4, "PubliclyAccessible": false, "Encrypted": false, "Tags": [ { "Key": "mytags", "Value": "tag1" } ], "EnhancedVpcRouting": false, "IamRoles": [], "MaintenanceTrackName": "current", "DeferredMaintenanceWindows": [], "ExpectedNextSnapshotScheduleTime": "2019-12-11T04:42:55.631Z", "ExpectedNextSnapshotScheduleTimeStatus": "OnTrack", "NextMaintenanceWindowStartTime": "2019-12-14T16:00:00Z" } }For more information, see Using Identity-Based Policies (IAM Policies) for Amazon Redshift in the Amazon Redshift Cluster Management Guide.
-
For API details, see ModifyClusterIamRoles
in AWS CLI Command Reference.
-
The following code example shows how to use modify-cluster-maintenance.
- AWS CLI
-
To modify cluster maintenance
The following
modify-cluster-maintenanceexample defers the maintenance of the specified cluster by 30 days.aws redshift modify-cluster-maintenance \ --cluster-identifiermycluster\ --defer-maintenance \ --defer-maintenance-duration30Output:
{ "Cluster": { "ClusterIdentifier": "mycluster", "NodeType": "dc2.large", "ClusterStatus": "available", "ClusterAvailabilityStatus": "Available", "MasterUsername": "adminuser", "DBName": "dev", "Endpoint": { "Address": "mycluster.cmeaswqeuae.us-west-2.redshift.amazonaws.com", "Port": 5439 }, "ClusterCreateTime": "2019-12-05T18:44:36.991Z", "AutomatedSnapshotRetentionPeriod": 3, "ManualSnapshotRetentionPeriod": -1, "ClusterSecurityGroups": [], "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sh-a1a123ab", "Status": "active" } ], "ClusterParameterGroups": [ { "ParameterGroupName": "default.redshift-1.0", "ParameterApplyStatus": "in-sync" } ], "ClusterSubnetGroupName": "default", "VpcId": "vpc-b1ael7t9", "AvailabilityZone": "us-west-2f", "PreferredMaintenanceWindow": "sat:16:00-sat:16:30", "PendingModifiedValues": { "NodeType": "dc2.large", "NumberOfNodes": 2, "ClusterType": "multi-node" }, "ClusterVersion": "1.0", "AllowVersionUpgrade": true, "NumberOfNodes": 4, "PubliclyAccessible": false, "Encrypted": false, "Tags": [ { "Key": "mytags", "Value": "tag1" } ], "EnhancedVpcRouting": false, "IamRoles": [], "MaintenanceTrackName": "current", "DeferredMaintenanceWindows": [ { "DeferMaintenanceIdentifier": "dfm-mUdVIfFcT1B4SGhw6fyF", "DeferMaintenanceStartTime": "2019-12-10T18:18:39.354Z", "DeferMaintenanceEndTime": "2020-01-09T18:18:39.354Z" } ], "ExpectedNextSnapshotScheduleTime": "2019-12-11T04:42:55.631Z", "ExpectedNextSnapshotScheduleTimeStatus": "OnTrack", "NextMaintenanceWindowStartTime": "2020-01-11T16:00:00Z" } }For more information, see Cluster Maintenance in the Amazon Redshift Cluster Management Guide.
-
For API details, see ModifyClusterMaintenance
in AWS CLI Command Reference.
-
The following code example shows how to use modify-cluster-parameter-group.
- AWS CLI
-
To modify a parameter in a parameter group
The following
modify-cluster-parameter-groupexample modifies the wlm_json_configuration parameter for workload management. It accepts the parameters from a file that contains the JSON contents shown below.aws redshift modify-cluster-parameter-group \ --parameter-group-namemyclusterparametergroup\ --parametersfile://modify_pg.jsonContents of
modify_pg.json:[ { "ParameterName": "wlm_json_configuration", "ParameterValue": "[{\"user_group\":\"example_user_group1\",\"query_group\": \"example_query_group1\", \"query_concurrency\":7},{\"query_concurrency\":5}]" } ]Output:
{ "ParameterGroupStatus": "Your parameter group has been updated but changes won't get applied until you reboot the associated Clusters.", "ParameterGroupName": "myclusterparametergroup" }For more information, see Modifying a parameter group in the Amazon Redshift Management Guide.
-
For API details, see ModifyClusterParameterGroup
in AWS CLI Command Reference.
-
The following code example shows how to use modify-cluster-snapshot-schedule.
- AWS CLI
-
To modify cluster snapshot schedule
The following
modify-cluster-snapshot-scheduleexample removes the specified snapshot schedule from the specified cluster.aws redshift modify-cluster-snapshot-schedule \ --cluster-identifiermycluster\ --schedule-identifiermysnapshotschedule\ --disassociate-scheduleThis command produces no output.
For more information, see Automated Snapshot Schedules in the Amazon Redshift Cluster Management Guide.
-
For API details, see ModifyClusterSnapshotSchedule
in AWS CLI Command Reference.
-
The following code example shows how to use modify-cluster-snapshot.
- AWS CLI
-
To modify cluster snapshot
The following
modify-cluster-snapshotexample sets the manual retention period setting for the specified cluster snapshot to value of 10 days.aws redshift modify-cluster-snapshot \ --snapshot-identifiermycluster-2019-11-06-16-32\ --manual-snapshot-retention-period10Output:
{ "Snapshot": { "SnapshotIdentifier": "mycluster-2019-11-06-16-32", "ClusterIdentifier": "mycluster", "SnapshotCreateTime": "2019-12-07T00:34:05.633Z", "Status": "available", "Port": 5439, "AvailabilityZone": "us-west-2f", "ClusterCreateTime": "2019-12-05T18:44:36.991Z", "MasterUsername": "adminuser", "ClusterVersion": "1.0", "SnapshotType": "manual", "NodeType": "dc2.large", "NumberOfNodes": 2, "DBName": "dev", "VpcId": "vpc-b1cel7t9", "Encrypted": false, "EncryptedWithHSM": false, "OwnerAccount": "123456789012", "TotalBackupSizeInMegaBytes": 64384.0, "ActualIncrementalBackupSizeInMegaBytes": 24.0, "BackupProgressInMegaBytes": 24.0, "CurrentBackupRateInMegaBytesPerSecond": 13.0011, "EstimatedSecondsToCompletion": 0, "ElapsedTimeInSeconds": 1, "Tags": [ { "Key": "mytagkey", "Value": "mytagvalue" } ], "EnhancedVpcRouting": false, "MaintenanceTrackName": "current", "ManualSnapshotRetentionPeriod": 10, "ManualSnapshotRemainingDays": 6, "SnapshotRetentionStartTime": "2019-12-07T00:34:07.479Z" } }For more information, see Amazon Redshift Snapshots in the Amazon Redshift Cluster Management Guide.
-
For API details, see ModifyClusterSnapshot
in AWS CLI Command Reference.
-
The following code example shows how to use modify-cluster-subnet-group.
- AWS CLI
-
To modify the subnets in a cluster subnet group
The following
modify-cluster-subnet-groupexample modifies the list of subnets in a cluster subnet group. By default, the output is in JSON format.aws redshift modify-cluster-subnet-group \ --cluster-subnet-group-namemysubnetgroup\ --subnet-idssubnet-763fdd1subnet-ac830e9Output:
{ "ClusterSubnetGroup": { "Subnets": [ { "SubnetStatus": "Active", "SubnetIdentifier": "subnet-763fdd1c", "SubnetAvailabilityZone": { "Name": "us-west-2a" } }, { "SubnetStatus": "Active", "SubnetIdentifier": "subnet-ac830e9", "SubnetAvailabilityZone": { "Name": "us-west-2b" } } ], "VpcId": "vpc-7e3fdd14", "SubnetGroupStatus": "Complete", "Description": "My subnet group", "ClusterSubnetGroupName": "mysubnetgroup" } }For more information, see Modifying a cluster subnet group in the Amazon Redshift Management Guide.
-
For API details, see ModifyClusterSubnetGroup
in AWS CLI Command Reference.
-
The following code example shows how to use modify-cluster.
- AWS CLI
-
Example 1: To associate a security group with a cluster
The following
modify-clusterexample associates a cluster security group with the specified cluster.aws redshift modify-cluster \ --cluster-identifiermycluster\ --cluster-security-groupsmysecuritygroupOutput:
{ "Cluster": { "ClusterIdentifier": "mycluster", "NodeType": "dc2.large", "ClusterStatus": "available", "ClusterAvailabilityStatus": "Available", "MasterUsername": "adminuser", "DBName": "dev", "Endpoint": { "Address": "mycluster.cmeaswqeuae.us-west-2.redshift.amazonaws.com", "Port": 5439 }, "ClusterCreateTime": "2019-12-02T22:45:07.890Z", "AutomatedSnapshotRetentionPeriod": 1, "ManualSnapshotRetentionPeriod": -1, "ClusterSecurityGroups": [ { "ClusterSecurityGroupName": "default", "Status": "removing" }, { "ClusterSecurityGroupName": "mysecuritygroup", "Status": "adding" } ], "VpcSecurityGroups": [], "ClusterParameterGroups": [ { "ParameterGroupName": "default.redshift-1.0", "ParameterApplyStatus": "in-sync" } ], "AvailabilityZone": "us-west-2a", "PreferredMaintenanceWindow": "sat:03:30-sat:04:00", "PendingModifiedValues": {}, "ClusterVersion": "1.0", "AllowVersionUpgrade": true, "NumberOfNodes": 2, "PubliclyAccessible": true, "Encrypted": false, "Tags": [], "EnhancedVpcRouting": false, "IamRoles": [], "MaintenanceTrackName": "current" } }For more information, see Modifying a cluster in the Amazon Redshift Management Guide.
Example 2: To modify the maintenance window for a cluster
The following
modify-clusterexample changes the weekly preferred maintenance window for a cluster to be the minimum four hour window starting Sundays at 11:15 PM, and ending Mondays at 3:15 AM.aws redshift modify-cluster \ --cluster-identifiermycluster\ --preferred-maintenance-windowSun:23:15-Mon:03:15Output:
{ "Cluster": { "ClusterIdentifier": "mycluster", "NodeType": "dc2.large", "ClusterStatus": "available", "ClusterAvailabilityStatus": "Available", "MasterUsername": "adminuser", "DBName": "dev", "Endpoint": { "Address": "mycluster.cmeaswqeuae.us-west-2.redshift.amazonaws.com", "Port": 5439 }, "ClusterCreateTime": "2019-12-02T22:45:07.890Z", "AutomatedSnapshotRetentionPeriod": 1, "ManualSnapshotRetentionPeriod": -1, "ClusterSecurityGroups": [ { "ClusterSecurityGroupName": "default", "Status": "active" } ], "VpcSecurityGroups": [], "ClusterParameterGroups": [ { "ParameterGroupName": "default.redshift-1.0", "ParameterApplyStatus": "in-sync" } ], "AvailabilityZone": "us-west-2a", "PreferredMaintenanceWindow": "sun:23:15-mon:03:15", "PendingModifiedValues": {}, "ClusterVersion": "1.0", "AllowVersionUpgrade": true, "NumberOfNodes": 2, "PubliclyAccessible": true, "Encrypted": false, "Tags": [], "EnhancedVpcRouting": false, "IamRoles": [], "MaintenanceTrackName": "current" } }For more information, see Maintenance windows in the Amazon Redshift Management Guide.
Example 3: To change the master password for the cluster
The following
modify-clusterexample changes the master password for a cluster.aws redshift modify-cluster \ --cluster-identifiermycluster\ --master-user-passwordA1b2c3d4Output:
{ "Cluster": { "ClusterIdentifier": "mycluster", "NodeType": "dc2.large", "ClusterStatus": "available", "ClusterAvailabilityStatus": "Available", "MasterUsername": "adminuser", "DBName": "dev", "Endpoint": { "Address": "mycluster.cmeaswqeuae.us-west-2.redshift.amazonaws.com", "Port": 5439 }, "ClusterCreateTime": "2019-12-02T22:45:07.890Z", "AutomatedSnapshotRetentionPeriod": 1, "ManualSnapshotRetentionPeriod": -1, "ClusterSecurityGroups": [ { "ClusterSecurityGroupName": "default", "Status": "active" } ], "VpcSecurityGroups": [], "ClusterParameterGroups": [ { "ParameterGroupName": "default.redshift-1.0", "ParameterApplyStatus": "in-sync" } ], "AvailabilityZone": "us-west-2a", "PreferredMaintenanceWindow": "sat:03:30-sat:04:00", "PendingModifiedValues": { "MasterUserPassword": "****" }, "ClusterVersion": "1.0", "AllowVersionUpgrade": true, "NumberOfNodes": 2, "PubliclyAccessible": true, "Encrypted": false, "Tags": [], "EnhancedVpcRouting": false, "IamRoles": [], "MaintenanceTrackName": "current" } }For more information, see Modifying a cluster in the Amazon Redshift Management Guide.
-
For API details, see ModifyCluster
in AWS CLI Command Reference.
-
The following code example shows how to use modify-event-subscription.
- AWS CLI
-
To modify event subscription
The following
modify-event-subscriptionexample disables the specified event notification subscription.aws redshift modify-event-subscription \ --subscription-namemysubscription\ --no-enabledOutput:
{ "EventSubscription": { "CustomerAwsId": "123456789012", "CustSubscriptionId": "mysubscription", "SnsTopicArn": "arn:aws:sns:us-west-2:123456789012:MySNStopic", "Status": "active", "SubscriptionCreationTime": "2019-12-09T21:50:21.332Z", "SourceIdsList": [], "EventCategoriesList": [ "management" ], "Severity": "ERROR", "Enabled": false, "Tags": [] } }For more information, see Subscribing to Amazon Redshift Event Notifications in the Amazon Redshift Cluster Management Guide.
-
For API details, see ModifyEventSubscription
in AWS CLI Command Reference.
-
The following code example shows how to use modify-scheduled-action.
- AWS CLI
-
To modify scheduled action
The following
modify-scheduled-actionexample adds a description to the specified existing scheduled action.aws redshift modify-scheduled-action \ --scheduled-action-namemyscheduledaction\ --scheduled-action-description"My scheduled action"Output:
{ "ScheduledActionName": "myscheduledaction", "TargetAction": { "ResizeCluster": { "ClusterIdentifier": "mycluster", "NumberOfNodes": 2, "Classic": false } }, "Schedule": "at(2019-12-25T00:00:00)", "IamRole": "arn:aws:iam::123456789012:role/myRedshiftRole", "ScheduledActionDescription": "My scheduled action", "State": "ACTIVE", "NextInvocations": [ "2019-12-25T00:00:00Z" ] }For more information, see Scheduling a resize in the Amazon Redshift Management Guide.
-
For API details, see ModifyScheduledAction
in AWS CLI Command Reference.
-
The following code example shows how to use modify-snapshot-copy-retention-period.
- AWS CLI
-
To modify snapshot copy retention period
The following
modify-snapshot-copy-retention-periodexample modifies the number of days to retain snapshots for the specified cluster in the destination AWS Region after they are copied from the source AWS Region.aws redshift modify-snapshot-copy-retention-period \ --cluster-identifiermycluster\ --retention-period15Output:
{ "Cluster": { "ClusterIdentifier": "mycluster", "NodeType": "dc2.large", "ClusterStatus": "available", "ClusterAvailabilityStatus": "Available", "MasterUsername": "adminuser", "DBName": "dev", "Endpoint": { "Address": "mycluster.cmeaswqeuae.us-west-2.redshift.amazonaws.com", "Port": 5439 }, "ClusterCreateTime": "2019-12-05T18:44:36.991Z", "AutomatedSnapshotRetentionPeriod": 3, "ManualSnapshotRetentionPeriod": -1, "ClusterSecurityGroups": [], "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sh-a1a123ab", "Status": "active" } ], "ClusterParameterGroups": [ { "ParameterGroupName": "default.redshift-1.0", "ParameterApplyStatus": "in-sync" } ], "ClusterSubnetGroupName": "default", "VpcId": "vpc-b1fet7t9", "AvailabilityZone": "us-west-2f", "PreferredMaintenanceWindow": "sat:16:00-sat:16:30", "PendingModifiedValues": { "NodeType": "dc2.large", "NumberOfNodes": 2, "ClusterType": "multi-node" }, "ClusterVersion": "1.0", "AllowVersionUpgrade": true, "NumberOfNodes": 4, "PubliclyAccessible": false, "Encrypted": false, "ClusterSnapshotCopyStatus": { "DestinationRegion": "us-west-1", "RetentionPeriod": 15, "ManualSnapshotRetentionPeriod": -1 }, "Tags": [ { "Key": "mytags", "Value": "tag1" } ], "EnhancedVpcRouting": false, "IamRoles": [], "MaintenanceTrackName": "current", "DeferredMaintenanceWindows": [ { "DeferMaintenanceIdentifier": "dfm-mUdVSfDcT1F4SGhw6fyF", "DeferMaintenanceStartTime": "2019-12-10T18:18:39.354Z", "DeferMaintenanceEndTime": "2020-01-09T18:18:39.354Z" } ], "NextMaintenanceWindowStartTime": "2020-01-11T16:00:00Z" } }For more information, see Snapshot Schedule Format in the Amazon Redshift Cluster Management Guide.
-
For API details, see ModifySnapshotCopyRetentionPeriod
in AWS CLI Command Reference.
-
The following code example shows how to use modify-snapshot-schedule.
- AWS CLI
-
To modify snapshot schedule
The following
modify-snapshot-scheduleexample modifies the rate of the specified snapshot schedule to every 10 hours.aws redshift modify-snapshot-schedule \ --schedule-identifiermysnapshotschedule\ --schedule-definitions"rate(10 hours)"Output:
{ "ScheduleDefinitions": [ "rate(10 hours)" ], "ScheduleIdentifier": "mysnapshotschedule", "ScheduleDescription": "My schedule description", "Tags": [] }For more information, see Snapshot Schedule Format in the Amazon Redshift Cluster Management Guide.
-
For API details, see ModifySnapshotSchedule
in AWS CLI Command Reference.
-
The following code example shows how to use purchase-reserved-node-offering.
- AWS CLI
-
To purchase a reserved node
The following
purchase-reserved-node-offeringexample purchases a reserved node offering. Thereserved-node-offering-idis obtained by callingdescribe-reserved-node-offerings.aws redshift purchase-reserved-node-offering \ --reserved-node-offering-ida1b2c3d4-5678-90ab-cdef-EXAMPLE11111Output:
{ "ReservedNode": { "OfferingType": "Heavy Utilization", "FixedPrice": 3000.0, "NodeType": "dw.hs1.xlarge", "ReservedNodeId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "UsagePrice": 0.0, "RecurringCharges": [ { "RecurringChargeAmount": 0.114, "RecurringChargeFrequency": "Hourly" } ], "NodeCount": 1, "State": "payment-pending", "StartTime": "2013-02-13T17:08:39.051Z", "Duration": 31536000, "ReservedNodeOfferingId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" } }For more information, see Purchasing a reserved node in the Amazon Redshift Management Guide.
-
For API details, see PurchaseReservedNodeOffering
in AWS CLI Command Reference.
-
The following code example shows how to use reboot-cluster.
- AWS CLI
-
To reboot a cluster
The following
reboot-clusterexample reboots a cluster. By default, the output is in JSON format.aws redshift reboot-cluster \ --cluster-identifiermyclusterOutput:
{ "Cluster": { "NodeType": "dw.hs1.xlarge", "Endpoint": { "Port": 5439, "Address": "mycluster.coqoarplqhsn.us-west-2.redshift.amazonaws.com" }, "ClusterVersion": "1.0", "PubliclyAccessible": true, "MasterUsername": "adminuser", "ClusterParameterGroups": [ { "ParameterApplyStatus": "in-sync", "ParameterGroupName": "default.redshift-1.0" } ], "ClusterSecurityGroups": [ { "Status": "active", "ClusterSecurityGroupName": "default" } ], "AllowVersionUpgrade": true, "VpcSecurityGroups": [], "AvailabilityZone": "us-west-2a", "ClusterCreateTime": "2013-01-22T21:59:29.559Z", "PreferredMaintenanceWindow": "sun:23:15-mon:03:15", "AutomatedSnapshotRetentionPeriod": 1, "ClusterStatus": "rebooting", "ClusterIdentifier": "mycluster", "DBName": "dev", "NumberOfNodes": 2, "PendingModifiedValues": {} } }For more information, see Rebooting a cluster in the Amazon Redshift Management Guide.
-
For API details, see RebootCluster
in AWS CLI Command Reference.
-
The following code example shows how to use reset-cluster-parameter-group.
- AWS CLI
-
To reset parameters in a parameter group
The following
reset-cluster-parameter-groupexample resets all of the parameters in a parameter group.aws redshift reset-cluster-parameter-group \ --parameter-group-namemyclusterparametergroup\ --reset-all-parametersOutput:
{ "ParameterGroupName": "myclusterparametergroup", "ParameterGroupStatus": "Your parameter group has been updated but changes won't get applied until you reboot the associated Clusters." }For more information, see Amazon Redshift parameter groups in the Amazon Redshift Management Guide.
-
For API details, see ResetClusterParameterGroup
in AWS CLI Command Reference.
-
The following code example shows how to use resize-cluster.
- AWS CLI
-
To resize cluster
The following
resize-clusterexample resizes the specified cluster.aws redshift resize-cluster \ --cluster-identifiermycluster\ --cluster-typemulti-node\ --node-typedc2.large\ --number-of-nodes6\ --classicOutput:
{ "Cluster": { "ClusterIdentifier": "mycluster", "NodeType": "dc2.large", "ClusterStatus": "resizing", "ClusterAvailabilityStatus": "Modifying", "MasterUsername": "adminuser", "DBName": "dev", "Endpoint": { "Address": "mycluster.cmeaswqeuae.us-west-2.redshift.amazonaws.com", "Port": 5439 }, "ClusterCreateTime": "2019-12-05T18:44:36.991Z", "AutomatedSnapshotRetentionPeriod": 3, "ManualSnapshotRetentionPeriod": -1, "ClusterSecurityGroups": [], "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sh-a1a123ab", "Status": "active" } ], "ClusterParameterGroups": [ { "ParameterGroupName": "default.redshift-1.0", "ParameterApplyStatus": "in-sync" } ], "ClusterSubnetGroupName": "default", "VpcId": "vpc-a1abc1a1", "AvailabilityZone": "us-west-2f", "PreferredMaintenanceWindow": "sat:16:00-sat:16:30", "PendingModifiedValues": { "NodeType": "dc2.large", "NumberOfNodes": 6, "ClusterType": "multi-node" }, "ClusterVersion": "1.0", "AllowVersionUpgrade": true, "NumberOfNodes": 4, "PubliclyAccessible": false, "Encrypted": false, "Tags": [ { "Key": "mytags", "Value": "tag1" } ], "EnhancedVpcRouting": false, "IamRoles": [], "MaintenanceTrackName": "current", "DeferredMaintenanceWindows": [ { "DeferMaintenanceIdentifier": "dfm-mUdVCfDcT1B4SGhw6fyF", "DeferMaintenanceStartTime": "2019-12-10T18:18:39.354Z", "DeferMaintenanceEndTime": "2020-01-09T18:18:39.354Z" } ], "NextMaintenanceWindowStartTime": "2020-01-11T16:00:00Z", "ResizeInfo": { "ResizeType": "ClassicResize", "AllowCancelResize": true } } }For more information, see Resizing a Cluster in the Amazon Redshift Cluster Management Guide.
-
For API details, see ResizeCluster
in AWS CLI Command Reference.
-
The following code example shows how to use restore-from-cluster-snapshot.
- AWS CLI
-
To restore a cluster from a snapshot
The following
restore-from-cluster-snapshotexample restores a cluster from a snapshot.aws redshift restore-from-cluster-snapshot \ --cluster-identifiermycluster-clone\ --snapshot-identifiermy-snapshot-idOutput:
{ "Cluster": { "NodeType": "dw.hs1.xlarge", "ClusterVersion": "1.0", "PubliclyAccessible": true, "MasterUsername": "adminuser", "ClusterParameterGroups": [ { "ParameterApplyStatus": "in-sync", "ParameterGroupName": "default.redshift-1.0" } ], "ClusterSecurityGroups": [ { "Status": "active", "ClusterSecurityGroupName": "default" } ], "AllowVersionUpgrade": true, "VpcSecurityGroups": [], "PreferredMaintenanceWindow": "sun:23:15-mon:03:15", "AutomatedSnapshotRetentionPeriod": 1, "ClusterStatus": "creating", "ClusterIdentifier": "mycluster-clone", "DBName": "dev", "NumberOfNodes": 2, "PendingModifiedValues": {} } }For more information, see Restoring a cluster from a snapshot in the Amazon Redshift Management Guide.
-
For API details, see RestoreFromClusterSnapshot
in AWS CLI Command Reference.
-
The following code example shows how to use restore-table-from-cluster-snapshot.
- AWS CLI
-
To restore table from a cluster snapshot
The following
restore-table-from-cluster-snapshotexample creates a new table from the specified table in the specified cluster snapshot.aws redshift restore-table-from-cluster-snapshot \ --cluster-identifiermycluster\ --snapshot-identifiermycluster-2019-11-19-16-17\ --source-database-namedev\ --source-schema-namepublic\ --source-table-namemytable\ --target-database-namedev\ --target-schema-namepublic\ --new-table-namemytable-cloneOutput:
{ "TableRestoreStatus": { "TableRestoreRequestId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "Status": "PENDING", "RequestTime": "2019-12-20T00:20:16.402Z", "ClusterIdentifier": "mycluster", "SnapshotIdentifier": "mycluster-2019-11-19-16-17", "SourceDatabaseName": "dev", "SourceSchemaName": "public", "SourceTableName": "mytable", "TargetDatabaseName": "dev", "TargetSchemaName": "public", "NewTableName": "mytable-clone" } }For more information, see Restoring a Table from a Snapshot in the Amazon Redshift Cluster Management Guide.
-
For API details, see RestoreTableFromClusterSnapshot
in AWS CLI Command Reference.
-
The following code example shows how to use revoke-cluster-security-group-ingress.
- AWS CLI
-
Example 1: To revoke access from an EC2 security group
The following
revoke-cluster-security-group-ingressexample revokes access to a named Amazon EC2 security group.aws redshift revoke-cluster-security-group-ingress \ --cluster-security-group-namemysecuritygroup\ --ec2-security-group-namemyec2securitygroup\ --ec2-security-group-owner-id123456789012Output:
{ "ClusterSecurityGroup": { "ClusterSecurityGroupName": "mysecuritygroup", "Description": "This is my cluster security group", "EC2SecurityGroups": [], "IPRanges": [], "Tags": [] } }For more information, see Configuring security group communication settings for an Amazon Redshift cluster or an Amazon Redshift Serverless workgroup in the Amazon Redshift Cluster Management Guide.
Example 2: To revoke access to a CIDR range
The following
revoke-cluster-security-group-ingressexample revokes access to a CIDR range.aws redshift revoke-cluster-security-group-ingress \ --cluster-security-group-namemysecuritygroup\ --cidrip192.168.100.100/32Output:
{ "ClusterSecurityGroup": { "ClusterSecurityGroupName": "mysecuritygroup", "Description": "This is my cluster security group", "EC2SecurityGroups": [], "IPRanges": [], "Tags": [] } }For more information, see Configuring security group communication settings for an Amazon Redshift cluster or an Amazon Redshift Serverless workgroup in the Amazon Redshift Cluster Management Guide.
-
For API details, see RevokeClusterSecurityGroupIngress
in AWS CLI Command Reference.
-
The following code example shows how to use revoke-snapshot-access.
- AWS CLI
-
To revoke the authorization of an AWS account to restore a snapshot
The following
revoke-snapshot-accessexample revokes the authorization of the AWS account123456789111to restore the snapshotmy-snapshot-id. By default, the output is in JSON format.aws redshift revoke-snapshot-access \ --snapshot-idmy-snapshot-id\ --account-with-restore-access123456789111Output:
{ "Snapshot": { "Status": "available", "SnapshotCreateTime": "2013-07-17T22:04:18.947Z", "EstimatedSecondsToCompletion": 0, "AvailabilityZone": "us-west-2a", "ClusterVersion": "1.0", "MasterUsername": "adminuser", "Encrypted": false, "OwnerAccount": "123456789012", "BackupProgressInMegaBytes": 11.0, "ElapsedTimeInSeconds": 0, "DBName": "dev", "CurrentBackupRateInMegaBytesPerSecond": 0.1534, "ClusterCreateTime": "2013-01-22T21:59:29.559Z", "ActualIncrementalBackupSizeInMegaBytes": 11.0, "SnapshotType": "manual", "NodeType": "dw.hs1.xlarge", "ClusterIdentifier": "mycluster", "TotalBackupSizeInMegaBytes": 20.0, "Port": 5439, "NumberOfNodes": 2, "SnapshotIdentifier": "my-snapshot-id" } }For more information, see Amazon Redshift snapshots and backups in the Amazon Redshift Cluster Management Guide.
-
For API details, see RevokeSnapshotAccess
in AWS CLI Command Reference.
-
The following code example shows how to use rotate-encryption-key.
- AWS CLI
-
To rotate encryption key for a cluster
The following
rotate-encryption-keyexample rotates the encryption key for the specified cluster.aws redshift rotate-encryption-key \ --cluster-identifiermyclusterOutput:
{ "Cluster": { "ClusterIdentifier": "mycluster", "NodeType": "dc2.large", "ClusterStatus": "rotating-keys", "ClusterAvailabilityStatus": "Modifying", "MasterUsername": "adminuser", "DBName": "dev", "Endpoint": { "Address": "mycluster.cmeaswqeuae.us-west-2.redshift.amazonaws.com", "Port": 5439 }, "ClusterCreateTime": "2019-12-10T19:25:45.886Z", "AutomatedSnapshotRetentionPeriod": 30, "ManualSnapshotRetentionPeriod": -1, "ClusterSecurityGroups": [], "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sh-a1a123ab", "Status": "active" } ], "ClusterParameterGroups": [ { "ParameterGroupName": "default.redshift-1.0", "ParameterApplyStatus": "in-sync" } ], "ClusterSubnetGroupName": "default", "VpcId": "vpc-a1abc1a1", "AvailabilityZone": "us-west-2a", "PreferredMaintenanceWindow": "sat:16:00-sat:16:30", "PendingModifiedValues": {}, "ClusterVersion": "1.0", "AllowVersionUpgrade": true, "NumberOfNodes": 2, "PubliclyAccessible": false, "Encrypted": true, "Tags": [], "KmsKeyId": "arn:aws:kms:us-west-2:123456789012:key/bPxRfih3yCo8nvbEXAMPLEKEY", "EnhancedVpcRouting": false, "IamRoles": [ { "IamRoleArn": "arn:aws:iam::123456789012:role/myRedshiftRole", "ApplyStatus": "in-sync" } ], "MaintenanceTrackName": "current", "DeferredMaintenanceWindows": [], "NextMaintenanceWindowStartTime": "2019-12-14T16:00:00Z" } }For more information, see Amazon Redshift Database Encryption in the Amazon Redshift Cluster Management Guide.
-
For API details, see RotateEncryptionKey
in AWS CLI Command Reference.
-