infra.go 1.6 KB

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