infra.go 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. package types
  2. import "time"
  3. // InfraStatus is the status that an infrastructure can take
  4. type InfraStatus string
  5. // The allowed statuses
  6. const (
  7. StatusCreating InfraStatus = "creating"
  8. StatusCreated InfraStatus = "created"
  9. StatusError InfraStatus = "error"
  10. StatusDestroying InfraStatus = "destroying"
  11. StatusDestroyed InfraStatus = "destroyed"
  12. )
  13. // InfraKind is the kind that infra can be
  14. type InfraKind string
  15. // The supported infra kinds
  16. const (
  17. InfraTest InfraKind = "test"
  18. InfraECR InfraKind = "ecr"
  19. InfraEKS InfraKind = "eks"
  20. InfraGCR InfraKind = "gcr"
  21. InfraGKE InfraKind = "gke"
  22. InfraDOCR InfraKind = "docr"
  23. InfraDOKS InfraKind = "doks"
  24. InfraRDS InfraKind = "rds"
  25. )
  26. type Infra struct {
  27. ID uint `json:"id"`
  28. CreatedAt time.Time `json:"created_at"`
  29. UpdatedAt time.Time `json:"updated_at"`
  30. // The project that this integration belongs to
  31. ProjectID uint `json:"project_id"`
  32. // The type of infra that was provisioned
  33. Kind InfraKind `json:"kind"`
  34. // Status is the status of the infra
  35. Status InfraStatus `json:"status"`
  36. // The AWS integration that was used to create the infra
  37. AWSIntegrationID uint `json:"aws_integration_id,omitempty"`
  38. // The GCP integration that was used to create the infra
  39. GCPIntegrationID uint `json:"gcp_integration_id,omitempty"`
  40. // The DO integration that was used to create the infra:
  41. // this points to an OAuthIntegrationID
  42. DOIntegrationID uint `json:"do_integration_id,omitempty"`
  43. // The last-applied, non-sensitive input variables to the provisioner. For now,
  44. // this is a map[string]string since we marshal into env vars anyway, but
  45. // eventually this config will be more complex.
  46. LastApplied map[string]string `json:"last_applied"`
  47. }