Documentation
¶
Index ¶
- Variables
- func CamelToSnake(s string) string
- func JSON2Jsonnet(filename string, data []byte) ([]byte, error)
- func JSONDiffString(fromStr, toStr string, opts ...JSONDiffOption) string
- func LoggerSetup(w io.Writer, minLevel string) func()
- func MarshalJSONString(s interface{}, overrides ...any) string
- func SnakeToCamel(s string) string
- type App
- func (app *App) Delete(ctx context.Context, opt DeleteOption) error
- func (app *App) Deploy(ctx context.Context, opt DeployOption) error
- func (app *App) Diff(ctx context.Context, opt DiffOption) error
- func (app *App) Execute(ctx context.Context, opt ExecuteOption) error
- func (app *App) Init(ctx context.Context, opt InitOption) error
- func (app *App) Pull(ctx context.Context, opt PullOption) error
- func (app *App) Render(ctx context.Context, opt RenderOption) error
- func (app *App) Rollback(ctx context.Context, opt RollbackOption) error
- func (app *App) SetAliasName(aliasName string)
- func (app *App) StateMachineAliasName() string
- func (app *App) Status(ctx context.Context, opt StatusOption) error
- func (app *App) Studio(ctx context.Context, opt StudioOption) error
- func (app *App) Versions(ctx context.Context, opt VersionsOption) error
- type CLI
- type CloudWatchLogsClient
- type Config
- func (cfg *Config) EndpointResolver() (aws.EndpointResolverWithOptions, bool)
- func (cfg *Config) LoadAWSConfig(ctx context.Context) (aws.Config, error)
- func (cfg *Config) NewEventBridgeRules() EventBridgeRules
- func (cfg *Config) NewSchedules() Schedules
- func (cfg *Config) NewStateMachine() *StateMachine
- func (cfg *Config) Restrict() error
- func (cfg *Config) StateMachineDefinition() string
- func (cfg *Config) StateMachineName() string
- func (cfg *Config) ValidateVersion(version string) error
- type ConfigLoader
- func (l *ConfigLoader) AppendFuncMap(prefix string, funcMap template.FuncMap) error
- func (l *ConfigLoader) AppendTFState(ctx context.Context, prefix string, tfState string) error
- func (l *ConfigLoader) Load(ctx context.Context, path string) (*Config, error)
- func (l *ConfigLoader) SetCloudWatchLogsClient(client CloudWatchLogsClient)
- type DeleteOption
- type DeployCommandOption
- type DeployOption
- type DeployStateMachineOutput
- type DescribeStateMachineInput
- type DiffOption
- type EndpointsConfig
- type EventBridgeClient
- type EventBridgeRule
- func (rule *EventBridgeRule) AppendTags(tags map[string]string)
- func (rule *EventBridgeRule) DeleteTag(key string)
- func (rule *EventBridgeRule) DiffString(newRule *EventBridgeRule, unified bool) string
- func (rule *EventBridgeRule) IsManagedBy() bool
- func (rule *EventBridgeRule) SetEnabled(enabled bool)
- func (rule *EventBridgeRule) SetStateMachineQualifiedArn(stateMachineArn string)
- func (rule *EventBridgeRule) Source() string
- func (rule *EventBridgeRule) String() string
- type EventBridgeRules
- func (rules EventBridgeRules) AppendTags(tags map[string]string)
- func (rules EventBridgeRules) DiffString(newRules EventBridgeRules, unified bool) string
- func (rules EventBridgeRules) FindByName(name string) (*EventBridgeRule, bool)
- func (rules EventBridgeRules) Len() int
- func (rules EventBridgeRules) Less(i, j int) bool
- func (rules EventBridgeRules) Names() []string
- func (rules EventBridgeRules) SetEnabled(enabled bool)
- func (rules EventBridgeRules) SetStateMachineQualifiedArn(stateMachineArn string)
- func (rules EventBridgeRules) String() string
- func (rules EventBridgeRules) Swap(i, j int)
- func (rules EventBridgeRules) SyncState(other EventBridgeRules)
- type EventBridgeService
- type EventBridgeServiceImpl
- type ExecuteOption
- type GetStateMachineArnInput
- type HistoryEvent
- type InitOption
- type JSONDiffOption
- type KeysToSnakeCase
- type ListStateMachineVersionsOutput
- type NewAppOption
- func WithAWSConfig(awsCfg aws.Config) NewAppOption
- func WithEventBridgeClient(eventBridgeClient EventBridgeClient) NewAppOption
- func WithEventBridgeService(eventBridgeService EventBridgeService) NewAppOption
- func WithSFnClient(sfnClient SFnClient) NewAppOption
- func WithSFnService(sfnService SFnService) NewAppOption
- func WithSchedulerClient(schedulerClient SchedulerClient) NewAppOption
- func WithSchedulerService(schedulerService SchedulerService) NewAppOption
- type OrderdMap
- type OutputFormatter
- type PullOption
- type RenderOption
- type Renderer
- func (r *Renderer) CreateConfigFile(ctx context.Context, path string, template bool) error
- func (r *Renderer) CreateDefinitionFile(ctx context.Context, path string, template bool) error
- func (r *Renderer) RenderConfig(ctx context.Context, w io.Writer, format string, template bool) error
- func (r *Renderer) RenderStateMachine(ctx context.Context, w io.Writer, format string, template bool) error
- type RollbackOption
- type RulesStatus
- type SFnClient
- type SFnService
- type SFnServiceImpl
- func (svc *SFnServiceImpl) DeleteStateMachine(ctx context.Context, stateMachine *StateMachine) error
- func (svc *SFnServiceImpl) DeployStateMachine(ctx context.Context, stateMachine *StateMachine) (*DeployStateMachineOutput, error)
- func (svc *SFnServiceImpl) DescribeStateMachine(ctx context.Context, params *DescribeStateMachineInput) (*StateMachine, error)
- func (svc *SFnServiceImpl) GetExecutionHistory(ctx context.Context, executionArn string) ([]HistoryEvent, error)
- func (svc *SFnServiceImpl) GetStateMachineArn(ctx context.Context, params *GetStateMachineArnInput) (string, error)
- func (svc *SFnServiceImpl) ListStateMachineVersions(ctx context.Context, stateMachine *StateMachine) (*ListStateMachineVersionsOutput, error)
- func (svc *SFnServiceImpl) PurgeStateMachineVersions(ctx context.Context, stateMachine *StateMachine, keepVerions int) error
- func (svc *SFnServiceImpl) RollbackStateMachine(ctx context.Context, stateMachine *StateMachine, keepVersion bool, dryRun bool) error
- func (svc *SFnServiceImpl) SetAliasName(aliasName string)
- func (svc *SFnServiceImpl) StartExecution(ctx context.Context, stateMachine *StateMachine, params *StartExecutionInput) (*StartExecutionOutput, error)
- type Schedule
- type ScheduleCommandOption
- type ScheduleConfig
- type ScheduleStatus
- type SchedulerClient
- type SchedulerService
- type SchedulerServiceImpl
- type Schedules
- func (s Schedules) DiffString(newSchedules Schedules, unified bool) string
- func (s Schedules) FilterPassed() (result, passed Schedules)
- func (s Schedules) FindByName(name string) (*Schedule, bool)
- func (s Schedules) Len() int
- func (s Schedules) Less(i, j int) bool
- func (s Schedules) Names() []string
- func (s Schedules) SetEnabled(enabled bool)
- func (s Schedules) SetStateMachineQualifiedArn(stateMachineArn string)
- func (s Schedules) String() string
- func (s Schedules) Swap(i, j int)
- func (s Schedules) SyncState(other Schedules)
- type SearchRelatedRulesInput
- type SearchRelatedSchedulesInput
- type StartExecutionInput
- type StartExecutionOutput
- type StateMachine
- func (s *StateMachine) AppendTags(tags map[string]string)
- func (s *StateMachine) DefinitionSource() string
- func (s *StateMachine) DeleteTag(key string)
- func (s *StateMachine) DiffString(newStateMachine *StateMachine, unified bool) string
- func (s *StateMachine) IsManagedBy() bool
- func (s *StateMachine) QualifiedArn(name string) string
- func (s *StateMachine) Source() string
- func (s *StateMachine) String() string
- type StateMachineConfig
- type StateMachineLogging
- type StateMachineLoggingDestination
- type StateMachineStatus
- type StateMachineVersionListItem
- type StatusOption
- type StatusOutput
- type StudioOption
- type TFStateConfig
- type TriggerConfig
- type TriggerEventConfig
- type TriggerEventConfigInner
- type TriggerScheduleConfig
- type VersionsOption
Constants ¶
This section is empty.
Variables ¶
var ( ErrStateMachineDoesNotExist = errors.New("state machine does not exist") ErrRollbackTargetNotFound = errors.New("rollback target not found") )
var (
ErrEventBridgeRuleDoesNotExist = errors.New("schedule rule does not exist")
)
var ErrScheduleNotFound = errors.New("schedule not found")
var Version = "v0.9.3"
Functions ¶
func CamelToSnake ¶ added in v0.6.0
func JSONDiffString ¶ added in v0.6.0
func JSONDiffString(fromStr, toStr string, opts ...JSONDiffOption) string
func LoggerSetup ¶ added in v0.6.0
func MarshalJSONString ¶ added in v0.6.0
func SnakeToCamel ¶ added in v0.6.0
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
func (*App) Execute ¶ added in v0.3.0
func (app *App) Execute(ctx context.Context, opt ExecuteOption) error
func (*App) Rollback ¶ added in v0.6.0
func (app *App) Rollback(ctx context.Context, opt RollbackOption) error
func (*App) SetAliasName ¶ added in v0.6.0
func (*App) StateMachineAliasName ¶ added in v0.6.0
func (*App) Status ¶ added in v0.6.0
func (app *App) Status(ctx context.Context, opt StatusOption) error
type CLI ¶ added in v0.6.0
type CLI struct {
LogLevel string `` /* 139-byte string literal not displayed */
Config string `` /* 132-byte string literal not displayed */
TFState string `name:"tfstate" help:"URL to terraform.tfstate referenced in config" env:"STEFUNNY_TFSTATE" json:"tfstate,omitempty"`
ExtStr []string `name:"ext-str" help:"external string values for Jsonnet" default:"" json:"ext_str,omitempty"`
ExtCode []string `name:"ext-code" help:"external code values for Jsonnet" default:"" json:"ext_code,omitempty"`
AWSRegion string `name:"region" help:"AWS region" default:"" env:"AWS_REGION" json:"region,omitempty"`
AliasName string `name:"alias" help:"Alias name for state machine" default:"current" env:"STEFUNNY_ALIAS" json:"alias,omitempty"`
Version struct{} `cmd:"" help:"Show version" json:"version,omitempty"`
Init InitOption `cmd:"" help:"Initialize stefunny configuration" json:"init,omitempty"`
Delete DeleteOption `cmd:"" help:"Delete state machine and schedule rules" json:"delete,omitempty"`
Deploy DeployCommandOption `cmd:"" help:"Deploy state machine and schedule rules" json:"deploy,omitempty"`
Rollback RollbackOption `cmd:"" help:"Rollback state machine" json:"rollback,omitempty"`
Schedule ScheduleCommandOption `cmd:"" help:"Enable or disable schedule rules (deprecated)" json:"schedule,omitempty"`
Render RenderOption `cmd:"" help:"Render state machine definition" json:"render,omitempty"`
Execute ExecuteOption `cmd:"" help:"Execute state machine" json:"execute,omitempty"`
Versions VersionsOption `cmd:"" help:"Manage state machine versions" json:"versions,omitempty"`
Diff DiffOption `cmd:"" help:"Show diff of state machine definition and trigers" json:"diff,omitempty"`
Pull PullOption `cmd:"" help:"Pull state machine definition" json:"pull,omitempty"`
Studio StudioOption `cmd:"" help:"Show Step Functions workflow studio URL" json:"studio,omitempty"`
Status StatusOption `cmd:"" help:"Show status of state machine" json:"status,omitempty"`
// contains filtered or unexported fields
}
func (*CLI) NoExpandPath ¶ added in v0.6.0
func (cli *CLI) NoExpandPath()
NoExpandPath disables path expansion. for testing
func (*CLI) Parse ¶ added in v0.6.0
Parse parses the command line arguments and returns the command name
type CloudWatchLogsClient ¶ added in v0.6.0
type CloudWatchLogsClient interface {
cloudwatchlogs.DescribeLogGroupsAPIClient
}
type Config ¶
type Config struct {
RequiredVersion string `` /* 153-byte string literal not displayed */
AWSRegion string `` /* 128-byte string literal not displayed */
StateMachine *StateMachineConfig `yaml:"state_machine,omitempty" json:"state_machine,omitempty"`
Trigger *TriggerConfig `yaml:"trigger,omitempty" json:"trigger,omitempty"`
Schedule []*ScheduleConfig `yaml:"schedule,omitempty" json:"schedule,omitempty"`
Tags map[string]string `yaml:"tags,omitempty" json:"tags,omitempty"`
Endpoints *EndpointsConfig `yaml:"endpoints,omitempty" json:"endpoints,omitempty"`
TFState []*TFStateConfig `yaml:"tfstate,omitempty" json:"tfstate,omitempty"`
ConfigDir string `yaml:"-" json:"-"`
ConfigFileName string `yaml:"-" json:"-"`
Envs *OrderdMap[string, string] `yaml:"-" json:"-"`
MustEnvs *OrderdMap[string, string] `yaml:"-" json:"-"`
Files *OrderdMap[string, string] `yaml:"-" json:"-"`
TemplateFiles *OrderdMap[string, string] `yaml:"-" json:"-"`
// contains filtered or unexported fields
}
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
func (*Config) EndpointResolver ¶
func (cfg *Config) EndpointResolver() (aws.EndpointResolverWithOptions, bool)
func (*Config) LoadAWSConfig ¶ added in v0.6.0
func (*Config) NewEventBridgeRules ¶ added in v0.6.0
func (cfg *Config) NewEventBridgeRules() EventBridgeRules
func (*Config) NewSchedules ¶ added in v0.6.0
func (*Config) NewStateMachine ¶ added in v0.6.0
func (cfg *Config) NewStateMachine() *StateMachine
func (*Config) StateMachineDefinition ¶ added in v0.6.0
func (*Config) StateMachineName ¶ added in v0.6.0
func (*Config) ValidateVersion ¶
ValidateVersion validates a version satisfies required_version.
type ConfigLoader ¶ added in v0.6.0
type ConfigLoader struct {
// contains filtered or unexported fields
}
func NewConfigLoader ¶ added in v0.6.0
func NewConfigLoader(extStr, extCode map[string]string) *ConfigLoader
func (*ConfigLoader) AppendFuncMap ¶ added in v0.6.0
func (l *ConfigLoader) AppendFuncMap(prefix string, funcMap template.FuncMap) error
func (*ConfigLoader) AppendTFState ¶ added in v0.6.0
func (*ConfigLoader) SetCloudWatchLogsClient ¶ added in v0.6.0
func (l *ConfigLoader) SetCloudWatchLogsClient(client CloudWatchLogsClient)
type DeleteOption ¶
type DeleteOption struct {
DryRun bool `name:"dry-run" help:"Dry run" json:"dry_run,omitempty"`
Force bool `name:"force" help:"delete without confirmation" json:"force,omitempty"`
}
func (DeleteOption) DryRunString ¶
func (opt DeleteOption) DryRunString() string
type DeployCommandOption ¶ added in v0.6.0
type DeployCommandOption struct {
DryRun bool `name:"dry-run" help:"Dry run" json:"dry_run,omitempty"`
SkipStateMachine bool `name:"skip-state-machine" help:"Skip deploy state machine" json:"skip_state_machine,omitempty"`
SkipTrigger bool `name:"skip-trigger" help:"Skip deploy trigger" json:"skip_trigger,omitempty"`
VersionDescription string `name:"version-description" help:"Version description" json:"version_description,omitempty"`
KeepVersions int `` /* 144-byte string literal not displayed */
TriggerEnabled bool `name:"trigger-enabled" help:"Enable trigger" xor:"trigger" json:"trigger_enabled,omitempty"`
TriggerDisabled bool `name:"trigger-disabled" help:"Disable trigger" xor:"trigger" json:"trigger_disabled,omitempty"`
Unified bool `name:"unified" help:"when dry run, output unified diff" negatable:"" default:"true" json:"unified,omitempty"`
}
func (*DeployCommandOption) DeployOption ¶ added in v0.6.0
func (cmd *DeployCommandOption) DeployOption() DeployOption
type DeployOption ¶
type DeployOption struct {
DryRun bool
TriggerEnabled *bool
SkipStateMachine bool
SkipTrigger bool
VersionDescription string
KeepVersions int
Unified bool
}
func (DeployOption) DryRunString ¶
func (opt DeployOption) DryRunString() string
type DescribeStateMachineInput ¶ added in v0.6.0
type DiffOption ¶ added in v0.6.0
type EndpointsConfig ¶
type EndpointsConfig struct {
StepFunctions string `yaml:"stepfunctions,omitempty" json:"step_functions,omitempty"`
CloudWatchLogs string `yaml:"cloudwatchlogs,omitempty" json:"cloud_watch_logs,omitempty"`
STS string `yaml:"sts,omitempty" json:"sts,omitempty"`
EventBridge string `yaml:"eventbridge,omitempty" json:"event_bridge,omitempty"`
}
type EventBridgeClient ¶
type EventBridgeClient interface {
eventbridgex.ListRuleNamesByTargetAPIClient
PutRule(ctx context.Context, params *eventbridge.PutRuleInput, optFns ...func(*eventbridge.Options)) (*eventbridge.PutRuleOutput, error)
DescribeRule(ctx context.Context, params *eventbridge.DescribeRuleInput, optFns ...func(*eventbridge.Options)) (*eventbridge.DescribeRuleOutput, error)
ListTargetsByRule(ctx context.Context, params *eventbridge.ListTargetsByRuleInput, optFns ...func(*eventbridge.Options)) (*eventbridge.ListTargetsByRuleOutput, error)
PutTargets(ctx context.Context, params *eventbridge.PutTargetsInput, optFns ...func(*eventbridge.Options)) (*eventbridge.PutTargetsOutput, error)
DeleteRule(ctx context.Context, params *eventbridge.DeleteRuleInput, optFns ...func(*eventbridge.Options)) (*eventbridge.DeleteRuleOutput, error)
RemoveTargets(ctx context.Context, params *eventbridge.RemoveTargetsInput, optFns ...func(*eventbridge.Options)) (*eventbridge.RemoveTargetsOutput, error)
ListTagsForResource(ctx context.Context, params *eventbridge.ListTagsForResourceInput, optFns ...func(*eventbridge.Options)) (*eventbridge.ListTagsForResourceOutput, error)
TagResource(ctx context.Context, params *eventbridge.TagResourceInput, optFns ...func(*eventbridge.Options)) (*eventbridge.TagResourceOutput, error)
}
type EventBridgeRule ¶ added in v0.6.0
type EventBridgeRule struct {
eventbridge.PutRuleInput
RuleArn *string `yaml:"RuleArn,omitempty" json:"RuleArn,omitempty"`
CreatedBy *string `yaml:"CreatedBy,omitempty" json:"CreatedBy,omitempty"`
Target eventbridgetypes.Target `yaml:"Target,omitempty" json:"Target,omitempty"`
AdditionalTargets []eventbridgetypes.Target `yaml:"AdditionalTargets,omitempty" json:"AdditionalTargets,omitempty"`
ConfigFilePath *string `yaml:"ConfigFilePath,omitempty" json:"ConfigFilePath,omitempty"`
ConfigFileIndex int `yaml:"ConfigFileIndex,omitempty" json:"ConfigFileIndex,omitempty"`
}
func (*EventBridgeRule) AppendTags ¶ added in v0.6.0
func (rule *EventBridgeRule) AppendTags(tags map[string]string)
func (*EventBridgeRule) DeleteTag ¶ added in v0.6.0
func (rule *EventBridgeRule) DeleteTag(key string)
func (*EventBridgeRule) DiffString ¶ added in v0.6.0
func (rule *EventBridgeRule) DiffString(newRule *EventBridgeRule, unified bool) string
func (*EventBridgeRule) IsManagedBy ¶ added in v0.6.0
func (rule *EventBridgeRule) IsManagedBy() bool
func (*EventBridgeRule) SetEnabled ¶ added in v0.6.0
func (rule *EventBridgeRule) SetEnabled(enabled bool)
func (*EventBridgeRule) SetStateMachineQualifiedArn ¶ added in v0.6.0
func (rule *EventBridgeRule) SetStateMachineQualifiedArn(stateMachineArn string)
func (*EventBridgeRule) Source ¶ added in v0.8.4
func (rule *EventBridgeRule) Source() string
func (*EventBridgeRule) String ¶ added in v0.6.0
func (rule *EventBridgeRule) String() string
type EventBridgeRules ¶ added in v0.6.0
type EventBridgeRules []*EventBridgeRule
func (EventBridgeRules) AppendTags ¶ added in v0.7.3
func (rules EventBridgeRules) AppendTags(tags map[string]string)
func (EventBridgeRules) DiffString ¶ added in v0.6.0
func (rules EventBridgeRules) DiffString(newRules EventBridgeRules, unified bool) string
func (EventBridgeRules) FindByName ¶ added in v0.6.0
func (rules EventBridgeRules) FindByName(name string) (*EventBridgeRule, bool)
func (EventBridgeRules) Len ¶ added in v0.6.0
func (rules EventBridgeRules) Len() int
sort.Interfaces
func (EventBridgeRules) Less ¶ added in v0.6.0
func (rules EventBridgeRules) Less(i, j int) bool
func (EventBridgeRules) Names ¶ added in v0.6.0
func (rules EventBridgeRules) Names() []string
func (EventBridgeRules) SetEnabled ¶ added in v0.6.0
func (rules EventBridgeRules) SetEnabled(enabled bool)
func (EventBridgeRules) SetStateMachineQualifiedArn ¶ added in v0.6.0
func (rules EventBridgeRules) SetStateMachineQualifiedArn(stateMachineArn string)
func (EventBridgeRules) String ¶ added in v0.6.0
func (rules EventBridgeRules) String() string
func (EventBridgeRules) Swap ¶ added in v0.6.0
func (rules EventBridgeRules) Swap(i, j int)
func (EventBridgeRules) SyncState ¶ added in v0.6.0
func (rules EventBridgeRules) SyncState(other EventBridgeRules)
type EventBridgeService ¶ added in v0.6.0
type EventBridgeService interface {
SearchRelatedRules(ctx context.Context, params *SearchRelatedRulesInput) (EventBridgeRules, error)
DeployRules(ctx context.Context, stateMachineArn string, rules EventBridgeRules, keepState bool) error
}
type EventBridgeServiceImpl ¶ added in v0.6.0
type EventBridgeServiceImpl struct {
// contains filtered or unexported fields
}
func NewEventBridgeService ¶ added in v0.6.0
func NewEventBridgeService(client EventBridgeClient) *EventBridgeServiceImpl
func (*EventBridgeServiceImpl) DeployRules ¶ added in v0.6.0
func (svc *EventBridgeServiceImpl) DeployRules(ctx context.Context, stateMachineArn string, rules EventBridgeRules, keepState bool) error
func (*EventBridgeServiceImpl) SearchRelatedRules ¶ added in v0.6.0
func (svc *EventBridgeServiceImpl) SearchRelatedRules(ctx context.Context, params *SearchRelatedRulesInput) (EventBridgeRules, error)
type ExecuteOption ¶ added in v0.3.0
type ExecuteOption struct {
Stdout io.Writer `kong:"-" json:"-"`
Stderr io.Writer `kong:"-" json:"-"`
Input string `name:"input" help:"input JSON string" default:"-" type:"existingfile" json:"input,omitempty"`
ExecutionName string `name:"name" help:"execution name" default:"" json:"name,omitempty"`
Async bool `name:"async" help:"start execution and return immediately" json:"async,omitempty"`
DumpHistory bool `name:"dump-history" help:"dump execution history" json:"dump_history,omitempty"`
Qualifier *string `name:"qualifier" help:"state machine version qualifier" json:"qualifier,omitempty"`
}
type GetStateMachineArnInput ¶ added in v0.6.0
type GetStateMachineArnInput struct {
Name string
}
type HistoryEvent ¶ added in v0.3.0
type HistoryEvent struct {
StartDate time.Time
Step string
sfntypes.HistoryEvent
}
func (HistoryEvent) Elapsed ¶ added in v0.3.0
func (event HistoryEvent) Elapsed() time.Duration
type InitOption ¶ added in v0.6.0
type InitOption struct {
StateMachineName string `` /* 137-byte string literal not displayed */
DefinitionFilePath string `` /* 149-byte string literal not displayed */
TFState string `kong:"-" help:"Path to terraform state file" type:"path" json:"tfstate,omitempty"` // TODO: if removed global flag, not ignore this flag for kong
Envs []string `name:"env" help:"templateize environment variables" json:"envs,omitempty"`
MustEnvs []string `name:"must-env" help:"templateize must environment variables" json:"must_envs,omitempty"`
SkipTrigger bool `name:"skip-trigger" help:"Skip trigger" json:"skip_trigger,omitempty"`
ConfigPath string `kong:"-" json:"-"`
AWSRegion string `kong:"-" json:"-"`
}
type JSONDiffOption ¶ added in v0.6.0
type JSONDiffOption func(*jsonDiffParams)
func JSONDiffFromURI ¶ added in v0.6.0
func JSONDiffFromURI(uri string) JSONDiffOption
func JSONDiffToURI ¶ added in v0.6.0
func JSONDiffToURI(uri string) JSONDiffOption
func JSONDiffUnified ¶ added in v0.6.0
func JSONDiffUnified(b bool) JSONDiffOption
type KeysToSnakeCase ¶ added in v0.6.0
KeysToSnakeCase converts the keys of the given object to snake case. The given object is expected struct, json struct key is CamelCase.
func NewKeysToSnakeCase ¶ added in v0.6.0
func NewKeysToSnakeCase[T any](v T) KeysToSnakeCase[T]
func (KeysToSnakeCase[T]) MarshalJSON ¶ added in v0.6.0
func (k KeysToSnakeCase[T]) MarshalJSON() ([]byte, error)
func (KeysToSnakeCase[T]) MarshalYAML ¶ added in v0.6.0
func (k KeysToSnakeCase[T]) MarshalYAML() (interface{}, error)
func (*KeysToSnakeCase[T]) UnmarshalJSON ¶ added in v0.6.0
func (k *KeysToSnakeCase[T]) UnmarshalJSON(bs []byte) error
type ListStateMachineVersionsOutput ¶ added in v0.6.0
type ListStateMachineVersionsOutput struct {
StateMachineArn string
Versions []StateMachineVersionListItem
}
type NewAppOption ¶ added in v0.6.0
type NewAppOption func(*newAppOptions)
func WithAWSConfig ¶ added in v0.6.0
func WithAWSConfig(awsCfg aws.Config) NewAppOption
WithAWSConfig sets the AWS config for New(ctx, cfg, opts...) this is for testing
func WithEventBridgeClient ¶ added in v0.6.0
func WithEventBridgeClient(eventBridgeClient EventBridgeClient) NewAppOption
WithEventBridgeClient sets the EventBridge client for New(ctx, cfg, opts...) this is for testing
func WithEventBridgeService ¶ added in v0.6.0
func WithEventBridgeService(eventBridgeService EventBridgeService) NewAppOption
WithEventBridgeService sets the EventBridge service for New(ctx, cfg, opts...)
func WithSFnClient ¶ added in v0.6.0
func WithSFnClient(sfnClient SFnClient) NewAppOption
WithSFNClient sets the SFn client for New(ctx, cfg, opts...) this is for testing
func WithSFnService ¶ added in v0.6.0
func WithSFnService(sfnService SFnService) NewAppOption
WithSFnService sets the SFn service for New(ctx, cfg, opts...)
func WithSchedulerClient ¶ added in v0.6.0
func WithSchedulerClient(schedulerClient SchedulerClient) NewAppOption
func WithSchedulerService ¶ added in v0.6.0
func WithSchedulerService(schedulerService SchedulerService) NewAppOption
type OrderdMap ¶ added in v0.6.0
type OrderdMap[K comparable, V any] struct { // contains filtered or unexported fields }
func ListResourcesFromTFState ¶ added in v0.6.0
ListResourcesFromTFState returns resource arn, security group id, vpc id, subnet id, and caller account_id
func NewOrderdMap ¶ added in v0.6.0
func NewOrderdMap[K comparable, V any]() *OrderdMap[K, V]
type OutputFormatter ¶ added in v0.6.0
type OutputFormatter struct {
Data *ListStateMachineVersionsOutput
Format string
}
func (OutputFormatter) JSON ¶ added in v0.6.0
func (f OutputFormatter) JSON() string
func (OutputFormatter) String ¶ added in v0.6.0
func (f OutputFormatter) String() string
func (OutputFormatter) TSV ¶ added in v0.6.0
func (f OutputFormatter) TSV() string
func (OutputFormatter) Table ¶ added in v0.6.0
func (f OutputFormatter) Table() string
type PullOption ¶ added in v0.6.0
type RenderOption ¶
type RenderOption struct {
Writer io.Writer `kong:"-" json:"-"`
Targets []string `arg:"" help:"target to render (config, definition, def)" enum:"config,definition,def" json:"targets,omitempty"`
Format string `name:"format" help:"output format(json, jsonnet, yaml)" default:"" enum:",json,jsonnet,yaml" json:"format,omitempty"`
}
type Renderer ¶ added in v0.6.0
type Renderer struct {
// contains filtered or unexported fields
}
func NewRenderer ¶ added in v0.6.0
func (*Renderer) CreateConfigFile ¶ added in v0.6.0
func (*Renderer) CreateDefinitionFile ¶ added in v0.6.0
func (*Renderer) RenderConfig ¶ added in v0.6.0
type RollbackOption ¶ added in v0.6.0
type RollbackOption struct {
DryRun bool `name:"dry-run" help:"Dry run" json:"dry_run,omitempty"`
KeepVersion bool `name:"keep-version" help:"Keep current version, no delete" json:"keep_version,omitempty"`
}
func (RollbackOption) DryRunString ¶ added in v0.6.0
func (opt RollbackOption) DryRunString() string
type RulesStatus ¶ added in v0.6.0
type RulesStatus struct {
RuleArn string `json:"rule_arn,omitempty"`
RuleName string `json:"rule_name"`
Status string `json:"status"`
ScheduleExpression *string `json:"schedule_expression,omitempty"`
EventPattern *string `json:"event_pattern,omitempty"`
Target string `json:"target,omitempty"`
}
func (*RulesStatus) String ¶ added in v0.6.0
func (r *RulesStatus) String() string
type SFnClient ¶
type SFnClient interface {
sfn.ListStateMachinesAPIClient
sfnx.ListStateMachineAliasesAPIClient
sfnx.ListStateMachineVersionsAPIClient
CreateStateMachine(ctx context.Context, params *sfn.CreateStateMachineInput, optFns ...func(*sfn.Options)) (*sfn.CreateStateMachineOutput, error)
CreateStateMachineAlias(ctx context.Context, params *sfn.CreateStateMachineAliasInput, optFns ...func(*sfn.Options)) (*sfn.CreateStateMachineAliasOutput, error)
DescribeStateMachine(ctx context.Context, params *sfn.DescribeStateMachineInput, optFns ...func(*sfn.Options)) (*sfn.DescribeStateMachineOutput, error)
DescribeStateMachineAlias(ctx context.Context, params *sfn.DescribeStateMachineAliasInput, optFns ...func(*sfn.Options)) (*sfn.DescribeStateMachineAliasOutput, error)
UpdateStateMachine(ctx context.Context, params *sfn.UpdateStateMachineInput, optFns ...func(*sfn.Options)) (*sfn.UpdateStateMachineOutput, error)
UpdateStateMachineAlias(ctx context.Context, params *sfn.UpdateStateMachineAliasInput, optFns ...func(*sfn.Options)) (*sfn.UpdateStateMachineAliasOutput, error)
DeleteStateMachine(ctx context.Context, params *sfn.DeleteStateMachineInput, optFns ...func(*sfn.Options)) (*sfn.DeleteStateMachineOutput, error)
DeleteStateMachineVersion(ctx context.Context, params *sfn.DeleteStateMachineVersionInput, optFns ...func(*sfn.Options)) (*sfn.DeleteStateMachineVersionOutput, error)
ListTagsForResource(ctx context.Context, params *sfn.ListTagsForResourceInput, optFns ...func(*sfn.Options)) (*sfn.ListTagsForResourceOutput, error)
StartExecution(ctx context.Context, params *sfn.StartExecutionInput, optFns ...func(*sfn.Options)) (*sfn.StartExecutionOutput, error)
StartSyncExecution(ctx context.Context, params *sfn.StartSyncExecutionInput, optFns ...func(*sfn.Options)) (*sfn.StartSyncExecutionOutput, error)
DescribeExecution(ctx context.Context, params *sfn.DescribeExecutionInput, optFns ...func(*sfn.Options)) (*sfn.DescribeExecutionOutput, error)
StopExecution(ctx context.Context, params *sfn.StopExecutionInput, optFns ...func(*sfn.Options)) (*sfn.StopExecutionOutput, error)
GetExecutionHistory(ctx context.Context, params *sfn.GetExecutionHistoryInput, optFns ...func(*sfn.Options)) (*sfn.GetExecutionHistoryOutput, error)
TagResource(ctx context.Context, params *sfn.TagResourceInput, optFns ...func(*sfn.Options)) (*sfn.TagResourceOutput, error)
}
type SFnService ¶ added in v0.6.0
type SFnService interface {
DescribeStateMachine(ctx context.Context, params *DescribeStateMachineInput) (*StateMachine, error)
GetStateMachineArn(ctx context.Context, params *GetStateMachineArnInput) (string, error)
DeployStateMachine(ctx context.Context, stateMachine *StateMachine) (*DeployStateMachineOutput, error)
DeleteStateMachine(ctx context.Context, stateMachine *StateMachine) error
RollbackStateMachine(ctx context.Context, stateMachine *StateMachine, keepVersion bool, dryRun bool) error
ListStateMachineVersions(ctx context.Context, stateMachine *StateMachine) (*ListStateMachineVersionsOutput, error)
PurgeStateMachineVersions(ctx context.Context, stateMachine *StateMachine, keepVersions int) error
StartExecution(ctx context.Context, stateMachine *StateMachine, params *StartExecutionInput) (*StartExecutionOutput, error)
GetExecutionHistory(ctx context.Context, executionArn string) ([]HistoryEvent, error)
SetAliasName(aliasName string)
}
type SFnServiceImpl ¶ added in v0.6.0
type SFnServiceImpl struct {
// contains filtered or unexported fields
}
func NewSFnService ¶ added in v0.6.0
func NewSFnService(client SFnClient) *SFnServiceImpl
func (*SFnServiceImpl) DeleteStateMachine ¶ added in v0.6.0
func (svc *SFnServiceImpl) DeleteStateMachine(ctx context.Context, stateMachine *StateMachine) error
func (*SFnServiceImpl) DeployStateMachine ¶ added in v0.6.0
func (svc *SFnServiceImpl) DeployStateMachine(ctx context.Context, stateMachine *StateMachine) (*DeployStateMachineOutput, error)
func (*SFnServiceImpl) DescribeStateMachine ¶ added in v0.6.0
func (svc *SFnServiceImpl) DescribeStateMachine(ctx context.Context, params *DescribeStateMachineInput) (*StateMachine, error)
func (*SFnServiceImpl) GetExecutionHistory ¶ added in v0.6.0
func (svc *SFnServiceImpl) GetExecutionHistory(ctx context.Context, executionArn string) ([]HistoryEvent, error)
func (*SFnServiceImpl) GetStateMachineArn ¶ added in v0.6.0
func (svc *SFnServiceImpl) GetStateMachineArn(ctx context.Context, params *GetStateMachineArnInput) (string, error)
func (*SFnServiceImpl) ListStateMachineVersions ¶ added in v0.6.0
func (svc *SFnServiceImpl) ListStateMachineVersions(ctx context.Context, stateMachine *StateMachine) (*ListStateMachineVersionsOutput, error)
func (*SFnServiceImpl) PurgeStateMachineVersions ¶ added in v0.6.0
func (svc *SFnServiceImpl) PurgeStateMachineVersions(ctx context.Context, stateMachine *StateMachine, keepVerions int) error
func (*SFnServiceImpl) RollbackStateMachine ¶ added in v0.6.0
func (svc *SFnServiceImpl) RollbackStateMachine(ctx context.Context, stateMachine *StateMachine, keepVersion bool, dryRun bool) error
func (*SFnServiceImpl) SetAliasName ¶ added in v0.6.0
func (svc *SFnServiceImpl) SetAliasName(aliasName string)
func (*SFnServiceImpl) StartExecution ¶ added in v0.6.0
func (svc *SFnServiceImpl) StartExecution(ctx context.Context, stateMachine *StateMachine, params *StartExecutionInput) (*StartExecutionOutput, error)
type Schedule ¶ added in v0.6.0
type Schedule struct {
scheduler.CreateScheduleInput
ScheduleArn *string `min:"1" type:"string"`
CreationDate *time.Time `type:"timestamp"`
ConfigFilePath *string
ConfigFileIndex int
}
func (*Schedule) DiffString ¶ added in v0.6.0
func (*Schedule) HasItPassed ¶ added in v0.6.0
func (*Schedule) SetEnabled ¶ added in v0.6.0
func (*Schedule) SetStateMachineQualifiedArn ¶ added in v0.6.0
type ScheduleCommandOption ¶ added in v0.6.0
type ScheduleCommandOption struct {
DryRun bool `name:"dry-run" help:"Dry run" json:"dry_run,omitempty"`
Enabled bool `name:"enabled" help:"Enable schedule" xor:"schedule" required:"" json:"enabled,omitempty"`
Disabled bool `name:"disabled" help:"Disable schedule" xor:"schedule" required:"" json:"disabled,omitempty"`
}
func (*ScheduleCommandOption) DeployOption ¶ added in v0.6.0
func (cmd *ScheduleCommandOption) DeployOption() DeployOption
type ScheduleConfig ¶
type ScheduleConfig struct {
ID string `yaml:"id,omitempty" json:"id,omitempty"`
RuleName string `yaml:"rule_name,omitempty" json:"rule_name,omitempty"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
Expression string `yaml:"expression,omitempty" json:"expression,omitempty"`
RoleArn string `yaml:"role_arn,omitempty" json:"role_arn,omitempty"`
}
type ScheduleStatus ¶ added in v0.6.0
type ScheduleStatus struct {
ScheduleName string `json:"schedule_name"`
ScheduleArn string `json:"schedule_arn,omitempty"`
Status string `json:"status"`
ScheduleExpression string `json:"schedule_expression"`
ScheduleExpressionTimezone string `json:"schedule_expression_timezone"`
Target string `json:"target,omitempty"`
}
func (*ScheduleStatus) String ¶ added in v0.6.0
func (s *ScheduleStatus) String() string
type SchedulerClient ¶ added in v0.6.0
type SchedulerClient interface {
CreateSchedule(ctx context.Context, params *scheduler.CreateScheduleInput, optFns ...func(*scheduler.Options)) (*scheduler.CreateScheduleOutput, error)
DeleteSchedule(ctx context.Context, params *scheduler.DeleteScheduleInput, optFns ...func(*scheduler.Options)) (*scheduler.DeleteScheduleOutput, error)
GetSchedule(ctx context.Context, params *scheduler.GetScheduleInput, optFns ...func(*scheduler.Options)) (*scheduler.GetScheduleOutput, error)
ListSchedules(ctx context.Context, params *scheduler.ListSchedulesInput, optFns ...func(*scheduler.Options)) (*scheduler.ListSchedulesOutput, error)
ListScheduleGroups(ctx context.Context, params *scheduler.ListScheduleGroupsInput, optFns ...func(*scheduler.Options)) (*scheduler.ListScheduleGroupsOutput, error)
UpdateSchedule(ctx context.Context, params *scheduler.UpdateScheduleInput, optFns ...func(*scheduler.Options)) (*scheduler.UpdateScheduleOutput, error)
}
type SchedulerService ¶ added in v0.6.0
type SchedulerServiceImpl ¶ added in v0.6.0
type SchedulerServiceImpl struct {
// contains filtered or unexported fields
}
func NewSchedulerService ¶ added in v0.6.0
func NewSchedulerService(client SchedulerClient) *SchedulerServiceImpl
func (*SchedulerServiceImpl) DeploySchedules ¶ added in v0.6.0
func (*SchedulerServiceImpl) SearchRelatedSchedules ¶ added in v0.6.0
func (svc *SchedulerServiceImpl) SearchRelatedSchedules(ctx context.Context, params *SearchRelatedSchedulesInput) (Schedules, error)
type Schedules ¶ added in v0.6.0
type Schedules []*Schedule
func (Schedules) DiffString ¶ added in v0.6.0
func (Schedules) FilterPassed ¶ added in v0.6.0
func (Schedules) FindByName ¶ added in v0.6.0
func (Schedules) SetEnabled ¶ added in v0.6.0
func (Schedules) SetStateMachineQualifiedArn ¶ added in v0.6.0
type SearchRelatedRulesInput ¶ added in v0.6.0
type SearchRelatedSchedulesInput ¶ added in v0.6.0
type StartExecutionInput ¶ added in v0.6.0
type StartExecutionOutput ¶ added in v0.3.0
type StartExecutionOutput struct {
CanNotDumpHistory bool
ExecutionArn string
StartDate time.Time
Success *bool
Failed *bool
StopDate *time.Time
Output *string
Datail interface{}
}
func (*StartExecutionOutput) Elapsed ¶ added in v0.6.0
func (o *StartExecutionOutput) Elapsed() time.Duration
type StateMachine ¶
type StateMachine struct {
sfn.CreateStateMachineInput
CreationDate *time.Time
LastUpdateDate *time.Time
StateMachineArn *string
Status sfntypes.StateMachineStatus
ConfigFilePath *string
DefinitionPath *string
}
func (*StateMachine) AppendTags ¶ added in v0.6.0
func (s *StateMachine) AppendTags(tags map[string]string)
func (*StateMachine) DefinitionSource ¶ added in v0.8.4
func (s *StateMachine) DefinitionSource() string
func (*StateMachine) DeleteTag ¶ added in v0.6.0
func (s *StateMachine) DeleteTag(key string)
func (*StateMachine) DiffString ¶
func (s *StateMachine) DiffString(newStateMachine *StateMachine, unified bool) string
func (*StateMachine) IsManagedBy ¶ added in v0.6.0
func (s *StateMachine) IsManagedBy() bool
func (*StateMachine) QualifiedArn ¶ added in v0.6.0
func (s *StateMachine) QualifiedArn(name string) string
func (*StateMachine) Source ¶ added in v0.8.4
func (s *StateMachine) Source() string
func (*StateMachine) String ¶
func (s *StateMachine) String() string
type StateMachineConfig ¶
type StateMachineConfig struct {
KeysToSnakeCase[sfn.CreateStateMachineInput] `yaml:",inline" json:",inline"`
DefinitionPath string `yaml:"definition_path,omitempty" json:"definition_path,omitempty"`
Logging *StateMachineLogging `yaml:"-,omitempty"`
Tracing *sfntypes.TracingConfiguration `yaml:"-,omitempty"`
}
func (*StateMachineConfig) Restrict ¶
func (cfg *StateMachineConfig) Restrict() error
Restrict restricts a configuration.
func (*StateMachineConfig) SetDefinition ¶ added in v0.6.0
func (cfg *StateMachineConfig) SetDefinition(definition string)
func (*StateMachineConfig) SetDetinitionPath ¶ added in v0.6.0
func (cfg *StateMachineConfig) SetDetinitionPath(path string)
func (*StateMachineConfig) UnmarshalJSON ¶ added in v0.6.0
func (cfg *StateMachineConfig) UnmarshalJSON(b []byte) error
type StateMachineLogging ¶ added in v0.6.0
type StateMachineLogging struct {
Level string `yaml:"level,omitempty" json:"level,omitempty"`
IncludeExecutionData bool `yaml:"include_execution_data,omitempty" json:"include_execution_data,omitempty"`
Destination *StateMachineLoggingDestination `yaml:"destination,omitempty" json:"destination,omitempty"`
}
type StateMachineLoggingDestination ¶ added in v0.6.0
type StateMachineLoggingDestination struct {
LogGroup string `yaml:"log_group,omitempty" json:"log_group,omitempty"`
}
type StateMachineStatus ¶ added in v0.6.0
type StateMachineStatus struct {
Arn string `json:"arn"`
Name string `json:"name"`
CurrentVersion int `json:"current_version"`
Status string `json:"status"`
CreatedAt string `json:"created_at"`
}
func (*StateMachineStatus) String ¶ added in v0.6.0
func (s *StateMachineStatus) String() string
type StateMachineVersionListItem ¶ added in v0.6.0
type StatusOption ¶ added in v0.6.0
type StatusOutput ¶ added in v0.6.0
type StatusOutput struct {
StateMachine *StateMachineStatus `json:"state_machine"`
EventBridge []*RulesStatus `json:"event_bridge,omitempty"`
EventBridgeScheduler []*ScheduleStatus `json:"event_bridge_scheduler,omitempty"`
}
func (*StatusOutput) String ¶ added in v0.6.0
func (s *StatusOutput) String() string
type StudioOption ¶ added in v0.6.0
type StudioOption struct {
Open bool `name:"open" help:"open workflow studio"`
}
type TFStateConfig ¶ added in v0.6.0
type TriggerConfig ¶ added in v0.6.0
type TriggerConfig struct {
Schedule []TriggerScheduleConfig `yaml:"schedule,omitempty" json:"schedule,omitempty"`
Event []TriggerEventConfig `yaml:"event,omitempty" json:"event,omitempty"`
}
func (*TriggerConfig) Restrict ¶ added in v0.6.0
func (cfg *TriggerConfig) Restrict(stateMachineName string) error
type TriggerEventConfig ¶ added in v0.6.0
type TriggerEventConfig struct {
KeysToSnakeCase[TriggerEventConfigInner] `yaml:",inline" json:",inline"`
}
func (*TriggerEventConfig) Restrict ¶ added in v0.6.0
func (cfg *TriggerEventConfig) Restrict(i int, stateMachineName string) error
func (*TriggerEventConfig) UnmarshalJSON ¶ added in v0.6.0
func (cfg *TriggerEventConfig) UnmarshalJSON(b []byte) error
type TriggerEventConfigInner ¶ added in v0.6.0
type TriggerEventConfigInner struct {
eventbridge.PutRuleInput `yaml:",inline"`
Target eventbridgetypes.Target `yaml:"Target,omitempty" json:"Target,omitempty"`
}
type TriggerScheduleConfig ¶ added in v0.6.0
type TriggerScheduleConfig struct {
KeysToSnakeCase[scheduler.CreateScheduleInput] `yaml:",inline" json:",inline"`
}
func (*TriggerScheduleConfig) Restrict ¶ added in v0.6.0
func (cfg *TriggerScheduleConfig) Restrict(i int, stateMachineName string) error
func (*TriggerScheduleConfig) UnmarshalJSON ¶ added in v0.6.0
func (cfg *TriggerScheduleConfig) UnmarshalJSON(b []byte) error