aws_assume_role_chain.go 1019 B

12345678910111213141516171819202122232425262728293031323334
  1. package models
  2. import (
  3. "github.com/google/uuid"
  4. "gorm.io/gorm"
  5. )
  6. // AWSAssumeRoleChain represents an assume role chain link.
  7. // a unique constraint is created on this table by the migration script
  8. // because gorm creates unique indices, instead of unique constraints, which is utterly useless.
  9. type AWSAssumeRoleChain struct {
  10. gorm.Model
  11. // ID is a UUID for the CAPI Cluster's config
  12. ID uuid.UUID `gorm:"type:uuid;primaryKey"`
  13. // ProjectID is the ID of the project that the config belongs to.
  14. // This should be a foreign key, but GORM doesnt play well with FKs.
  15. ProjectID int `json:"project_id"`
  16. // SourceARN is ARN which will assume the target ARN
  17. SourceARN string `json:"source_arn"`
  18. // TargetARN is ARN which will assume the target ARN
  19. TargetARN string `json:"target_arn"`
  20. // ExternalID is ID which is required when assuming a role
  21. ExternalID string `json:"external_id"`
  22. }
  23. // TableName overrides the table name
  24. func (AWSAssumeRoleChain) TableName() string {
  25. return "aws_assume_role_chains"
  26. }