Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Rachel Hagerman <110480692+rlhagerm@users.noreply.github.com>
Co-authored-by: Liz Kellebrew-Davies <35241259+lkdavies@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 7, 2023
1 parent c1587cf commit 6fa6011
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
5 changes: 4 additions & 1 deletion gov2/rds/actions/instances.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

package actions

import (
Expand Down Expand Up @@ -102,7 +105,7 @@ func (instances *DbInstances) GetParameters(parameterGroupName string, source st
for parameterPaginator.HasMorePages() {
output, err = parameterPaginator.NextPage(context.TODO())
if err != nil {
log.Printf("Couldn't get paramaeters for %v: %v\n", parameterGroupName, err)
log.Printf("Couldn't get parameters for %v: %v\n", parameterGroupName, err)
break
} else {
params = append(params, output.Parameters...)
Expand Down
14 changes: 7 additions & 7 deletions gov2/rds/scenarios/get_started_instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ type GetStartedInstances struct {
}

// NewGetStartedInstances constructs a GetStartedInstances instance from a configuration.
// It uses the specified config to get an Amazon Relational Database Service (Amazon RDS)
// It uses the specified config to get an Amazon RDS
// client and create wrappers for the actions used in the scenario.
func NewGetStartedInstances(sdkConfig aws.Config, questioner demotools.IQuestioner,
helper IScenarioHelper) GetStartedInstances {
Expand Down Expand Up @@ -171,12 +171,12 @@ func (scenario GetStartedInstances) SetUserParameters(parameterGroupName string)
if err != nil {
panic(err)
}
log.Println("You can get a list of parameters you've set by specifying a source of 'user'.")
log.Println("To get a list of parameters that you set previously, specify a source of 'user'.")
userParameters, err := scenario.instances.GetParameters(parameterGroupName, "user")
if err != nil {
panic(err)
}
log.Println("Here are the parameters you've set:")
log.Println("Here are the parameters you set:")
for _, param := range userParameters {
log.Printf("\t%v: %v\n", *param.ParameterName, *param.ParameterValue)
}
Expand All @@ -195,7 +195,7 @@ func (scenario GetStartedInstances) CreateInstance(instanceName string, dbEngine
}
if instance == nil {
adminUsername := scenario.questioner.Ask(
"Enter an administrator user name for the database: ", demotools.NotEmpty{})
"Enter an administrator username for the database: ", demotools.NotEmpty{})
adminPassword := scenario.questioner.AskPassword(
"Enter a password for the administrator (at least 8 characters): ", 7)
engineVersions, err := scenario.instances.GetEngineVersions(dbEngine,
Expand Down Expand Up @@ -268,10 +268,10 @@ func (scenario GetStartedInstances) CreateInstance(instanceName string, dbEngine
// on how to connect to it.
func (scenario GetStartedInstances) DisplayConnection(instance *types.DBInstance) {
log.Println(
"You can now connect to your database using your favorite MySql client.\n" +
"You can now connect to your database by using your favorite MySQL client.\n" +
"One way to connect is by using the 'mysql' shell on an Amazon EC2 instance\n" +
"that is running in the same VPC as your DB instance. Pass the endpoint,\n" +
"port, and administrator user name to 'mysql' and enter your password\n" +
"port, and administrator username to 'mysql'. Then, enter your password\n" +
"when prompted:")
log.Printf("\n\tmysql -h %v -P %v -u %v -p\n",
*instance.Endpoint.Address, instance.Endpoint.Port, *instance.MasterUsername)
Expand Down Expand Up @@ -315,7 +315,7 @@ func (scenario GetStartedInstances) Cleanup(
instance *types.DBInstance, parameterGroup *types.DBParameterGroup) {

if scenario.questioner.AskBool(
"\nDo you want to delete the database instance, and parameter group (y/n)? ", "y") {
"\nDo you want to delete the database instance and parameter group (y/n)? ", "y") {
log.Printf("Deleting database instance %v.\n", *instance.DBInstanceIdentifier)
err := scenario.instances.DeleteInstance(*instance.DBInstanceIdentifier)
if err != nil {
Expand Down

0 comments on commit 6fa6011

Please sign in to comment.