aws_assume_role_chain.go 829 B

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