awsrds

package
v1.59.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const (
	TagServiceID            = "Service ID"
	TagPlanID               = "Plan ID"
	TagOrganizationID       = "Organization ID"
	TagSpaceID              = "Space ID"
	TagSkipFinalSnapshot    = "SkipFinalSnapshot"
	TagRestoredFromSnapshot = "Restored From Snapshot"
	TagBrokerName           = "Broker Name"
	TagExtensions           = "Extensions"
	TagOriginDatabase       = "Restored From Database"
	TagOriginPointInTime    = "Restored From Time"
)

Variables

View Source
var (
	ErrCodeDBInstanceDoesNotExist      = "DBInstanceDoesNotExist"
	ErrCodeInvalidParameterCombination = "InvalidParameterCombination"

	ErrDBInstanceDoesNotExist = NewError(
		errors.New("rds db instance does not exist"),
		ErrCodeDBInstanceDoesNotExist,
	)
)

Functions

func BuildRDSTags added in v1.23.0

func BuildRDSTags(tags map[string]string) []*rds.Tag

func GetDBAddress added in v0.24.0

func GetDBAddress(endpoint *rds.Endpoint) (dbAddress string)

func GetDBPort added in v0.24.0

func GetDBPort(endpoint *rds.Endpoint) int64

func HandleAWSError

func HandleAWSError(err error, logger lager.Logger) error

func ListTagsForResource

func ListTagsForResource(resourceARN string, rdssvc *rds.RDS, logger lager.Logger) ([]*rds.Tag, error)

func RDSTagsValues

func RDSTagsValues(rdsTags []*rds.Tag) map[string]string

func RemoveTagsFromResource

func RemoveTagsFromResource(resourceARN string, tagKeys []*string, rdssvc *rds.RDS, logger lager.Logger) error

Types

type ByCreateTime

type ByCreateTime []*rds.DBSnapshot

func (ByCreateTime) Len

func (ct ByCreateTime) Len() int

func (ByCreateTime) Less

func (ct ByCreateTime) Less(i, j int) bool

func (ByCreateTime) Swap

func (ct ByCreateTime) Swap(i, j int)

type DescribeOption added in v0.22.0

type DescribeOption string
const (
	DescribeUseCachedOption DescribeOption = "useCached"
)

type Error added in v1.23.0

type Error interface {
	// Satisfy the generic error interface.
	error

	// Returns the short phrase depicting the classification of the error.
	Code() string

	// Returns the original error if one was set.  Nil is returned if not set.
	OrigErr() error
}

func NewError added in v1.23.0

func NewError(err error, code string) Error

type RDSDBInstance

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

func NewRDSDBInstance

func NewRDSDBInstance(
	region string,
	partition string,
	rdssvc *rds.RDS,
	logger lager.Logger,
	tagCacheDuration time.Duration,
	timeNowFunc func() time.Time,
) *RDSDBInstance

func (*RDSDBInstance) AddTagsToResource added in v0.24.0

func (r *RDSDBInstance) AddTagsToResource(resourceARN string, tags []*rds.Tag) error

func (*RDSDBInstance) Create

func (r *RDSDBInstance) Create(createDBInstanceInput *rds.CreateDBInstanceInput) error

func (*RDSDBInstance) CreateParameterGroup added in v0.27.0

func (r *RDSDBInstance) CreateParameterGroup(input *rds.CreateDBParameterGroupInput) error

func (*RDSDBInstance) Delete

func (r *RDSDBInstance) Delete(ID string, skipFinalSnapshot bool) error

func (*RDSDBInstance) DeleteSnapshots added in v0.9.0

func (r *RDSDBInstance) DeleteSnapshots(brokerName string, keepForDays int) error

func (*RDSDBInstance) Describe

func (r *RDSDBInstance) Describe(ID string) (*rds.DBInstance, error)

func (*RDSDBInstance) DescribeByTag

func (r *RDSDBInstance) DescribeByTag(tagKey, tagValue string, opts ...DescribeOption) ([]*rds.DBInstance, error)

func (*RDSDBInstance) DescribeSnapshots

func (r *RDSDBInstance) DescribeSnapshots(DBInstanceID string) ([]*rds.DBSnapshot, error)

