go/rds/README.md
These examples demonstrate how to perform several Amazon RDS operations.
You must have an AWS account, and have your default credentials and AWS Region configured as described in Configuring the AWS SDK for Go in the AWS SDK for Go Developer Guide.
This example copies a snapshot of an Amazon RDS cluster to an Amazon S3 bucket.
go run CopySnapshot.go -a ROLE-ARN -k KMS-KEY -b BUCKET-NAME -s SNAPSHOT-NAME -e EXPORT-NAME
The unit test mocks the service client and the DescribeDBSnapshots and StartExportTask functions.
This example creates a snapshot of an Amazon RDS cluster.
go run CreateClusterSnapshot.go -c CLUSTER-ID
The unit test mocks the service client and the CreateClusterSnapshot function.
This example creates a snapshot of an Amazon RDS instance.
go run CreateInstanceSnapshot.go -i INSTANCE
The unit test mocks the service client and the CreateDBSnapshot function.
This example lists your Amazon RDS cluster snapshots.
go run ListClusterSnapshots.go
This example lists your Amazon RDS instances.
go run ListInstances.go
This example lists your Amazon RDS instance snapshots.
go run ListInstanceSnapshots.go
This example lists your Amazon RDS parameter groups.
go run ListParameterGroups.go
This example lists your Amazon RDS security groups.
go run ListSecurityGroups.go
This example lists your Amazon RDS subnet groups.
go run ListSubnetGroups.go
Unit tests should delete any resources they create. However, they might result in charges to your AWS account.
To run a unit test, enter the following.
go test
You should see something like the following, where PATH is the path to the folder containing the Go files.
PASS
ok PATH 6.593s
To see any log messages, enter the following.
go test -test.v
You should see some additional log messages. The last two lines should be similar to the previous output shown.
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0