def createDatabaseSnapshot(ctx, stack, region, githash=None, environment=None): session, config = configtasks.getConfig(region, stack, githash, environment) cftasks = cloudformationtasks.cloudformationtasks() rds = database.rds(session) cfstackname = cftasks.generateStackName(config["stackname"], githash, environment) resources = cftasks.getStackResources(stackname=cfstackname) rds.SnapshotfromResources(stackresources=resources)
def addTagToDatabase(ctx, region, arn, key, value): session = getBaseSession(region) rds = database.rds(session) rds.addTag(arn, key, value)
def listTagsForDatabase(ctx, region, arn): session = getBaseSession(region) rds = database.rds(session) pprint.pprint(rds.listTags(arn))
def listDatabases(ctx, region): session = getBaseSession(region) rds = database.rds(session) pprint.pprint(rds.listDatabases())
def restoreDatabaseClusterFromSnapshot(ctx, region, cluster, snapshot, engine): session = getBaseSession(region) rds = database.rds(session) rds.restoreClusterFromSnapshot(cluster=cluster, snapshot=snapshot, engine=engine)