datastore.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. package models
  2. import (
  3. "github.com/google/uuid"
  4. "gorm.io/gorm"
  5. )
  6. // Datastore is a database model that represents a Porter-provisioned datastore
  7. type Datastore struct {
  8. gorm.Model
  9. // ID is a uuid that references the datastore
  10. ID uuid.UUID `gorm:"type:uuid;primaryKey" json:"id"`
  11. // ProjectID is the ID of the project that the datastore belongs to
  12. ProjectID uint
  13. // Name is the name of the datastore
  14. Name string
  15. // CloudProvider is the cloud provider that hosts the Kubernetes Cluster. Accepted values: [AWS, GCP, AZURE]
  16. CloudProvider string `json:"cloud_provider"`
  17. // CloudProviderCredentialIdentifier is a reference to find the credentials required for access the cluster's API.
  18. // This was likely the credential that was used to create the cluster.
  19. // For AWS EKS clusters, this will be an ARN for the final target role in the assume role chain.
  20. CloudProviderCredentialIdentifier string `json:"cloud_provider_credential_identifier"`
  21. // Type is the type of datastore. Accepted values: [RDS, ELASTICACHE]
  22. Type string `json:"type"`
  23. // Engine is the engine of the datastore. Accepted values: [POSTGRES, AURORA-POSTGRES, REDIS]
  24. Engine string `json:"engine"`
  25. }