func (*RDSDBInstance) GetFullValidTargetVersion added in v0.48.0

func (r *RDSDBInstance) GetFullValidTargetVersion(engine string, currentVersion string, targetVersionMoniker string) (string, error)

GetFullValidTargetVersion finds the full version specifier for the newest release of the target version. engine is the name of the database engine in AWS RDS (e.g. postgres). currentVersion is current, exact version of a database engine targetVersionMoniker is the name of a version of the database engine. It does not include the patch/minor level information.

E.g. For postgres, 9.5 is the moniker for 9.5.x, and 10 is the moniker for 10.x

if no upgrades are available for the major version and the targetVersionMoniker is the same major version as the current version, an empty string is returned. This should be interpreted as a signal to omit an engine version upgrade attempt.

func (*RDSDBInstance) GetLatestMinorVersion added in v0.44.0

func (r *RDSDBInstance) GetLatestMinorVersion(engine string, version string) (*string, error)

func (*RDSDBInstance) GetParameterGroup added in v0.27.0

func (r *RDSDBInstance) GetParameterGroup(groupId string) (*rds.DBParameterGroup, error)

func (*RDSDBInstance) GetResourceTags added in v0.24.0

func (r *RDSDBInstance) GetResourceTags(resourceArn string, opts ...DescribeOption) ([]*rds.Tag, error)

func (*RDSDBInstance) GetTag

func (r *RDSDBInstance) GetTag(ID, tagKey string) (string, error)

func (*RDSDBInstance) Modify

func (r *RDSDBInstance) Modify(modifyDBInstanceInput *rds.ModifyDBInstanceInput) (*rds.DBInstance, error)

func (*RDSDBInstance) ModifyParameterGroup added in v0.27.0

func (r *RDSDBInstance) ModifyParameterGroup(input *rds.ModifyDBParameterGroupInput) error

func (*RDSDBInstance) Reboot

func (r *RDSDBInstance) Reboot(rebootDBInstanceInput *rds.RebootDBInstanceInput) error

func (*RDSDBInstance) RemoveTag

func (r *RDSDBInstance) RemoveTag(ID, tagKey string) error

func (*RDSDBInstance) Restore

func (r *RDSDBInstance) Restore(restoreDBInstanceInput *rds.RestoreDBInstanceFromDBSnapshotInput) error

func (*RDSDBInstance) RestoreToPointInTime added in v0.45.0

func (r *RDSDBInstance) RestoreToPointInTime(restoreDBInstanceInput *rds.RestoreDBInstanceToPointInTimeInput) error

type RDSInstance added in v0.24.0

type RDSInstance interface {
	Describe(ID string) (*rds.DBInstance, error)
	GetResourceTags(resourceArn string, opts ...DescribeOption) ([]*rds.Tag, error)
	DescribeByTag(TagName, TagValue string, opts ...DescribeOption) ([]*rds.DBInstance, error)
	DescribeSnapshots(DBInstanceID string) ([]*rds.DBSnapshot, error)
	DeleteSnapshots(brokerName string, keepForDays int) error
	Create(createDBInstanceInput *rds.CreateDBInstanceInput) error
	Restore(restoreRBInstanceInput *rds.RestoreDBInstanceFromDBSnapshotInput) error
	RestoreToPointInTime(restoreRBInstanceInput *rds.RestoreDBInstanceToPointInTimeInput) error
	Modify(modifyDBInstanceInput *rds.ModifyDBInstanceInput) (*rds.DBInstance, error)
	AddTagsToResource(resourceArn string, tags []*rds.Tag) error
	Reboot(rebootDBInstanceInput *rds.RebootDBInstanceInput) error
	RemoveTag(ID, tagKey string) error
	Delete(ID string, skipFinalSnapshot bool) error
	GetTag(ID, tagKey string) (string, error)
	GetParameterGroup(groupId string) (*rds.DBParameterGroup, error)
	CreateParameterGroup(input *rds.CreateDBParameterGroupInput) error
	ModifyParameterGroup(input *rds.ModifyDBParameterGroupInput) error
	GetLatestMinorVersion(engine string, version string) (*string, error)
	GetFullValidTargetVersion(engine string, currentVersion string, targetVersion string) (string, error)
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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