Documentation ¶
Overview ¶
Package kmsconfig configures KMS tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // ID is the ID used for KMS resource creation. ID string `json:"id,omitempty"` // ConfigPath is the configuration file path. // Deployer is expected to update this file with latest status. ConfigPath string `json:"config-path,omitempty"` // AWSAccountID is the AWS account ID. AWSAccountID string `json:"aws-account-id,omitempty"` // AWSRegion is the AWS geographic area for EKS deployment. // If empty, set default region. AWSRegion string `json:"aws-region,omitempty"` // LogLevel configures log level. Only supports debug, info, warn, error, panic, or fatal. Default 'info'. LogLevel string `json:"log-level"` // LogOutputs is a list of log outputs. Valid values are 'default', 'stderr', 'stdout', or file names. // Logs are appended to the existing file, if any. // Multiple values are accepted. If empty, it sets to 'default', which outputs to stderr. // See https://godoc.org/go.uber.org/zap#Open and https://godoc.org/go.uber.org/zap#Config for more details. LogOutputs []string `json:"log-outputs,omitempty"` // UpdatedAt is the timestamp when the configuration has been updated. // Read only to 'Config' struct users. UpdatedAt time.Time `json:"updated-at,omitempty"` // read-only to user // KeyMetadata is the EKS metadata status. KeyMetadata *KeyMetadata `json:"key-meta-data,omitempty"` // KeyRotationEnabled is true, if key rotation is enabled. KeyRotationEnabled bool `json:"key-rotation-enabled,omitempty"` }
Config defines EKS test configuration.
func Load ¶
Load loads configuration from YAML. Useful when injecting shared configuration via ConfigMap.
Example usage:
import "github.com/aws/aws-k8s-tester/kmsconfig" cfg := kmsconfig.Load("test.yaml") err := cfg.ValidateAndSetDefaults()
Do not set default values in this function. "ValidateAndSetDefaults" must be called separately, to prevent overwriting previous data when loaded from disks.
func (*Config) UpdateFromEnvs ¶
UpdateFromEnvs updates fields from environmental variables.
func (*Config) ValidateAndSetDefaults ¶
ValidateAndSetDefaults returns an error for invalid configurations. And updates empty fields with default values. At the end, it writes populated YAML to aws-k8s-tester config path.
type KeyMetadata ¶
type KeyMetadata struct { AWSAccountID string `json:"aws-account-id"` ARN string `json:"arn"` CreationDate time.Time `json:"creation-date"` Description string `json:"description"` Enabled bool `json:"enabled"` KeyID string `json:"key-id"` KeyManager string `json:"key-manager"` KeyState string `json:"key-state"` KeyUsage string `json:"key-usage"` Origin string `json:"origin"` }
KeyMetadata is the key's current metadata.