Documentation
¶
Index ¶
- Variables
- func CamelToSnake(s string) string
- func JSON2Jsonnet(filename string, data []byte) ([]byte, error)
- func JSONDiffString(fromStr, toStr string, opts ...JSONDiffOption) (string, error)
- 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) SetManagedByTagKey(key 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) LoadAWSConfig(ctx context.Context) (aws.Config, error)
- func (cfg *Config) ManagedByTagKey() string
- func (cfg *Config) NewCloudWatchLogsClientFromConfig(awsCfg aws.Config) *cloudwatchlogs.Client
- func (cfg *Config) NewEventBridgeClientFromConfig(awsCfg aws.Config) *eventbridge.Client
- func (cfg *Config) NewEventBridgeRules() EventBridgeRules
- func (cfg *Config) NewSchedulerClientFromConfig(awsCfg aws.Config) *scheduler.Client
- func (cfg *Config) NewSchedules() Schedules
- func (cfg *Config) NewStateMachine() *StateMachine
- func (cfg *Config) NewStepFunctionsClientFromConfig(awsCfg aws.Config) *sfn.Client
- func (cfg *Config) NewStsClientFromConfig(awsCfg aws.Config) *sts.Client
- func (cfg *Config) Restrict() error
- func (cfg *Config) SetManagedByTagKey(key string)
- 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)
- func (l *ConfigLoader) SetSTSClient(client STSClient)
- type DeleteOption
- type DeployCommandOption
- type DeployOption
- type DeployStateMachineOutput
- type DescribeStateMachineInput
- type DiffOption
- type DiffStringOption
- 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, opt DiffStringOption) (string, error)
- func (rule *EventBridgeRule) IsManagedBy(key string) 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, opt DiffStringOption) (string, error)
- 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
- func (svc *EventBridgeServiceImpl) DeployRules(ctx context.Context, stateMachineArn string, rules EventBridgeRules, ...) error
- func (svc *EventBridgeServiceImpl) SearchRelatedRules(ctx context.Context, params *SearchRelatedRulesInput) (EventBridgeRules, error)
- func (svc *EventBridgeServiceImpl) SetManagedByTagKey(key string)
- type ExecuteOption
- type GetStateMachineArnInput
- type HistoryEvent
- type InitOption
- type JSONDiffOption
- type KeysToSnakeCase
- type ListStateMachineVersionsOutput
- type 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, tagStrategy TagStrategy) (*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) SetManagedByTagKey(key string)
- func (svc *SFnServiceImpl) StartExecution(ctx context.Context, stateMachine *StateMachine, params *StartExecutionInput) (*StartExecutionOutput, error)
- type STSClient
- type Schedule
- func (s *Schedule) DiffString(newSchedule *Schedule, opt DiffStringOption) (string, error)
- func (s *Schedule) HasItPassed() bool
- func (s *Schedule) SetEnabled(enabled bool)
- func (s *Schedule) SetStateMachineQualifiedArn(stateMachineArn string)
- func (s *Schedule) Source() string
- func (s *Schedule) String() string
- type ScheduleCommandOption
- type ScheduleConfig
- type ScheduleStatus
- type SchedulerClient
- type SchedulerService
- type SchedulerServiceImpl
- type Schedules
- func (s Schedules) DiffString(newSchedules Schedules, opt DiffStringOption) (string, error)
- 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, opt DiffStringOption) (string, error)
- 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 TagStrategy
- 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 ErrHasDiff = errors.New("there are differences")
ErrHasDiff is returned by App.Diff when DiffOption.ExitCode is set and a difference was found, so the caller can map it to a distinct exit code.
var ErrScheduleNotFound = errors.New("schedule not found")
var Version = "v0.11.0"
Functions ¶
func CamelToSnake ¶ added in v0.6.0
func JSONDiffString ¶ added in v0.6.0
func JSONDiffString(fromStr, toStr string, opts ...JSONDiffOption) (string, error)
JSONDiffString renders a color-highlighted diff between fromStr and toStr, applying opts (see JSONDiffFromURI, JSONDiffToURI, JSONDiffUnified, JSONDiffIgnore). Returns an error if a JSONDiffIgnore query is invalid or fails to apply.
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
}
App runs stefunny commands against a state machine and its triggers.
sfnSvc, eventbridgeSvc and schedulerSvc are constructed lazily, on first use, via sfnService/eventBridgeService/schedulerService: a command that never needs one of them (e.g. render) never resolves AWS credentials for it. mu guards all four fields.
func (*App) Diff ¶ added in v0.6.0
func (app *App) Diff(ctx context.Context, opt DiffOption) error
Diff prints the diff between the config and the deployed state machine, EventBridge rules and EventBridge Scheduler schedules. If opt.SkipTrigger is set, the EventBridge rules and EventBridge Scheduler schedules diff is skipped, matching the scope of DeployOption.SkipTrigger. The state machine's tag diff is computed under opt.TagStrategy (see TagStrategy), matching what DeployOption.TagStrategy would actually apply, so a tag that deploy would never touch never counts toward the diff. If opt.Ignore is set, paths it matches are excluded from every comparison except the state machine's Definition; an invalid jq query returns an error before any AWS call is made. Returns ErrHasDiff if opt.ExitCode is set and a difference was found.
func (*App) Execute ¶ added in v0.3.0
func (app *App) Execute(ctx context.Context, opt ExecuteOption) error
Execute starts a state machine execution with the given input and waits for it to finish unless opt.Async is set. Returns an error if the execution fails to start, or if the execution itself fails when its result is awaited.
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) SetManagedByTagKey ¶ added in v0.11.0
SetManagedByTagKey overrides the tag key App uses to mark and recognize resources it manages, falling back to tagManagedBy when key is empty. It propagates to cfg and to any already-constructed sfnSvc/eventbridgeSvc.
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"`
ManagedByTagKey string `` /* 173-byte string literal not displayed */
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
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) LoadAWSConfig ¶ added in v0.6.0
func (*Config) ManagedByTagKey ¶ added in v0.11.0
ManagedByTagKey returns the tag key stefunny uses to mark resources it manages, defaulting to tagManagedBy when unset.
func (*Config) NewCloudWatchLogsClientFromConfig ¶ added in v0.9.4
func (cfg *Config) NewCloudWatchLogsClientFromConfig(awsCfg aws.Config) *cloudwatchlogs.Client
func (*Config) NewEventBridgeClientFromConfig ¶ added in v0.9.4
func (cfg *Config) NewEventBridgeClientFromConfig(awsCfg aws.Config) *eventbridge.Client
func (*Config) NewEventBridgeRules ¶ added in v0.6.0
func (cfg *Config) NewEventBridgeRules() EventBridgeRules
func (*Config) NewSchedulerClientFromConfig ¶ added in v0.9.4
func (*Config) NewSchedules ¶ added in v0.6.0
func (*Config) NewStateMachine ¶ added in v0.6.0
func (cfg *Config) NewStateMachine() *StateMachine
func (*Config) NewStepFunctionsClientFromConfig ¶ added in v0.9.4
func (*Config) NewStsClientFromConfig ¶ added in v0.9.4
func (*Config) SetManagedByTagKey ¶ added in v0.11.0
SetManagedByTagKey overrides the tag key ManagedByTagKey returns.
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)
func (*ConfigLoader) SetSTSClient ¶ added in v0.10.0
func (l *ConfigLoader) SetSTSClient(client STSClient)
SetSTSClient injects the STS client used to resolve caller_identity. this is for testing
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"`
TagStrategy *string `` /* 142-byte string literal not displayed */
}
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
TagStrategy *string
}
func (DeployOption) DryRunString ¶
func (opt DeployOption) DryRunString() string
type DescribeStateMachineInput ¶ added in v0.6.0
type DiffOption ¶ added in v0.6.0
type DiffOption struct {
Unified bool `name:"unified" help:"output in unified format" short:"u" default:"true" negatable:"" json:"unified,omitempty"`
Qualifier string `name:"qualifier" help:"qualifier for state machine" default:"" json:"qualifier,omitempty"`
ExitCode bool `name:"exit-code" help:"exit with code 2 if there are differences" default:"false" json:"exit_code,omitempty"`
SkipTrigger bool `name:"skip-trigger" help:"Skip trigger diff" default:"false" json:"skip_trigger,omitempty"`
TagStrategy *string `` /* 142-byte string literal not displayed */
Ignore string `` /* 141-byte string literal not displayed */
}
DiffOption configures App.Diff.
type DiffStringOption ¶ added in v0.11.0
type DiffStringOption struct {
Unified bool
// TagStrategy is used by StateMachine.DiffString to project the tag
// set diff would compare against what deploy would actually leave in
// place under the same strategy.
TagStrategy TagStrategy
// ManagedByTagKey is used by EventBridgeRules.DiffString to decide
// whether a rule slated for deletion is one stefunny manages. The
// zero value falls back to tagManagedBy.
ManagedByTagKey string
// Ignore is a jq query for paths to exclude from the diff. It applies
// to StateMachine's configuration comparison and to
// EventBridgeRule(s)/Schedule(s)'s comparison, but not to
// StateMachine's Definition comparison.
Ignore string
}
DiffStringOption configures the DiffString methods of StateMachine, EventBridgeRule(s) and Schedule(s). Not every field applies to every method: TagStrategy is StateMachine-only, ManagedByTagKey is EventBridgeRule(s)-only, and Ignore does not apply to StateMachine's Definition comparison.
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"`
Scheduler string `yaml:"scheduler,omitempty" json:"scheduler,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, opt DiffStringOption) (string, error)
DiffString renders the diff between rule (the current state, possibly nil) and newRule (the desired state). opt.Ignore excludes matching paths from the comparison. Returns an error if opt.Ignore is an invalid jq query.
func (*EventBridgeRule) IsManagedBy ¶ added in v0.6.0
func (rule *EventBridgeRule) IsManagedBy(key string) 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, opt DiffStringOption) (string, error)
DiffString renders the diff between rules (the current state) and newRules (the desired state), matched by name. A rule slated for deletion is skipped unless it is managed by opt.ManagedByTagKey, which defaults to tagManagedBy when left at its zero value. opt.Ignore excludes matching paths from each rule's comparison. Returns an error if opt.Ignore is an invalid jq query.
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
SetManagedByTagKey(key string)
}
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)
func (*EventBridgeServiceImpl) SetManagedByTagKey ¶ added in v0.11.0
func (svc *EventBridgeServiceImpl) SetManagedByTagKey(key string)
SetManagedByTagKey overrides the tag key putRule and deleteRule use to mark and recognize rules stefunny manages.
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 JSONDiffIgnore ¶ added in v0.11.0
func JSONDiffIgnore(query string) JSONDiffOption
JSONDiffIgnore sets a jq query whose matched paths are removed from both sides before they are compared. query is wrapped as del(<query>); an empty query disables filtering.
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(*App)
NewAppOption configures an App constructed by New.
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, error)
JSON renders f.Data.Versions as an indented JSON string. Returns an error if marshaling or indenting fails.
func (OutputFormatter) Render ¶ added in v0.10.0
func (f OutputFormatter) Render() (string, error)
Render returns f's string representation according to f.Format ("json", "tsv", or table by default). Returns an error if the table format fails to render (see Table).
Named Render rather than String because f can fail to format and therefore does not satisfy fmt.Stringer.
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, error)
Table renders f.Data.Versions as a table string. Returns an error if the underlying tablewriter fails to append rows or render.
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
func (r *Renderer) RenderConfig(ctx context.Context, w io.Writer, format string, template bool) error
RenderConfig renders the stefunny config (excluding the state machine definition body) to w. In json/jsonnet format, keys whose value is null, false, an empty string, or an empty array are dropped, since those AWS SDK-derived fields treat the zero value as "unset".
func (*Renderer) RenderStateMachine ¶ added in v0.6.0
func (r *Renderer) RenderStateMachine(ctx context.Context, w io.Writer, format string, template bool) error
RenderStateMachine renders the state machine definition to w. Unlike RenderConfig, the definition is a user-authored document, so in json/jsonnet format its null/false/empty-string/ empty-array values are preserved as-is rather than pruned.
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)
UntagResource(ctx context.Context, params *sfn.UntagResourceInput, optFns ...func(*sfn.Options)) (*sfn.UntagResourceOutput, 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, tagStrategy TagStrategy) (*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)
SetManagedByTagKey(key 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, tagStrategy TagStrategy) (*DeployStateMachineOutput, error)
DeployStateMachine creates or updates the state machine. tagStrategy governs the update path only (see updateStateMachineTags); a create always tags the new resource with stateMachine.Tags regardless of tagStrategy, since creation is a single API call rather than the TagResource/UntagResource calls tagStrategy reconciles.
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) SetManagedByTagKey ¶ added in v0.11.0
func (svc *SFnServiceImpl) SetManagedByTagKey(key string)
SetManagedByTagKey overrides the tag key DeployStateMachine uses to mark state machines stefunny manages.
func (*SFnServiceImpl) StartExecution ¶ added in v0.6.0
func (svc *SFnServiceImpl) StartExecution(ctx context.Context, stateMachine *StateMachine, params *StartExecutionInput) (*StartExecutionOutput, error)
type STSClient ¶ added in v0.10.0
type STSClient interface {
GetCallerIdentity(ctx context.Context, params *sts.GetCallerIdentityInput, optFns ...func(*sts.Options)) (*sts.GetCallerIdentityOutput, error)
}
STSClient is the subset of the STS API used to resolve caller_identity.
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 (s *Schedule) DiffString(newSchedule *Schedule, opt DiffStringOption) (string, error)
DiffString renders the diff between s (the current state, possibly nil) and newSchedule (the desired state). opt.Ignore excludes matching paths from the comparison. Returns an error if opt.Ignore is an invalid jq query.
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 (s Schedules) DiffString(newSchedules Schedules, opt DiffStringOption) (string, error)
DiffString renders the diff between s (the current state) and newSchedules (the desired state), matched by name. opt.Ignore excludes matching paths from each schedule's comparison. Returns an error if opt.Ignore is an invalid jq query.
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, opt DiffStringOption) (string, error)
DiffString renders the diff between s (the current state, possibly nil) and newStateMachine (the desired state). The tag portion of the diff reflects the tag set opt.TagStrategy would actually leave in place, not newStateMachine's raw tags, so it stays consistent with what a deploy under the same strategy would do. opt.Ignore applies to the configuration comparison only, not to the Definition comparison. Returns an error if opt.Ignore is an invalid jq query.
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 TagStrategy ¶ added in v0.11.0
type TagStrategy string
TagStrategy controls how deploy reconciles a state machine's tags with the config, and how diff reports tag differences accordingly.
const ( // TagStrategyAppendOnly adds or updates tags found in the config but // never removes a tag that only exists on the live resource. TagStrategyAppendOnly TagStrategy = "append_only" // TagStrategySync makes the live resource's tags match the config // exactly, removing any tag not present in the config. TagStrategySync TagStrategy = "sync" // TagStrategyNone leaves the live resource's tags untouched. TagStrategyNone TagStrategy = "none" )
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
type VersionsOption ¶ added in v0.6.0
Source Files
¶
- app.go
- caller_identity.go
- cli.go
- config.go
- delete.go
- deploy.go
- diff.go
- encoding.go
- eventbridge_rules.go
- eventbridge_service.go
- execute.go
- init.go
- logger.go
- orderd_map.go
- pull.go
- render.go
- rollback.go
- schedule.go
- scheduler_service.go
- sfn_service.go
- state_machine.go
- status.go
- studio.go
- tag_strategy.go
- tfstate.go
- utils.go
- version.go
- versions.go