google_sql

package
v0.0.0-...-d6ceb4e Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AvailabilityTypeRegional         = "REGIONAL"
	AvailabilityTypeZonal            = "ZONAL"
	DefaultSqlInstanceDiskType       = nais_io_v1.CloudSqlInstanceDiskTypeSSD
	DefaultSqlInstanceAutoBackupHour = 2
	DefaultSqlInstanceTier           = "db-f1-micro"
	DefaultSqlInstanceDiskSize       = 10
	DefaultSqlInstanceCollation      = "en_US.UTF8"
)
View Source
const (
	GoogleSQLPasswordSuffix = "_PASSWORD"
)

Variables

This section is empty.

Functions

func AppendGoogleSQLUserSecretEnvs

func AppendGoogleSQLUserSecretEnvs(ast *resource.Ast, naisSqlInstance nais.CloudSqlInstance, sourceName string) error

func CloudSqlInstanceWithDefaults

func CloudSqlInstanceWithDefaults(instance nais_io_v1.CloudSqlInstance, appName string) (nais_io_v1.CloudSqlInstance, error)

func CreateInstance

func CreateInstance(source Source, ast *resource.Ast, cfg Config) error

func GoogleSQLDatabase

func GoogleSQLDatabase(objectMeta metav1.ObjectMeta, instanceName, dbName, projectId string, cascadingDelete bool) *google_sql_crd.SQLDatabase

func GoogleSQLSecretName

func GoogleSQLSecretName(appName, instanceName, dbName, sqlUserName string) (string, error)

func GoogleSqlInstance

func GoogleSqlInstance(objectMeta metav1.ObjectMeta, instance nais_io_v1.CloudSqlInstance, cfg Config) *google_sql_crd.SQLInstance

func MapEnvToVars

func MapEnvToVars(env map[string]string, vars map[string]string) map[string]string

func MergeAndFilterDatabaseSQLUsers

func MergeAndFilterDatabaseSQLUsers(dbUsers []nais.CloudSqlDatabaseUser, instanceName string, dbNum int) ([]nais.CloudSqlDatabaseUser, error)

func ValidateFlag

func ValidateFlag(key string, value string) error

Types

type Config

type Config interface {
	GetGoogleProjectID() string
	GetGoogleTeamProjectID() string
	GetGoogleCloudSQLProxyContainerImage() string
	ShouldCreateSqlInstanceInSharedVpc() bool
	SqlInstanceExists() bool
	SqlInstanceHasPrivateIpInSharedVpc() bool
}

type GoogleSqlUser

type GoogleSqlUser struct {
	Name     string
	DB       *nais.CloudSqlDatabase
	Instance *googlesqlcrd.SQLInstance
}

func SetupGoogleSqlUser

func SetupGoogleSqlUser(name string, db *nais.CloudSqlDatabase, instance *googlesqlcrd.SQLInstance) GoogleSqlUser

func (GoogleSqlUser) Create

func (in GoogleSqlUser) Create(objectMeta metav1.ObjectMeta, cascadingDelete bool, secretKeyRefEnvName, appName, projectId string) (*googlesqlcrd.SQLUser, error)

func (GoogleSqlUser) CreateUserEnvVars

func (in GoogleSqlUser) CreateUserEnvVars(password string) map[string]string

func (GoogleSqlUser) KeyWithSuffixMatchingUser

func (in GoogleSqlUser) KeyWithSuffixMatchingUser(vars map[string]string, suffix string) (string, error)

type Source

type Source interface {
	resource.Source
	GetGCP() *nais_io_v1.GCP
}

Jump to

Keyboard shortcuts

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