scenarios

package
v0.0.0-...-ba09527 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetStartedInstances

type GetStartedInstances struct {
	// contains filtered or unexported fields
}

GetStartedInstances is an interactive example that shows you how to use the AWS SDK for Go with Amazon Relation Database Service (Amazon RDS) to do the following:

  1. Create a custom DB parameter group and set parameter values.
  2. Create a DB instance that is configured to use the parameter group. The DB instance also contains a database.
  3. Take a snapshot of the DB instance.
  4. Delete the DB instance and parameter group.

func NewGetStartedInstances

func NewGetStartedInstances(sdkConfig aws.Config, questioner demotools.IQuestioner,
	helper IScenarioHelper) GetStartedInstances

NewGetStartedInstances constructs a GetStartedInstances instance from a configuration. It uses the specified config to get an Amazon RDS client and create wrappers for the actions used in the scenario.

func (GetStartedInstances) Cleanup

func (scenario GetStartedInstances) Cleanup(
	instance *types.DBInstance, parameterGroup *types.DBParameterGroup)

Cleanup shows how to clean up a DB instance and DB parameter group. Before the DB parameter group can be deleted, all associated DB instances must first be deleted.

func (GetStartedInstances) CreateInstance

func (scenario GetStartedInstances) CreateInstance(instanceName string, dbEngine string,
	dbName string, parameterGroup *types.DBParameterGroup) *types.DBInstance

CreateInstance shows how to create a DB instance that contains a database of a specified type. The database is also configured to use a custom DB parameter group.

func (GetStartedInstances) CreateParameterGroup

func (scenario GetStartedInstances) CreateParameterGroup(dbEngine string,
	parameterGroupName string) *types.DBParameterGroup

CreateParameterGroup shows how to get available engine versions for a specified database engine and create a DB parameter group that is compatible with a selected engine family.

func (GetStartedInstances) CreateSnapshot

func (scenario GetStartedInstances) CreateSnapshot(instance *types.DBInstance)

CreateSnapshot shows how to create a DB instance snapshot and wait until it's available.

func (GetStartedInstances) DisplayConnection

func (scenario GetStartedInstances) DisplayConnection(instance *types.DBInstance)

DisplayConnection displays connection information about a DB instance and tips on how to connect to it.

func (GetStartedInstances) Run

func (scenario GetStartedInstances) Run(dbEngine string, parameterGroupName string,
	instanceName string, dbName string)

Run runs the interactive scenario.

func (GetStartedInstances) SetUserParameters

func (scenario GetStartedInstances) SetUserParameters(parameterGroupName string)

SetUserParameters shows how to get the parameters contained in a custom parameter group and update some of the parameter values in the group.

type IScenarioHelper

type IScenarioHelper interface {
	Pause(secs int)
	UniqueId() string
}

IScenarioHelper abstracts the function from a scenario so that it can be mocked for unit testing.

type ScenarioHelper

type ScenarioHelper struct{}

func (ScenarioHelper) Pause

func (helper ScenarioHelper) Pause(secs int)

Pause waits for the specified number of seconds.

func (ScenarioHelper) UniqueId

func (helper ScenarioHelper) UniqueId() string

UniqueId returns a new UUID.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL