Documentation ¶
Index ¶
- Constants
- func CloudID(id string) string
- func DBSubnetGroupName(vpcID string) string
- func IAMSecretName(cloudID string) string
- func IsErrorCode(err error, code string) bool
- func KMSAliasNameRDS(awsID string) string
- func KMSKeyDescriptionRDS(awsID string) string
- func MattermostMySQLConnString(schema, endpoint, username, password string) string
- func MattermostRDSDatabaseName(installationID string) string
- func NewAWSSessionWithLogger(config *aws.Config, logger log.FieldLogger) (*session.Session, error)
- func RDSMasterInstanceID(installationID string) string
- func RDSMigrationInstanceID(installationID string) string
- func RDSMultitenantClusterSecretDescription(installationID, rdsClusterID string) string
- func RDSMultitenantSecretName(id string) string
- func RDSMySQLConnString(schema, endpoint, username, password string) string
- func RDSSecretName(cloudID string) string
- func RDSSnapshotTagValue(cloudID string) string
- type AWS
- type Client
- func (c *Client) AddSQLStore(store model.InstallationDatabaseStoreInterface)
- func (a *Client) AttachPolicyToRole(roleName, policyName string, logger log.FieldLogger) error
- func (a *Client) CreatePrivateCNAME(dnsName string, dnsEndpoints []string, logger log.FieldLogger) error
- func (a *Client) CreatePublicCNAME(dnsName string, dnsEndpoints []string, logger log.FieldLogger) error
- func (a *Client) DeletePrivateCNAME(dnsName string, logger log.FieldLogger) error
- func (a *Client) DeletePublicCNAME(dnsName string, logger log.FieldLogger) error
- func (a *Client) DetachPolicyFromRole(roleName, policyName string, logger log.FieldLogger) error
- func (a *Client) DynamoDBEnsureTableDeleted(tableName string, logger log.FieldLogger) error
- func (a *Client) GetAccountAliases() (*iam.ListAccountAliasesOutput, error)
- func (a *Client) GetAccountID() (string, error)
- func (a *Client) GetAndClaimVpcResources(clusterID, owner string, logger log.FieldLogger) (ClusterResources, error)
- func (a *Client) GetCertificateSummaryByTag(key, value string, logger log.FieldLogger) (*acm.CertificateSummary, error)
- func (a *Client) GetPrivateZoneDomainName(logger log.FieldLogger) (string, error)
- func (a *Client) GetPrivateZoneIDForDefaultTag(logger log.FieldLogger) (string, error)
- func (a *Client) GetSecurityGroupsWithFilters(filters []*ec2.Filter) ([]*ec2.SecurityGroup, error)
- func (a *Client) GetSubnetsWithFilters(filters []*ec2.Filter) ([]*ec2.Subnet, error)
- func (a *Client) GetTagByKeyAndZoneID(key string, id string, logger log.FieldLogger) (*Tag, error)
- func (a *Client) GetVpcsWithFilters(filters []*ec2.Filter) ([]*ec2.Vpc, error)
- func (c *Client) HasSQLStore() bool
- func (a *Client) IsProvisionedPrivateCNAME(dnsName string, logger log.FieldLogger) bool
- func (a *Client) IsValidAMI(AMIImage string, logger log.FieldLogger) (bool, error)
- func (a *Client) ReleaseVpc(clusterID string, logger log.FieldLogger) error
- func (a *Client) S3EnsureBucketDeleted(bucketName string, logger log.FieldLogger) error
- func (c *Client) Service() *Service
- func (a *Client) TagResource(resourceID, key, value string, logger log.FieldLogger) error
- func (a *Client) UntagResource(resourceID, key, value string, logger log.FieldLogger) error
- type ClusterResources
- type IAMAccessKey
- type RDSDatabase
- func (d *RDSDatabase) GenerateDatabaseSpecAndSecret(store model.InstallationDatabaseStoreInterface, logger log.FieldLogger) (*mmv1alpha1.Database, *corev1.Secret, error)
- func (d *RDSDatabase) Provision(store model.InstallationDatabaseStoreInterface, logger log.FieldLogger) error
- func (d *RDSDatabase) Snapshot(store model.InstallationDatabaseStoreInterface, logger log.FieldLogger) error
- func (d *RDSDatabase) Teardown(store model.InstallationDatabaseStoreInterface, keepData bool, ...) error
- type RDSDatabaseMigration
- type RDSMultitenantDatabase
- func (d *RDSMultitenantDatabase) GenerateDatabaseSpecAndSecret(store model.InstallationDatabaseStoreInterface, logger log.FieldLogger) (*mmv1alpha1.Database, *corev1.Secret, error)
- func (d *RDSMultitenantDatabase) Provision(store model.InstallationDatabaseStoreInterface, logger log.FieldLogger) error
- func (d *RDSMultitenantDatabase) Snapshot(store model.InstallationDatabaseStoreInterface, logger log.FieldLogger) error
- func (d *RDSMultitenantDatabase) Teardown(store model.InstallationDatabaseStoreInterface, keepData bool, ...) error
- type RDSSecret
- type S3Filestore
- type SQLDatabaseManager
- type Service
- type Tag
Constants ¶
const ( // S3URL is the S3 URL for making bucket API calls. S3URL = "s3.amazonaws.com" // DefaultAWSRegion is the default AWS region for AWS resources. DefaultAWSRegion = "us-east-1" // VpcAvailableTagKey is the tag key to determine if a VPC is currently in // use by a cluster or not. VpcAvailableTagKey = "tag:Available" // VpcAvailableTagValueTrue is the tag value for VpcAvailableTagKey when the // VPC is currently not in use by a cluster and can be claimed. VpcAvailableTagValueTrue = "true" // VpcAvailableTagValueFalse is the tag value for VpcAvailableTagKey when the // VPC is currently in use by a cluster and cannot be claimed. VpcAvailableTagValueFalse = "false" // VpcClusterIDTagKey is the tag key used to store the cluster ID of the // cluster running in that VPC. VpcClusterIDTagKey = "tag:CloudClusterID" // VpcClusterOwnerKey is the tag key used to store the owner of the // cluster's human name so that the VPC's owner can be identified VpcClusterOwnerKey = "tag:CloudClusterOwner" // VpcClusterOwnerValueNone is the tag value for VpcClusterOwnerKey when // there is no cluster running in the VPC. VpcClusterOwnerValueNone = "none" // VpcClusterIDTagValueNone is the tag value for VpcClusterIDTagKey when // there is no cluster running in the VPC. VpcClusterIDTagValueNone = "none" // DefaultDatabaseMySQLVersion is the default version of MySQL used when // creating databases. DefaultDatabaseMySQLVersion = "5.7" // DefaultDatabasePostgresVersion is the default version of PostgreSQL used // when creating databases. DefaultDatabasePostgresVersion = "11.7" // DefaultDBSubnetGroupName is the default DB subnet group name used when // creating DB clusters. This group name is defined by the owner of the AWS // accounts and can be the same across all accounts. // Note: This needs to be manually created before RDS databases can be used. DefaultDBSubnetGroupName = "mattermost-databases" // DefaultDBSecurityGroupTagKey is the default DB security group tag key // that is used to find security groups to use in configuration of the RDS // database. // Note: This needs to be manually created before RDS databases can be used. DefaultDBSecurityGroupTagKey = "tag:MattermostCloudInstallationDatabase" // DefaultDBSecurityGroupTagValue is the default DB security group tag value // that is used to find security groups to use in configuration of the RDS // database. // Note: This needs to be manually created before RDS databases can be used. DefaultDBSecurityGroupTagValue = "MYSQL/Aurora" // DefaultDBSubnetGroupTagKey is the default DB subnet group tag key that is // used to find subnet groups to use in configuration of the RDS database. // Note: This needs to be manually created before RDS databases can be used. DefaultDBSubnetGroupTagKey = "tag:MattermostCloudInstallationDatabase" // DefaultDBSubnetGroupTagValue is the default DB subnet group tag value // that is used to find subnet groups to use in configuration of the RDS // database. // Note: This needs to be manually created before RDS databases can be used. DefaultDBSubnetGroupTagValue = "MYSQL/Aurora" // DefaultInstallPrivateCertificatesTagKey is the default key used to find the private // TLS certificate ARN. DefaultInstallPrivateCertificatesTagKey = "tag:MattermostCloudPrivateCertificates" // DefaultInstallPrivateCertificatesTagValue is the default value used to find the private // TLS certificate ARN. DefaultInstallPrivateCertificatesTagValue = "true" // DefaultInstallCertificatesTagKey is the default key used to find the server // TLS certificate ARN. DefaultInstallCertificatesTagKey = "tag:MattermostCloudInstallationCertificates" // DefaultInstallCertificatesTagValue is the default value used to find the server // TLS certificate ARN. DefaultInstallCertificatesTagValue = "true" // DefaultCloudDNSTagKey is the default key used to find private and public hosted // zone IDs in AWS Route53. DefaultCloudDNSTagKey = "tag:MattermostCloudDNS" // DefaultAuditLogsCoreSecurityTagKey is the default key used to find its value which // has the format URL:port in which we send audit logs for each environment. // This URL is in Core Account and port is different for each environment //This tag exists in the Route53 Private hosted zones DefaultAuditLogsCoreSecurityTagKey = "tag:AuditLogsCoreSecurity" // DefaultPrivateCloudDNSTagValue is the default value used to find private hosted // zone ID in AWS Route53. DefaultPrivateCloudDNSTagValue = "private" // DefaultPublicCloudDNSTagValue is the default value used to find public hosted // zone ID in AWS Route53. DefaultPublicCloudDNSTagValue = "public" // CustomNodePolicyName is the name of the custom IAM policy that will be // attached in Kops Instance Profile. CustomNodePolicyName = "cloud-provisioning-node-policy" // DefaultMultitenantDatabaseCounterTagKey is the default key used to // identify the counter tag used in RDS multitenant database clusters. DefaultMultitenantDatabaseCounterTagKey = "tag:Counter" // DefaultClusterInstallationSnapshotTagKey is used for tagging snapshots // of a cluster installation. DefaultClusterInstallationSnapshotTagKey = "tag:ClusterInstallationSnapshot" // DefaultAWSClientRetries supplies how many time the AWS client will // retry a failed call. DefaultAWSClientRetries = 3 // KMSMaxTimeEncryptionKeyDeletion is the maximum number of days that // AWS will take to delete an encryption key. KMSMaxTimeEncryptionKeyDeletion = 30 // DefaultMySQLContextTimeSeconds is the number of seconds that a SQL // client will take before cancel a call to the database. DefaultMySQLContextTimeSeconds = 15 // DefaultRDSMultitenantDatabaseCountLimit is the maximum number of // schemas allowed in a multitenant RDS database cluster. DefaultRDSMultitenantDatabaseCountLimit = 10 // RDSMultitenantDBClusterResourceNamePrefix identifies the prefix // used for naming multitenant RDS DB cluster resources. // For example: "rds-cluster-multitenant-00000000000000000-a0000000" // Warning: // changing this value may cause the provisioner to not find some AWS resources. RDSMultitenantDBClusterResourceNamePrefix = "rds-cluster-multitenant" // DefaultMattermostInstallationIDTagKey is the default name used for // tagging resources with an installation ID. DefaultMattermostInstallationIDTagKey = "tag:InstallationId" // DefaultMattermostDatabaseUsername is the default username used for // connectting to a Mattermost database. // Warning: // changing this value may break the connection to existing installations. DefaultMattermostDatabaseUsername = "mmcloud" // DefaultResourceTypeClusterRDS is the default resource type used by // AWS to identify an RDS cluster. DefaultResourceTypeClusterRDS = "rds:cluster" // DefaultRDSStatusAvailable identify that a RDS cluster is in available // state. DefaultRDSStatusAvailable = "available" // DefaultRDSEncryptionTagKey in the default tag key used for tagging // RDS encryption keys // Warning: // changing this value will break the connection to AWS resources for existing installations. DefaultRDSEncryptionTagKey = "rds-encryption-key" // DefaultRDSMultitenantVPCIDTagKey is the key used to identify the VPC ID // used for multitenant RDS // database clusters. // Warning: // changing this value will break the connection to AWS resources for existing installations. DefaultRDSMultitenantVPCIDTagKey = "tag:VpcID" // DefaultRDSMultitenantDatabaseIDTagKey is the key used to identify a // multitenant RDS database clusters. // Warning: // changing this value will break the connection to AWS resources for existing installations. DefaultRDSMultitenantDatabaseIDTagKey = "tag:MultitenantDatabaseID" // DefaultRDSMultitenantDatabaseTypeTagKey is the key used to identify a // multitenant RDS database clusters. // Warning: // changing this value will break the connection to AWS resources for existing installations. DefaultRDSMultitenantDatabaseTypeTagKey = "tag:DatabaseType" // DefaultRDSMultitenantDatabaseTypeTagValue key used to identify a // multitenant database cluster of type multitenant-rds. // Warning: // changing this value will break the connection to AWS resources for existing installations. DefaultRDSMultitenantDatabaseTypeTagValue = "multitenant-rds" // RDSMultitenantPurposeTagKey is the key used to identify the purpose // of an RDS cluster. // Warning: // changing this value will break the connection to AWS resources for existing installations. RDSMultitenantPurposeTagKey = "tag:Purpose" // RDSMultitenantPurposeTagValueProvisioning is one of the purposes of // an RDS cluster. // Warning: // changing this value will break the connection to AWS resources for existing installations. RDSMultitenantPurposeTagValueProvisioning = "provisioning" // RDSMultitenantOwnerTagKey identifies who owns the RDS cluster. // Warning: // changing this value will break the connection to AWS resources for existing installations. RDSMultitenantOwnerTagKey = "tag:Owner" // RDSMultitenantInstallationCounterTagKey identifies the number of // installations in the RDS cluster. // Warning: // changing this value will break the connection to AWS resources for existing installations. RDSMultitenantInstallationCounterTagKey = "tag:Counter" // RDSMultitenantOwnerTagValueCloudTeam identifies that cloud team // owns the RDS cluster. // Warning: // changing this value will break the connection to AWS resources for existing installations. RDSMultitenantOwnerTagValueCloudTeam = "cloud-team" // DefaultAWSTerraformProvisionedKey identifies wether or not a AWS // resource has been provisioned via Terraform. // Warning: // changing this value will break the connection to AWS resources for existing installations. DefaultAWSTerraformProvisionedKey = "Terraform" // DefaultAWSTerraformProvisionedValueTrue indicates that the AWS // resource has been provisioned via Terraform. // Warning: // changing this value will break the connection to AWS resources for existing installations. DefaultAWSTerraformProvisionedValueTrue = "true" )
Variables ¶
This section is empty.
Functions ¶
func CloudID ¶ added in v0.7.0
CloudID returns the standard ID used for AWS resource names. This ID is used to correlate installations to AWS resources.
func DBSubnetGroupName ¶ added in v0.17.0
DBSubnetGroupName formats the subnet group name used for RDS databases.
func IAMSecretName ¶ added in v0.8.0
IAMSecretName returns the IAM Access Key secret name for a given Cloud ID.
func IsErrorCode ¶ added in v0.18.0
IsErrorCode asserts that an AWS error has a certain code.
func KMSAliasNameRDS ¶ added in v0.19.0
KMSAliasNameRDS formats the alias name associated with a KMS encryption key used specifically for RDS databases.
func KMSKeyDescriptionRDS ¶ added in v0.19.0
KMSKeyDescriptionRDS formats the description of an KMS key used for encrypting a RDS cluster.
func MattermostMySQLConnString ¶ added in v0.19.0
MattermostMySQLConnString formats the connection string used for accessing a Mattermost database.
func MattermostRDSDatabaseName ¶ added in v0.19.0
MattermostRDSDatabaseName formats the name of a Mattermost RDS database schema.
func NewAWSSessionWithLogger ¶ added in v0.17.0
NewAWSSessionWithLogger initializes an AWS session instance with logging handler for debuging only.
func RDSMasterInstanceID ¶ added in v0.17.0
RDSMasterInstanceID formats the name used for RDS database instances.
func RDSMigrationInstanceID ¶ added in v0.18.0
RDSMigrationInstanceID formats the name used for migrated RDS database instances.
func RDSMultitenantClusterSecretDescription ¶ added in v0.19.0
RDSMultitenantClusterSecretDescription formats the text used for the describing a multitenant database's secret key.
func RDSMultitenantSecretName ¶ added in v0.19.0
RDSMultitenantSecretName formats the name of a secret used in a multitenant RDS database.
func RDSMySQLConnString ¶ added in v0.19.0
RDSMySQLConnString formats the connection string used for accessing a MySQL RDS cluster.
func RDSSecretName ¶ added in v0.8.0
RDSSecretName returns the RDS secret name for a given Cloud ID.
func RDSSnapshotTagValue ¶ added in v0.17.0
RDSSnapshotTagValue returns the value for tagging a RDS snapshot.
Types ¶
type AWS ¶
type AWS interface { GetCertificateSummaryByTag(key, value string, logger log.FieldLogger) (*acm.CertificateSummary, error) GetAndClaimVpcResources(clusterID, owner string, logger log.FieldLogger) (ClusterResources, error) ReleaseVpc(clusterID string, logger log.FieldLogger) error AttachPolicyToRole(roleName, policyName string, logger log.FieldLogger) error DetachPolicyFromRole(roleName, policyName string, logger log.FieldLogger) error GetPrivateZoneDomainName(logger log.FieldLogger) (string, error) GetPrivateZoneIDForDefaultTag(logger log.FieldLogger) (string, error) GetTagByKeyAndZoneID(key string, id string, logger log.FieldLogger) (*Tag, error) CreatePrivateCNAME(dnsName string, dnsEndpoints []string, logger log.FieldLogger) error CreatePublicCNAME(dnsName string, dnsEndpoints []string, logger log.FieldLogger) error IsProvisionedPrivateCNAME(dnsName string, logger log.FieldLogger) bool DeletePrivateCNAME(dnsName string, logger log.FieldLogger) error DeletePublicCNAME(dnsName string, logger log.FieldLogger) error TagResource(resourceID, key, value string, logger log.FieldLogger) error UntagResource(resourceID, key, value string, logger log.FieldLogger) error IsValidAMI(AMIImage string, logger log.FieldLogger) (bool, error) GetAccountAliases() (*iam.ListAccountAliasesOutput, error) DynamoDBEnsureTableDeleted(tableName string, logger log.FieldLogger) error S3EnsureBucketDeleted(bucketName string, logger log.FieldLogger) error }
AWS interface for use by other packages.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for interacting with AWS resources.
func NewAWSClientWithConfig ¶ added in v0.17.0
func NewAWSClientWithConfig(config *aws.Config, logger log.FieldLogger) *Client
NewAWSClientWithConfig returns a new instance of Client with a custom configuration.
func (*Client) AddSQLStore ¶ added in v0.10.0
func (c *Client) AddSQLStore(store model.InstallationDatabaseStoreInterface)
AddSQLStore adds SQLStore functionality to the AWS client.
func (*Client) AttachPolicyToRole ¶ added in v0.24.0
func (a *Client) AttachPolicyToRole(roleName, policyName string, logger log.FieldLogger) error
AttachPolicyToRole attaches a precreated IAM policy to an IAM role.
func (*Client) CreatePrivateCNAME ¶ added in v0.11.0
func (a *Client) CreatePrivateCNAME(dnsName string, dnsEndpoints []string, logger log.FieldLogger) error
CreatePrivateCNAME creates a record in Route53 for a private domain name.
func (*Client) CreatePublicCNAME ¶ added in v0.11.0
func (a *Client) CreatePublicCNAME(dnsName string, dnsEndpoints []string, logger log.FieldLogger) error
CreatePublicCNAME creates a record in Route53 for a public domain name.
func (*Client) DeletePrivateCNAME ¶ added in v0.11.0
func (a *Client) DeletePrivateCNAME(dnsName string, logger log.FieldLogger) error
DeletePrivateCNAME deletes a AWS route53 record for a private domain name.
func (*Client) DeletePublicCNAME ¶ added in v0.11.0
func (a *Client) DeletePublicCNAME(dnsName string, logger log.FieldLogger) error
DeletePublicCNAME deletes a AWS route53 record for a public domain name.
func (*Client) DetachPolicyFromRole ¶ added in v0.24.0
func (a *Client) DetachPolicyFromRole(roleName, policyName string, logger log.FieldLogger) error
DetachPolicyFromRole detaches an IAM policy from an IAM role.
func (*Client) DynamoDBEnsureTableDeleted ¶ added in v0.24.0
func (a *Client) DynamoDBEnsureTableDeleted(tableName string, logger log.FieldLogger) error
DynamoDBEnsureTableDeleted is used to check if DynamoDB table exists and delete it.
func (*Client) GetAccountAliases ¶ added in v0.20.0
func (a *Client) GetAccountAliases() (*iam.ListAccountAliasesOutput, error)
GetAccountAliases returns the AWS account name aliases.
func (*Client) GetAccountID ¶ added in v0.24.0
GetAccountID gets the current AWS Account ID
func (*Client) GetAndClaimVpcResources ¶ added in v0.9.0
func (a *Client) GetAndClaimVpcResources(clusterID, owner string, logger log.FieldLogger) (ClusterResources, error)
GetAndClaimVpcResources creates ClusterResources from an available VPC and tags them appropriately.
func (*Client) GetCertificateSummaryByTag ¶ added in v0.11.0
func (a *Client) GetCertificateSummaryByTag(key, value string, logger log.FieldLogger) (*acm.CertificateSummary, error)
GetCertificateSummaryByTag returns the certificate summary associated with a valid tag key and value in AWS.
func (*Client) GetPrivateZoneDomainName ¶ added in v0.13.0
func (a *Client) GetPrivateZoneDomainName(logger log.FieldLogger) (string, error)
GetPrivateZoneDomainName gets the private Route53 domain name.
func (*Client) GetPrivateZoneIDForDefaultTag ¶ added in v0.22.0
func (a *Client) GetPrivateZoneIDForDefaultTag(logger log.FieldLogger) (string, error)
GetPrivateZoneIDForDefaultTag returns the Private R53 hosted zone ID for the default tag `MattermostCloudDNS`
func (*Client) GetSecurityGroupsWithFilters ¶ added in v0.17.0
GetSecurityGroupsWithFilters returns SGs matching a given filter.
func (*Client) GetSubnetsWithFilters ¶ added in v0.17.0
GetSubnetsWithFilters returns subnets matching a given filter.
func (*Client) GetTagByKeyAndZoneID ¶ added in v0.22.0
GetTagByKeyAndZoneID returns a Tag of a given tag:key and of a given route53 id
func (*Client) GetVpcsWithFilters ¶ added in v0.17.0
GetVpcsWithFilters returns VPCs matching a given filter.
func (*Client) HasSQLStore ¶ added in v0.10.0
HasSQLStore returns whether the AWS client has a SQL store or not.
func (*Client) IsProvisionedPrivateCNAME ¶ added in v0.19.0
func (a *Client) IsProvisionedPrivateCNAME(dnsName string, logger log.FieldLogger) bool
IsProvisionedPrivateCNAME returns true if a record has been registered for the given CNAME (full FQDN required as input)
func (*Client) IsValidAMI ¶ added in v0.11.0
IsValidAMI check if the provided AMI exists
func (*Client) ReleaseVpc ¶ added in v0.9.0
func (a *Client) ReleaseVpc(clusterID string, logger log.FieldLogger) error
ReleaseVpc changes the tags on a VPC to mark it as "available" again.
func (*Client) S3EnsureBucketDeleted ¶ added in v0.24.0
func (a *Client) S3EnsureBucketDeleted(bucketName string, logger log.FieldLogger) error
S3EnsureBucketDeleted is used to check if S3 bucket exists, clean it and delete it.
func (*Client) Service ¶ added in v0.17.0
Service contructs an AWS session if not yet successfully done and returns AWS clients.
func (*Client) TagResource ¶
func (a *Client) TagResource(resourceID, key, value string, logger log.FieldLogger) error
TagResource tags an AWS EC2 resource.
func (*Client) UntagResource ¶
func (a *Client) UntagResource(resourceID, key, value string, logger log.FieldLogger) error
UntagResource deletes tags from an AWS EC2 resource.
type ClusterResources ¶ added in v0.9.0
type ClusterResources struct { VpcID string PrivateSubnetIDs []string PublicSubnetsIDs []string MasterSecurityGroupIDs []string WorkerSecurityGroupIDs []string }
ClusterResources is a collection of AWS resources that will be used to create a kops cluster.
func (*ClusterResources) IsValid ¶ added in v0.9.0
func (cr *ClusterResources) IsValid() error
IsValid returns whether or not ClusterResources is valid or not.
type IAMAccessKey ¶ added in v0.7.0
IAMAccessKey is the ID and Secret of an AWS IAM user's access key.
func (*IAMAccessKey) Validate ¶ added in v0.8.0
func (s *IAMAccessKey) Validate() error
Validate performs a basic sanity check on the IAM Access Key secret.
type RDSDatabase ¶ added in v0.8.0
type RDSDatabase struct {
// contains filtered or unexported fields
}
RDSDatabase is a database backed by AWS RDS.
func NewRDSDatabase ¶ added in v0.8.0
func NewRDSDatabase(databaseType, installationID string, client *Client) *RDSDatabase
NewRDSDatabase returns a new RDSDatabase interface.
func (*RDSDatabase) GenerateDatabaseSpecAndSecret ¶ added in v0.8.0
func (d *RDSDatabase) GenerateDatabaseSpecAndSecret(store model.InstallationDatabaseStoreInterface, logger log.FieldLogger) (*mmv1alpha1.Database, *corev1.Secret, error)
GenerateDatabaseSpecAndSecret creates the k8s database spec and secret for accessing the RDS database.
func (*RDSDatabase) Provision ¶ added in v0.8.0
func (d *RDSDatabase) Provision(store model.InstallationDatabaseStoreInterface, logger log.FieldLogger) error
Provision completes all the steps necessary to provision a RDS database.
func (*RDSDatabase) Snapshot ¶ added in v0.17.0
func (d *RDSDatabase) Snapshot(store model.InstallationDatabaseStoreInterface, logger log.FieldLogger) error
Snapshot creates a snapshot of the RDS database.
func (*RDSDatabase) Teardown ¶ added in v0.8.0
func (d *RDSDatabase) Teardown(store model.InstallationDatabaseStoreInterface, keepData bool, logger log.FieldLogger) error
Teardown removes all AWS resources related to a RDS database.
type RDSDatabaseMigration ¶ added in v0.18.0
type RDSDatabaseMigration struct {
// contains filtered or unexported fields
}
RDSDatabaseMigration is a migrated database backed by AWS RDS.
func NewRDSDatabaseMigration ¶ added in v0.18.0
func NewRDSDatabaseMigration(masterInstallationID, slaveInstallationID string, awsClient *Client) *RDSDatabaseMigration
NewRDSDatabaseMigration returns a new RDSDatabaseMigration.
func (*RDSDatabaseMigration) Replicate ¶ added in v0.18.0
func (d *RDSDatabaseMigration) Replicate(logger log.FieldLogger) (string, error)
Replicate starts the process for replicating an master RDS database. This method must return an resplication status or an error.
func (*RDSDatabaseMigration) Setup ¶ added in v0.18.0
func (d *RDSDatabaseMigration) Setup(logger log.FieldLogger) (string, error)
Setup sets access from one RDS database to another and sets any configuration needed for replication.
func (*RDSDatabaseMigration) Teardown ¶ added in v0.18.0
func (d *RDSDatabaseMigration) Teardown(logger log.FieldLogger) (string, error)
Teardown removes access from one RDS database to another and rollback any previous database configuration.
type RDSMultitenantDatabase ¶ added in v0.19.0
type RDSMultitenantDatabase struct {
// contains filtered or unexported fields
}
RDSMultitenantDatabase is a database backed by RDS that supports multi-tenancy.
func NewRDSMultitenantDatabase ¶ added in v0.19.0
func NewRDSMultitenantDatabase(instanceID, installationID string, client *Client) *RDSMultitenantDatabase
NewRDSMultitenantDatabase returns a new instance of RDSMultitenantDatabase that implements database interface.
func (*RDSMultitenantDatabase) GenerateDatabaseSpecAndSecret ¶ added in v0.19.0
func (d *RDSMultitenantDatabase) GenerateDatabaseSpecAndSecret(store model.InstallationDatabaseStoreInterface, logger log.FieldLogger) (*mmv1alpha1.Database, *corev1.Secret, error)
GenerateDatabaseSpecAndSecret creates the k8s database spec and secret for accessing a single database inside a RDS multitenant cluster.
func (*RDSMultitenantDatabase) Provision ¶ added in v0.19.0
func (d *RDSMultitenantDatabase) Provision(store model.InstallationDatabaseStoreInterface, logger log.FieldLogger) error
Provision claims a multitenant RDS cluster and creates a database schema for the installation.
func (*RDSMultitenantDatabase) Snapshot ¶ added in v0.19.0
func (d *RDSMultitenantDatabase) Snapshot(store model.InstallationDatabaseStoreInterface, logger log.FieldLogger) error
Snapshot creates a snapshot of single RDS multitenant database.
func (*RDSMultitenantDatabase) Teardown ¶ added in v0.19.0
func (d *RDSMultitenantDatabase) Teardown(store model.InstallationDatabaseStoreInterface, keepData bool, logger log.FieldLogger) error
Teardown removes all AWS resources related to a RDS multitenant database.
type S3Filestore ¶ added in v0.7.0
type S3Filestore struct {
// contains filtered or unexported fields
}
S3Filestore is a filestore backed by AWS S3.
func NewS3Filestore ¶ added in v0.7.0
func NewS3Filestore(installationID string, awsClient *Client) *S3Filestore
NewS3Filestore returns a new S3Filestore interface.
func (*S3Filestore) GenerateFilestoreSpecAndSecret ¶ added in v0.7.0
func (f *S3Filestore) GenerateFilestoreSpecAndSecret(logger log.FieldLogger) (*mmv1alpha1.Minio, *corev1.Secret, error)
GenerateFilestoreSpecAndSecret creates the k8s filestore spec and secret for accessing the S3 bucket.
func (*S3Filestore) Provision ¶ added in v0.7.0
func (f *S3Filestore) Provision(logger log.FieldLogger) error
Provision completes all the steps necessary to provision an S3 filestore.
func (*S3Filestore) Teardown ¶ added in v0.7.0
func (f *S3Filestore) Teardown(keepData bool, logger log.FieldLogger) error
Teardown removes all AWS resources related to an S3 filestore.
type SQLDatabaseManager ¶ added in v0.19.0
type SQLDatabaseManager interface { QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) Close() error }
SQLDatabaseManager is an interface that describes operations to query and to close connection with a database. It's used mainly to implement a client that needs to perform non-complex queries in a SQL database instance.
type Service ¶ added in v0.17.0
type Service struct {
// contains filtered or unexported fields
}
Service hold AWS clients for each service.
func NewService ¶ added in v0.17.0
NewService creates a new instance of Service.