Documentation
¶
Index ¶
- Constants
- Variables
- func CLI(ctx context.Context, parse CLIParseFunc) (int, error)
- func ExportEnvFile(file string) error
- func Log(f string, v ...interface{})
- func MarshalJSONForAPI(v interface{}) ([]byte, error)
- func MustMarshalJSONStringForAPI(v interface{}) string
- func NormalizePlatform(p *types.RuntimePlatform, isFargate bool) (arch, os string)
- type App
- func (d *App) AppSpec(ctx context.Context, opt AppSpecOption) error
- func (d *App) Config() *Config
- func (d *App) Delete(ctx context.Context, opt DeleteOption) error
- func (d *App) Deploy(ctx context.Context, opt DeployOption) error
- func (d *App) DeployByCodeDeploy(ctx context.Context, taskDefinitionArn string, count *int32, sv *Service, ...) error
- func (d *App) Deregister(ctx context.Context, opt DeregisterOption) error
- func (d *App) DescribeService(ctx context.Context) (*Service, error)
- func (d *App) DescribeServiceStatus(ctx context.Context, events int) (*Service, error)
- func (d *App) DescribeServicesInput() *ecs.DescribeServicesInput
- func (d *App) DescribeTaskDefinition(ctx context.Context, tdArn string) (*TaskDefinitionInput, error)
- func (d *App) DescribeTaskStatus(ctx context.Context, task *types.Task, ...) error
- func (d *App) DescribeTasksInput(task *types.Task) *ecs.DescribeTasksInput
- func (d *App) Diff(ctx context.Context, opt DiffOption) error
- func (d *App) Exec(ctx context.Context, opt ExecOption) error
- func (d *App) FindRollbackTarget(ctx context.Context, taskDefinitionArn string) (string, error)
- func (d *App) GetLogEvents(ctx context.Context, logGroup string, logStream string, startedAt time.Time, ...) (*string, error)
- func (d *App) GetLogEventsInput(logGroup string, logStream string, startAt int64, nextToken *string) *cloudwatchlogs.GetLogEventsInput
- func (d *App) GetLogInfo(task *types.Task, c *types.ContainerDefinition) (string, string)
- func (d *App) Init(ctx context.Context, opt InitOption) error
- func (d *App) LoadServiceDefinition(path string) (*Service, error)
- func (d *App) LoadTaskDefinition(path string) (*TaskDefinitionInput, error)
- func (d *App) Log(f string, v ...interface{})
- func (d *App) LogJSON(v interface{})
- func (d *App) Name() string
- func (d *App) NewEcsta(ctx context.Context) (*ecsta.Ecsta, error)
- func (d *App) Register(ctx context.Context, opt RegisterOption) error
- func (d *App) RegisterTaskDefinition(ctx context.Context, td *TaskDefinitionInput) (*TaskDefinition, error)
- func (d *App) Render(ctx context.Context, opt RenderOption) error
- func (d *App) Revesions(ctx context.Context, opt RevisionsOption) error
- func (d *App) Rollback(ctx context.Context, opt RollbackOption) error
- func (d *App) RollbackByCodeDeploy(ctx context.Context, sv *Service, tdArn string, opt RollbackOption) error
- func (d *App) Run(ctx context.Context, opt RunOption) error
- func (d *App) RunTask(ctx context.Context, tdArn string, ov *types.TaskOverride, opt *RunOption) (*types.Task, error)
- func (d *App) Start(ctx context.Context) (context.Context, context.CancelFunc)
- func (d *App) Status(ctx context.Context, opt StatusOption) error
- func (d *App) Tasks(ctx context.Context, opt TasksOption) error
- func (d *App) Timeout() time.Duration
- func (d *App) UnmarshalJSONForStruct(src []byte, v interface{}, path string) error
- func (d *App) UpdateServiceAttributes(ctx context.Context, sv *Service, taskDefinitionArn string, opt DeployOption) error
- func (d *App) UpdateServiceTasks(ctx context.Context, taskDefinitionArn string, count *int32, sv *Service, ...) error
- func (d *App) Verify(ctx context.Context, opt VerifyOption) error
- func (d *App) Wait(ctx context.Context, opt WaitOption) error
- func (d *App) WaitForCodeDeploy(ctx context.Context, sv *Service) error
- func (d *App) WaitRunTask(ctx context.Context, task *types.Task, ...) error
- func (d *App) WaitServiceStable(ctx context.Context, sv *Service) error
- type AppSpecOption
- type CLIOptions
- type CLIParseFunc
- type Config
- type ConfigPlugin
- type DeleteOption
- type DeployOption
- type DeregisterOption
- type DiffOption
- type Duration
- type ErrNotFound
- type ErrSkipVerify
- type ExecOption
- type InitOption
- type Option
- type RefreshOption
- type RegisterOption
- type RenderOption
- type RevisionsOption
- type RollbackOption
- type RunOption
- type ScaleOption
- type Service
- type StatusOption
- type TaskDefinition
- type TaskDefinitionInput
- type TasksOption
- type VerifyOption
- type WaitOption
Constants ¶
View Source
const ( DefaultClusterName = "default" DefaultTimeout = 10 * time.Minute )
View Source
const (
CodeDeployConsoleURLFmt = "https://%s.console.aws.amazon.com/codesuite/codedeploy/deployments/%s?region=%s"
)
View Source
const DefaultConfigFilePath = "ecspresso.yml"
View Source
const DefaultDesiredCount = -1
Variables ¶
View Source
var CreateFileMode = os.FileMode(0644)
View Source
var Version string
Functions ¶
func ExportEnvFile ¶ added in v1.4.0
ExportEnvFile exports envfile to environment variables.
func MarshalJSONForAPI ¶ added in v1.99.0
func MustMarshalJSONStringForAPI ¶ added in v1.99.1
func MustMarshalJSONStringForAPI(v interface{}) string
func NormalizePlatform ¶ added in v1.99.0
func NormalizePlatform(p *types.RuntimePlatform, isFargate bool) (arch, os string)
Types ¶
type App ¶ added in v0.0.2
func (*App) AppSpec ¶ added in v0.99.7
func (d *App) AppSpec(ctx context.Context, opt AppSpecOption) error
func (*App) Delete ¶ added in v0.4.0
func (d *App) Delete(ctx context.Context, opt DeleteOption) error
func (*App) Deploy ¶ added in v0.1.0
func (d *App) Deploy(ctx context.Context, opt DeployOption) error
func (*App) DeployByCodeDeploy ¶ added in v0.12.0
func (*App) Deregister ¶ added in v1.7.0
func (d *App) Deregister(ctx context.Context, opt DeregisterOption) error
func (*App) DescribeService ¶ added in v0.16.0
func (*App) DescribeServiceStatus ¶ added in v0.1.0
func (*App) DescribeServicesInput ¶ added in v0.0.2
func (d *App) DescribeServicesInput() *ecs.DescribeServicesInput
func (*App) DescribeTaskDefinition ¶ added in v0.8.1
func (*App) DescribeTaskStatus ¶ added in v0.15.0
func (*App) DescribeTasksInput ¶ added in v0.5.0
func (d *App) DescribeTasksInput(task *types.Task) *ecs.DescribeTasksInput
func (*App) FindRollbackTarget ¶ added in v0.1.0
func (*App) GetLogEvents ¶ added in v0.5.0
func (*App) GetLogEventsInput ¶ added in v0.5.0
func (d *App) GetLogEventsInput(logGroup string, logStream string, startAt int64, nextToken *string) *cloudwatchlogs.GetLogEventsInput
func (*App) GetLogInfo ¶ added in v0.5.0
func (*App) LoadServiceDefinition ¶ added in v0.2.0
func (*App) LoadTaskDefinition ¶ added in v0.0.2
func (d *App) LoadTaskDefinition(path string) (*TaskDefinitionInput, error)
func (*App) Register ¶ added in v0.10.0
func (d *App) Register(ctx context.Context, opt RegisterOption) error
func (*App) RegisterTaskDefinition ¶ added in v0.0.2
func (d *App) RegisterTaskDefinition(ctx context.Context, td *TaskDefinitionInput) (*TaskDefinition, error)
func (*App) Render ¶ added in v1.2.0
func (d *App) Render(ctx context.Context, opt RenderOption) error
func (*App) Revesions ¶ added in v1.7.0
func (d *App) Revesions(ctx context.Context, opt RevisionsOption) error
func (*App) Rollback ¶ added in v0.1.0
func (d *App) Rollback(ctx context.Context, opt RollbackOption) error
func (*App) RollbackByCodeDeploy ¶ added in v1.5.0
func (*App) Status ¶ added in v0.1.0
func (d *App) Status(ctx context.Context, opt StatusOption) error
func (*App) UnmarshalJSONForStruct ¶ added in v1.99.0
func (*App) UpdateServiceAttributes ¶ added in v0.13.3
func (*App) UpdateServiceTasks ¶ added in v0.13.3
func (*App) Verify ¶ added in v1.2.0
func (d *App) Verify(ctx context.Context, opt VerifyOption) error
Verify verifies service / task definitions related resources are valid.
func (*App) WaitForCodeDeploy ¶ added in v0.99.1
func (*App) WaitRunTask ¶ added in v0.5.0
type AppSpecOption ¶ added in v0.99.7
type CLIOptions ¶ added in v1.99.1
type CLIOptions struct {
Envfile []string `help:"environment files"`
Debug bool `help:"enable debug log"`
ExtStr map[string]string `help:"external string values for Jsonnet"`
ExtCode map[string]string `help:"external code values for Jsonnet"`
Config string `help:"config file" default:"ecspresso.yml"`
Option *Option
Appspec *AppSpecOption `cmd:"" help:"output AppSpec YAML for CodeDeploy to STDOUT"`
Delete *DeleteOption `cmd:"" help:"delete service"`
Deploy *DeployOption `cmd:"" help:"deploy service"`
Deregister *DeregisterOption `cmd:"" help:"deregister task definition"`
Diff *DiffOption `cmd:"" help:"show diff between task definition, service definition with current running service and task definition"`
Exec *ExecOption `cmd:"" help:"execute command on task"`
Init *InitOption `cmd:"" help:"create configuration files from existing ECS service"`
Refresh *RefreshOption `cmd:"" help:"refresh service. equivalent to deploy --skip-task-definition --force-new-deployment --no-update-service"`
Register *RegisterOption `cmd:"" help:"register task definition"`
Render *RenderOption `cmd:"" help:"render config, service definition or task definition file to STDOUT"`
Revisions *RevisionsOption `cmd:"" help:"show revisions of task definitions"`
Rollback *RollbackOption `cmd:"" help:"rollback service"`
Run *RunOption `cmd:"" help:"run task"`
Scale *ScaleOption `cmd:"" help:"scale service. equivalent to deploy --skip-task-definition --no-update-service"`
Status *StatusOption `cmd:"" help:"show status of service"`
Tasks *TasksOption `cmd:"" help:"list tasks that are in a service or having the same family"`
Verify *VerifyOption `cmd:"" help:"verify resources in configurations"`
Wait *WaitOption `cmd:"" help:"wait until service stable"`
Version struct{} `cmd:"" help:"show version"`
}
func ParseCLIv2 ¶ added in v1.99.1
func ParseCLIv2(args []string) (string, *CLIOptions, error)
func (*CLIOptions) ForSubCommand ¶ added in v1.99.1
func (opts *CLIOptions) ForSubCommand(sub string) interface{}
type CLIParseFunc ¶ added in v1.99.1
type CLIParseFunc func([]string) (string, *CLIOptions, error)
type Config ¶ added in v0.0.2
type Config struct {
RequiredVersion string `yaml:"required_version,omitempty" json:"required_version,omitempty"`
Region string `yaml:"region" json:"region"`
Cluster string `yaml:"cluster" json:"cluster"`
Service string `yaml:"service" json:"service"`
ServiceDefinitionPath string `yaml:"service_definition" json:"service_definition"`
TaskDefinitionPath string `yaml:"task_definition" json:"task_definition"`
Plugins []ConfigPlugin `yaml:"plugins,omitempty" json:"plugins,omitempty"`
AppSpec *appspec.AppSpec `yaml:"appspec,omitempty" json:"appspec,omitempty"`
FilterCommand string `yaml:"filter_command,omitempty" json:"filter_command,omitempty"`
Timeout *Duration `yaml:"timeout,omitempty" json:"timeout,omitempty"`
// contains filtered or unexported fields
}
Config represents a configuration.
func NewDefaultConfig ¶ added in v0.1.0
func NewDefaultConfig() *Config
NewDefaultConfig creates a default configuration.
func (*Config) ValidateVersion ¶ added in v1.3.0
ValidateVersion validates a version satisfies required_version.
type ConfigPlugin ¶ added in v0.14.0
type ConfigPlugin struct {
Name string `yaml:"name"`
Config map[string]interface{} `yaml:"config"`
FuncPrefix string `yaml:"func_prefix"`
}
func (ConfigPlugin) AppendFuncMap ¶ added in v1.99.0
func (p ConfigPlugin) AppendFuncMap(c *Config, funcMap template.FuncMap) error
type DeleteOption ¶ added in v0.4.0
type DeleteOption struct {
DryRun *bool `help:"dry-run" default:"false"`
Force *bool `help:"delete without confirmation" default:"false"`
}
func (DeleteOption) DryRunString ¶ added in v0.13.3
func (opt DeleteOption) DryRunString() string
type DeployOption ¶ added in v0.2.0
type DeployOption struct {
DryRun *bool `help:"dry run" default:"false"`
DesiredCount *int32 `name:"tasks" help:"desired count of tasks" default:"-1"`
SkipTaskDefinition *bool `help:"skip register a new task definition" default:"false"`
ForceNewDeployment *bool `help:"force a new deployment of the service" default:"false"`
NoWait *bool `help:"exit ecspresso immediately after just deployed without waiting for service stable" default:"false"`
SuspendAutoScaling *bool `help:"suspend application auto-scaling attached with the ECS service"`
ResumeAutoScaling *bool `help:"resume application auto-scaling attached with the ECS service"`
RollbackEvents *string `` /* 152-byte string literal not displayed */
UpdateService *bool `help:"update service attributes by service definition" default:"true" negatable:""`
LatestTaskDefinition *bool `help:"deploy with the latest task definition without registering a new task definition" default:"false"`
}
func (DeployOption) DryRunString ¶ added in v0.13.3
func (opt DeployOption) DryRunString() string
type DeregisterOption ¶ added in v1.7.0
type DeregisterOption struct {
DryRun *bool `help:"dry run" default:"false"`
Keeps *int `help:"number of task definitions to keep except in-use" default:"0"`
Revision *int64 `help:"task definition revision to deregister" default:"0"`
Force *bool `help:"force deregister without confirmation" default:"false"`
}
func (DeregisterOption) DryRunString ¶ added in v1.7.0
func (opt DeregisterOption) DryRunString() string
type DiffOption ¶ added in v0.16.0
type DiffOption struct {
Unified *bool `help:"unified diff format" default:"true" negatable:""`
}
type Duration ¶ added in v1.99.1
func (*Duration) MarshalJSON ¶ added in v1.99.1
func (*Duration) MarshalYAML ¶ added in v1.99.1
func (*Duration) UnmarshalJSON ¶ added in v1.99.1
func (*Duration) UnmarshalYAML ¶ added in v1.99.1
type ErrNotFound ¶ added in v1.99.1
type ErrNotFound string
func (ErrNotFound) Error ¶ added in v1.99.1
func (e ErrNotFound) Error() string
type ErrSkipVerify ¶ added in v1.99.1
type ErrSkipVerify string
func (ErrSkipVerify) Error ¶ added in v1.99.1
func (e ErrSkipVerify) Error() string
type ExecOption ¶ added in v1.5.0
type ExecOption struct {
ID *string `help:"task ID" default:""`
Command *string `help:"command to execute" default:"sh"`
Container *string `help:"container name" default:""`
PortForward *bool `help:"enable port forward" default:"false"`
LocalPort *int `help:"local port number" default:"0"`
Port *int `help:"remote port number (required for --port-forward)" default:"0"`
Host *string `help:"remote host (required for --port-forward)" default:""`
}
type InitOption ¶ added in v0.11.0
type InitOption struct {
Region *string `help:"AWS region" env:"AWS_REGION" default:""`
Cluster *string `help:"ECS cluster name" default:"default"`
Service *string `help:"ECS service name" default:"" required:""`
TaskDefinitionPath *string `help:"path to output task definition file" default:"ecs-task-def.json"`
ServiceDefinitionPath *string `help:"path to output service definition file" default:"ecs-service-def.json"`
ConfigFilePath *string
ForceOverwrite *bool `help:"overwrite existing files" default:"false"`
Jsonnet *bool `help:"output files as jsonnet format" default:"false"`
}
type RefreshOption ¶ added in v1.99.1
type RefreshOption struct {
DryRun *bool `help:"dry run" default:"false"`
NoWait *bool `help:"exit ecspresso immediately after just deployed without waiting for service stable" default:"false"`
}
func (*RefreshOption) DeployOption ¶ added in v1.99.1
func (o *RefreshOption) DeployOption() DeployOption
type RegisterOption ¶ added in v0.10.0
type RegisterOption struct {
DryRun *bool `help:"dry run" default:"false"`
Output *bool `help:"output the registered task definition as JSON" default:"false"`
}
func (RegisterOption) DryRunString ¶ added in v0.13.3
func (opt RegisterOption) DryRunString() string
type RenderOption ¶ added in v1.2.0
type RevisionsOption ¶ added in v1.7.0
type RollbackOption ¶ added in v0.2.0
type RollbackOption struct {
DryRun *bool `help:"dry run" default:"false"`
DeregisterTaskDefinition *bool `help:"deregister the rolled-back task definition. not works with --no-wait" default:"true" negatable:""`
NoWait *bool `help:"don't wait for the service stable" default:"false"`
RollbackEvents *string `` /* 152-byte string literal not displayed */
}
func (RollbackOption) DryRunString ¶ added in v0.13.3
func (opt RollbackOption) DryRunString() string
type RunOption ¶ added in v0.5.0
type RunOption struct {
DryRun *bool `help:"dry run" default:"false"`
TaskDefinition *string `name:"task-def" help:"task definition file for run task" default:""`
NoWait *bool `help:"don't wait for task to complete" default:"false"`
TaskOverrideStr *string `name:"overrides" help:"task override JSON string" default:""`
TaskOverrideFile *string `name:"overrides-file" help:"task override JSON file path" default:""`
SkipTaskDefinition *bool `help:"skip register a new task definition" default:"false"`
Count *int32 `help:"number of tasks to run (max 10)" default:"1"`
WatchContainer *string `help:"container name for watching exit code" default:""`
LatestTaskDefinition *bool `help:"use the latest task definition without registering a new task definition" default:"false"`
PropagateTags *string `help:"propagate the tags for the task (SERVICE or TASK_DEFINITION)" default:""`
Tags *string `help:"tags for the task: format is KeyFoo=ValueFoo,KeyBar=ValueBar" default:""`
WaitUntil *string `help:"wait until invoked tasks status reached to (running or stopped)" default:"stopped" enum:"running,stopped"`
Revision *int64 `help:"revision of the task definition to run when --skip-task-definition" default:"0"`
}
func (RunOption) DryRunString ¶ added in v0.13.3
type ScaleOption ¶ added in v1.99.1
type ScaleOption struct {
DryRun *bool `help:"dry run" default:"false"`
DesiredCount *int32 `name:"tasks" help:"desired count of tasks" default:"-1"`
NoWait *bool `help:"exit ecspresso immediately after just deployed without waiting for service stable" default:"false"`
SuspendAutoScaling *bool `help:"suspend application auto-scaling attached with the ECS service"`
ResumeAutoScaling *bool `help:"resume application auto-scaling attached with the ECS service"`
}
func (*ScaleOption) DeployOption ¶ added in v1.99.1
func (o *ScaleOption) DeployOption() DeployOption
type StatusOption ¶ added in v0.2.0
type StatusOption struct {
Events *int `help:"show events num" default:"2"`
}
type TaskDefinition ¶
type TaskDefinition = types.TaskDefinition
type TaskDefinitionInput ¶ added in v1.5.0
type TaskDefinitionInput = ecs.RegisterTaskDefinitionInput
type TasksOption ¶ added in v1.5.0
type TasksOption struct {
ID *string `help:"task ID" default:""`
Output *string `help:"output format" default:"table" enum:"table,json,tsv" default:"table"`
Find *bool `help:"find a task from tasks list and dump it as JSON" default:"false"`
Stop *bool `help:"stop the task" default:"false"`
Force *bool `help:"stop the task without confirmation" default:"false"`
Trace *bool `help:"trace the task" default:"false"`
}
type VerifyOption ¶ added in v1.2.0
type VerifyOption struct {
GetSecrets *bool `help:"get secrets from ParameterStore or SecretsManager" default:"true" negatable:""`
PutLogs *bool `help:"put logs to CloudWatchLogs" default:"true" negatable:""`
}
VerifyOption represents options for Verify()
type WaitOption ¶ added in v0.9.0
type WaitOption struct {
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.