infra.go 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. )
  25. type Infra struct {
  26. ID uint `json:"id"`
  27. CreatedAt time.Time `json:"created_at"`
  28. UpdatedAt time.Time `json:"updated_at"`
  29. // The project that this integration belongs to
  30. ProjectID uint `json:"project_id"`
  31. // The type of infra that was provisioned
  32. Kind InfraKind `json:"kind"`
  33. // Status is the status of the infra
  34. Status InfraStatus `json:"status"`
  35. // The AWS integration that was used to create the infra
  36. AWSIntegrationID uint `json:"aws_integration_id,omitempty"`
  37. // The GCP integration that was used to create the infra
  38. GCPIntegrationID uint `json:"gcp_integration_id,omitempty"`
  39. // The DO integration that was used to create the infra:
  40. // this points to an OAuthIntegrationID
  41. DOIntegrationID uint `json:"do_integration_id,omitempty"`
  42. // The last-applied, non-sensitive input variables to the provisioner. For now,
  43. // this is a map[string]string since we marshal into env vars anyway, but
  44. // eventually this config will be more complex.
  45. LastApplied map[string]string `json:"last_applied"`
  46. }