Documentation
¶
Index ¶
- Variables
- type Input
- type PublicInfo
- type Runtime
- type Service
- func (s *Service) Info(ctx context.Context) (PublicInfo, error)
- func (s *Service) Runtime(ctx context.Context) (Runtime, error)
- func (s *Service) SaveAndVerify(ctx context.Context, updatedBy string, input Input) (PublicInfo, error)
- func (s *Service) StateOutputs(ctx context.Context, project, target, stage string) (map[string]any, error)
- type Store
- type StoredConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotConfigured = errors.New("统一 Terraform 状态中心尚未配置") ErrInvalidConfig = errors.New("invalid Terraform state backend configuration") )
Functions ¶
This section is empty.
Types ¶
type Input ¶
type Input struct {
Enabled bool `json:"enabled"`
Bucket string `json:"bucket"`
Region string `json:"region"`
KeyPrefix string `json:"key_prefix"`
KMSKeyID string `json:"kms_key_id"`
AccessKeyID string `json:"access_key_id"`
SecretAccessKey string `json:"secret_access_key"`
SessionToken string `json:"session_token"`
}
type PublicInfo ¶
type PublicInfo struct {
Configured bool `json:"configured"`
Enabled bool `json:"enabled"`
Bucket string `json:"bucket,omitempty"`
Region string `json:"region,omitempty"`
KeyPrefix string `json:"key_prefix,omitempty"`
KMSKeyID string `json:"kms_key_id,omitempty"`
MaskedAccessKey string `json:"masked_access_key,omitempty"`
AccountID string `json:"account_id,omitempty"`
PrincipalARN string `json:"principal_arn,omitempty"`
UpdatedBy string `json:"updated_by,omitempty"`
VerifiedAt time.Time `json:"verified_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}
type Runtime ¶
type Runtime struct {
Bucket, Region, KeyPrefix, KMSKeyID string
AccountID string
AccessKeyID, SecretAccessKey, SessionToken string
}
Runtime is intentionally never serialized or returned by the HTTP API.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) SaveAndVerify ¶
func (*Service) StateOutputs ¶
func (s *Service) StateOutputs(ctx context.Context, project, target, stage string) (map[string]any, error)
StateOutputs reads the root module outputs directly from the centralized S3 state. Runtime Terraform backend files are deliberately removed after a job, so status and resource discovery must not depend on a local backend cache surviving the deployment process.
type Store ¶
type Store interface {
GetTerraformStateBackend(context.Context) (StoredConfig, error)
SaveTerraformStateBackend(context.Context, StoredConfig) error
}
type StoredConfig ¶
Click to show internal directories.
Click to hide internal directories.