dbinstance

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 40 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

rds/DBInstance

Manages an Amazon RDS DB instance (DBInstance.rds.aws2.crossplane.io): standalone, read replica, restored, or a member of an Aurora cluster.

Origin

Imported from provider-aws (crossplane-contrib/provider-aws, revision not recorded; the importer records revisions since docdb), ported by hand in 75acc8b.

Behavior

  • External name: metadata.name by default; DBInstanceIdentifier.
  • Create: CreateDBInstance with a password from masterUserPasswordSecretRef or autogeneratePassword. Read replicas (sourceDBInstanceID/Ref/Selector, sourceDBClusterID) use CreateDBInstanceReadReplica (overridden Create).
  • Restore: restoreFrom.source S3, Snapshot or PointInTime.
  • Password: a provider-owned cache secret in the MR's namespace stores the last applied password and the restore state; changes are detected against it.
  • Drift: hand-written; builds a JSON patch between desired spec and the observed state (createPatch) with special rules for engine version, option/parameter groups, VPC security groups, backup window and retention, storage (gp3 thresholds), additional storage volumes, KMS key, monitoringInterval (0 matches monitoring off) and SDK-v2-only fields. No update while modifying, upgrading, rebooting, creating or deleting.
  • Delete: final snapshot options, deleteAutomatedBackups; the cache secret is deleted afterwards.
  • Status: databaseRole (standalone, primary, read replica, cluster writer/reader); conditions from the instance status.
  • Connection details: username, password, endpoint, port.

Differences from provider-aws

  • Password/restore cache secret lives in the MR's namespace, not the provider's.
  • Fields that only exist in SDK v2 are compared (see history).
  • sourceDBClusterIDRef/Selector dropped (rds/DBCluster not imported); sourceDBClusterID kept.
  • Only the instance part of pending_modified_values is ported.

Limitations

  • Drift detection doesn't use the generated DiffUpdatableParameters yet; new updatable fields from SDK updates need hand-written handling.
  • Restores run in preCreate, after which the generated Create still calls CreateDBInstance (the same pattern was fixed for docdb/DBCluster by overriding Create). To be verified against AWS and fixed.

Examples

examples/rds/: standalone, Oracle, read replica, restore.

History

Date PR Change
2026-11-04 #4 Create no longer copies the AWS response into spec.forProvider (status only)
2026-10-19 bea5e9f Fix update loop with monitoringInterval: 0 (monitoring off)
2026-10-07 9e2ab6c Drift detection for fields new in SDK v2 (database insights, network type, …); additional storage volumes; managed password toggling
2026-10-06 344c433 Comprehensive examples
2026-10-05 e43afb1 Imported from provider-aws and ported to runtime v2, SDK v2, namespaced secrets

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiffUpdatableParameters

func DiffUpdatableParameters(desired, observed *svcapitypes.DBInstanceParameters) []string

DiffUpdatableParameters returns the JSON names of the spec fields that ModifyDBInstance can change and whose desired value differs from the observed one (see compare.IsSubset). Fields that are not set in desired are not compared. Fields whose name or shape differs between the update input and the read output are not included; compare them by hand.

func GenerateCreateDBInstanceInput

func GenerateCreateDBInstanceInput(cr *svcapitypes.DBInstance) (*svcsdk.CreateDBInstanceInput, error)

GenerateCreateDBInstanceInput returns a create input.

func GenerateDBInstance

func GenerateDBInstance(resp *svcsdk.DescribeDBInstancesOutput) *svcapitypes.DBInstance

GenerateDBInstance returns the current state in the form of *svcapitypes.DBInstance.

func GenerateDeleteDBInstanceInput

func GenerateDeleteDBInstanceInput(cr *svcapitypes.DBInstance) (*svcsdk.DeleteDBInstanceInput, error)

GenerateDeleteDBInstanceInput returns a deletion input.

func GenerateDescribeDBInstancesInput

func GenerateDescribeDBInstancesInput(cr *svcapitypes.DBInstance) (*svcsdk.DescribeDBInstancesInput, error)

GenerateDescribeDBInstancesInput returns input for read operation.

func GenerateModifyDBInstanceInput

func GenerateModifyDBInstanceInput(cr *svcapitypes.DBInstance) (*svcsdk.ModifyDBInstanceInput, error)

GenerateModifyDBInstanceInput returns an update input.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns whether the given error means that the resource does not exist.

func Setup

func Setup(mgr ctrl.Manager, o controller.Options) error

Setup adds a controller that reconciles DBInstance.

func SetupGated

func SetupGated(mgr ctrl.Manager, o controller.Options) error

SetupGated adds the DBInstance controller once its CRD is available.

Types

type Client

type Client interface {
	DescribeDBInstances(context.Context, *svcsdk.DescribeDBInstancesInput, ...func(*svcsdk.Options)) (*svcsdk.DescribeDBInstancesOutput, error)
	CreateDBInstance(context.Context, *svcsdk.CreateDBInstanceInput, ...func(*svcsdk.Options)) (*svcsdk.CreateDBInstanceOutput, error)
	ModifyDBInstance(context.Context, *svcsdk.ModifyDBInstanceInput, ...func(*svcsdk.Options)) (*svcsdk.ModifyDBInstanceOutput, error)
	DeleteDBInstance(context.Context, *svcsdk.DeleteDBInstanceInput, ...func(*svcsdk.Options)) (*svcsdk.DeleteDBInstanceOutput, error)
	AddTagsToResource(context.Context, *svcsdk.AddTagsToResourceInput, ...func(*svcsdk.Options)) (*svcsdk.AddTagsToResourceOutput, error)
	CreateDBInstanceReadReplica(context.Context, *svcsdk.CreateDBInstanceReadReplicaInput, ...func(*svcsdk.Options)) (*svcsdk.CreateDBInstanceReadReplicaOutput, error)
	DescribeDBClusters(context.Context, *svcsdk.DescribeDBClustersInput, ...func(*svcsdk.Options)) (*svcsdk.DescribeDBClustersOutput, error)
	ListTagsForResource(context.Context, *svcsdk.ListTagsForResourceInput, ...func(*svcsdk.Options)) (*svcsdk.ListTagsForResourceOutput, error)
	RemoveTagsFromResource(context.Context, *svcsdk.RemoveTagsFromResourceInput, ...func(*svcsdk.Options)) (*svcsdk.RemoveTagsFromResourceOutput, error)
	RestoreDBInstanceFromDBSnapshot(context.Context, *svcsdk.RestoreDBInstanceFromDBSnapshotInput, ...func(*svcsdk.Options)) (*svcsdk.RestoreDBInstanceFromDBSnapshotOutput, error)
	RestoreDBInstanceFromS3(context.Context, *svcsdk.RestoreDBInstanceFromS3Input, ...func(*svcsdk.Options)) (*svcsdk.RestoreDBInstanceFromS3Output, error)
	RestoreDBInstanceToPointInTime(context.Context, *svcsdk.RestoreDBInstanceToPointInTimeInput, ...func(*svcsdk.Options)) (*svcsdk.RestoreDBInstanceToPointInTimeOutput, error)
}

Client is the part of the rds API used by the DBInstance controller.

Jump to

Keyboard shortcuts

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