lamvms

package module
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 43 Imported by: 0

README

lamvms

CI Go Reference License

lamvms is a deployment and lifecycle management tool for AWS Lambda MicroVMs, inspired by fujiwara/lambroll.

Install

Binary (GitHub Releases)

Download the latest binary from GitHub Releases.

Go
go install github.com/kayac/lamvms/cmd/lamvms@latest
aqua

aqua is a declarative CLI Version Manager. See the installation guide to install aqua itself. Once aqua is installed, you can install lamvms with:

aqua g -i kayac/lamvms
aqua i

Quick Start

1. Create a microvm definition

microvm.jsonnet:

local must_env = std.native('must_env');
local caller_identity = std.native('caller_identity');

{
  Name: 'my-app',
  BaseImageArn: 'arn:aws:lambda:ap-northeast-1:aws:microvm-image:al2023-1',
  BuildRoleArn: 'arn:aws:iam::' + caller_identity().Account + ':role/MicrovmBuildRole',
  CodeArtifact: {
    uri: 's3://' + must_env('S3_BUCKET') + '/my-app/app.zip',
  },
}
2. Deploy
lamvms deploy --microvm microvm.jsonnet

This will:

  1. Create a zip archive from the source directory (defaults to the directory of microvm.jsonnet)
  2. Upload it to S3
  3. Create or update the MicroVM image
  4. Wait for the build to complete
3. Run a MicroVM
lamvms run --microvm microvm.jsonnet
4. Connect to a shell
lamvms shell --microvm microvm.jsonnet

Press Ctrl+D to disconnect from the shell session.

Required IAM permissions

lamvms needs the following IAM permissions to operate:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "lambdamicrovms:CreateMicrovmImage",
        "lambdamicrovms:UpdateMicrovmImage",
        "lambdamicrovms:GetMicrovmImage",
        "lambdamicrovms:GetMicrovmImageVersion",
        "lambdamicrovms:UpdateMicrovmImageVersion",
        "lambdamicrovms:DeleteMicrovmImageVersion",
        "lambdamicrovms:ListMicrovmImages",
        "lambdamicrovms:ListMicrovmImageVersions",
        "lambdamicrovms:ListMicrovmImageBuilds",
        "lambdamicrovms:RunMicrovm",
        "lambdamicrovms:GetMicrovm",
        "lambdamicrovms:SuspendMicrovm",
        "lambdamicrovms:ResumeMicrovm",
        "lambdamicrovms:TerminateMicrovm",
        "lambdamicrovms:ListMicrovms",
        "lambdamicrovms:DeleteMicrovmImage",
        "lambdamicrovms:ListTags",
        "lambdamicrovms:TagResource",
        "lambdamicrovms:UntagResource",
        "lambdamicrovms:CreateMicrovmAuthToken",
        "lambdamicrovms:CreateMicrovmShellAuthToken"
      ],
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": "s3:PutObject",
      "Resource": "arn:aws:s3:::YOUR_BUCKET/*"
    },
    {
      "Effect": "Allow",
      "Action": "sts:GetCallerIdentity",
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": "iam:PassRole",
      "Resource": "arn:aws:iam::*:role/YOUR_EXECUTION_ROLE"
    }
  ]
}
  • s3:PutObject is required for deploy to upload the source archive.
  • sts:GetCallerIdentity is used by the caller_identity() template function.
  • iam:PassRole is only required when passing --execution-role-arn to run. Scope it down with an iam:PassedToService condition once the service principal for AWS Lambda MicroVMs is confirmed.

Configuration Files

microvm.jsonnet / microvm.json

The MicroVM image definition. Maps directly to the CreateMicrovmImage API payload.

If --microvm is not specified, lamvms searches for microvm.jsonnet then microvm.json in the current directory.

run.jsonnet / run.json

The MicroVM run configuration. Maps to the RunMicrovm API payload (except ImageIdentifier, which is resolved from the microvm definition).

{
  IngressNetworkConnectors: [
    'arn:aws:lambda:ap-northeast-1:aws:network-connector:aws-network-connector:HTTP_INGRESS',
    'arn:aws:lambda:ap-northeast-1:aws:network-connector:aws-network-connector:SHELL_INGRESS',
  ],
  EgressNetworkConnectors: [
    'arn:aws:lambda:ap-northeast-1:aws:network-connector:aws-network-connector:INTERNET_EGRESS',
  ],
  IdlePolicy: {
    AutoResumeEnabled: true,
    MaxIdleDurationSeconds: 900,
    SuspendedDurationSeconds: 300,
  },
}

If --run-def is not specified, lamvms searches for run.jsonnet then run.json relative to the microvm definition file, then in the current directory. If no run definition file is found, the MicroVM is started with only the ImageIdentifier (minimal configuration).

.microvmignore

Exclusion patterns for zip archive creation. One pattern per line; blank lines and lines starting with # are ignored.

Pattern matching is based on filepath.Match, not .gitignore semantics:

  • * does not cross a / boundary. For example, *.log matches app.log but not sub/app.log.
  • A pattern ending in /* (e.g. dir/*) excludes everything under dir/, at any depth.

The following patterns are excluded by default, in addition to any listed in .microvmignore:

  • .microvmignore
  • microvm.json
  • microvm.jsonnet
  • .git/*

Symbolic links are followed (dereferenced) by default, same as the standard zip command. Pass --symlink to deploy to store them as symlinks in the archive instead (same as zip --symlink/-y). When following (the default), a symlink pointing to a directory is skipped with a warning rather than being expanded.

Template Functions

Jsonnet native functions
  • std.native('env')('NAME', 'default') — environment variable with default
  • std.native('must_env')('NAME') — environment variable (error if unset)
  • std.native('caller_identity')() — returns {Account, Arn, UserID}
Go template functions (in .json files)
  • {{ env "NAME" "default" }}
  • {{ must_env "NAME" }}
  • {{ (caller_identity).Account }}

Commands

init

Initialize a microvm definition from an existing MicroVM image.

lamvms init --image-name my-app
Flag Description Default
--image-name Name of the existing MicroVM image (required)
--output Output file path microvm.json
--jsonnet Output as .jsonnet format false
--force-overwrite Overwrite existing file false
deploy

Deploy a MicroVM image (create or update).

lamvms deploy [flags]
Flag Description Default
--src Source directory for zip archive Directory of microvm definition
--skip-archive Skip zip creation and S3 upload false
--wait / --no-wait Wait for build completion true
--build-logs / --no-build-logs Tail the build's CloudWatch Logs while waiting true
--keep-versions N Keep N latest active versions, delete older 0 (disabled)
--dry-run Show what would be done false
--symlink Keep symlinks in the archive instead of following them (same as zip --symlink) false
wait

Wait for a MicroVM image version to be ready.

lamvms wait [flags]
Flag Description Default
--image-version Specific version to wait for Latest version
--build-logs / --no-build-logs Tail the build's CloudWatch Logs while waiting true
--keep-versions N Delete old versions after wait 0 (disabled)
rollback

Deactivate the latest active version, falling back to the previous one.

lamvms rollback [flags]
Flag Description Default
--dry-run Show what would be done false
diff

Show the diff between the local microvm definition and the deployed configuration.

lamvms diff [flags]
Flag Description Default
--exit-code Exit with code 2 if there are differences false
run

Run a new MicroVM instance. CLI flags override values from run.jsonnet.

lamvms run [flags]
Flag Description Default
--run-def Path to run definition file Auto-discovered
--image-version Image version to run Latest active
--execution-role-arn IAM role ARN for runtime
--max-duration Maximum duration in seconds
--run-hook-payload Payload for /run lifecycle hook
--wait / --no-wait Wait for RUNNING state true
--create-auth-token Create auth token after run false
--token-expiration Auth token expiration 30m
--output Output format (text or json) text
shell

Open an interactive shell session to a running MicroVM via WebSocket. Requires SHELL_INGRESS network connector.

lamvms shell [microvm-id]
Flag Description Default
--token-expiration Shell token expiration 60m

Press Ctrl+D to disconnect.

curl

Send a request to a running MicroVM via curl. Automatically handles auth token.

lamvms curl <path> [curl-flags...]
Flag Description Default
--microvm-id MicroVM ID Interactive selection
--port Target port 0 (server-side default: 8080)
--token-expiration Auth token expiration 5m

Example:

lamvms --microvm microvm.jsonnet curl /health -s
suspend / resume / terminate

Manage MicroVM lifecycle. MicroVM ID can be omitted for interactive selection.

lamvms suspend [microvm-id]
lamvms resume [microvm-id]
lamvms terminate [microvm-id]

resume supports --create-auth-token and --token-expiration to generate a fresh auth token, and --output (text or json, default text) to control the output format.

delete

Delete a MicroVM image.

lamvms delete [flags]
Flag Description Default
--dry-run Show what would be done false
logs

Tail CloudWatch logs for a MicroVM image (delegates to aws logs tail).

lamvms logs [flags]
Flag Description Default
--since Start time 10m
--follow Follow new logs false
--format Log format (detailed, short, json) detailed
--filter-pattern CloudWatch filter pattern
skills

Manage the bundled Agent Skill (SKILL.md) that teaches LLM coding agents (Claude Code, Codex, etc.) how to use lamvms.

lamvms skills list
lamvms skills install [--scope user|repo] [--dry-run]
lamvms skills update
lamvms skills reinstall
lamvms skills uninstall
lamvms skills status
Flag Description Default
--scope Install scope (user or repo) user
--prefix Override install directory
--dry-run Preview changes without applying false
--force Overwrite unmanaged skills or force downgrade false

install --scope repo installs to .agents/skills/ in the repository root, which can be committed so teammates' agents pick it up without installing individually.

Global Flags

Flag Env Description
--microvm LAMVMS_MICROVM Path to microvm definition
--log-level LAMVMS_LOGLEVEL Log level (debug, info, warn, error)
--log-format LAMVMS_LOGFORMAT Log format (text, json)
--color / --no-color LAMVMS_COLOR Colored output
--region AWS_REGION AWS region
--profile AWS_PROFILE AWS profile
--endpoint AWS_ENDPOINT_URL AWS API endpoint
--envfile LAMVMS_ENVFILE Environment files
--filter-command LAMVMS_FILTER_COMMAND Filter command for interactive selection (e.g. peco, fzf). If the value contains spaces, it is evaluated via sh -c.
-V key=value Jsonnet external variables
--ext-code key=code Jsonnet external code
--version / -v Show version and exit

Examples

License

MIT

Documentation

Overview

Package lamvms provides a deployment tool for AWS Lambda MicroVMs.

Index

Constants

View Source
const IgnoreFilename = ".microvmignore"

IgnoreFilename is the name of the file listing exclusion patterns for zip archive creation.

Variables

View Source
var DefaultMicrovmFiles = []string{
	"microvm.jsonnet",
	"microvm.json",
}

DefaultMicrovmFiles is the list of default file names to search for.

View Source
var ErrDiff = errors.New("diff found")

ErrDiff indicates that differences were found between local and remote configurations.

View Source
var Version = "v0.3.1"

Version is the lamvms version string, rewritten by tagpr on release.

Functions

func CLI

func CLI(ctx context.Context, parse CLIParseFunc) (int, error)

CLI is the main entry point. It parses CLI options, configures logging, and dispatches to the appropriate subcommand.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App represents lamvms application.

func New

func New(ctx context.Context, opt *Option) (*App, error)

New creates an App instance.

func (*App) Curl

func (app *App) Curl(ctx context.Context, opt *CurlOption) error

Curl sends a request to a running MicroVM via curl.

func (*App) Delete

func (app *App) Delete(ctx context.Context, opt *DeleteOption) error

Delete deletes a MicroVM image.

func (*App) Deploy

func (app *App) Deploy(ctx context.Context, opt *DeployOption) error

Deploy deploys a MicroVM image.

func (*App) Diff

func (app *App) Diff(ctx context.Context, opt *DiffOption) error

Diff shows the diff between local and deployed MicroVM image configuration.

Resources and EgressNetworkConnectors resolve to a fixed AWS-side default when omitted locally, so the local value is filled with that default before comparing. BaseImageVersion instead resolves to "the latest base image at build time" when omitted, which always differs from whatever version is currently deployed; diffing it is not actionable, so it is excluded from the comparison whenever the local config doesn't pin a version.

func (*App) Logs

func (app *App) Logs(ctx context.Context, opt *LogsOption) error

Logs tails CloudWatch logs for the MicroVM image.

func (*App) Resume

func (app *App) Resume(ctx context.Context, opt *ResumeOption) error

Resume resumes a suspended MicroVM.

func (*App) Rollback

func (app *App) Rollback(ctx context.Context, opt *RollbackOption) error

Rollback deactivates the latest active version.

func (*App) Run

func (app *App) Run(ctx context.Context, opt *RunOption) error

Run starts a new MicroVM from the configured image.

func (*App) Shell

func (app *App) Shell(ctx context.Context, opt *ShellOption) error

Shell opens an interactive shell session to a running MicroVM.

func (*App) Suspend

func (app *App) Suspend(ctx context.Context, opt *SuspendOption) error

Suspend suspends a running MicroVM.

func (*App) Terminate

func (app *App) Terminate(ctx context.Context, opt *TerminateOption) error

Terminate terminates a MicroVM.

func (*App) Wait

func (app *App) Wait(ctx context.Context, opt *WaitOption) error

Wait waits for a MicroVM image version to be ready.

type CLIOptions

type CLIOptions struct {
	Option

	Init      *InitOption         `cmd:"init" help:"Initialize a microvm definition from an existing image." json:"init,omitempty"`
	Deploy    *DeployOption       `cmd:"deploy" help:"Deploy a MicroVM image." json:"deploy,omitempty"`
	Diff      *DiffOption         `cmd:"diff" help:"Show diff between local and deployed configuration." json:"diff,omitempty"`
	Wait      *WaitOption         `cmd:"wait" help:"Wait for a MicroVM image to be ready." json:"wait,omitempty"`
	Rollback  *RollbackOption     `cmd:"rollback" help:"Rollback to the previous active version." json:"rollback,omitempty"`
	Run       *RunOption          `cmd:"run" help:"Run a new MicroVM." json:"run,omitempty"`
	Suspend   *SuspendOption      `cmd:"suspend" help:"Suspend a running MicroVM." json:"suspend,omitempty"`
	Resume    *ResumeOption       `cmd:"resume" help:"Resume a suspended MicroVM." json:"resume,omitempty"`
	Terminate *TerminateOption    `cmd:"terminate" help:"Terminate a MicroVM." json:"terminate,omitempty"`
	Shell     *ShellOption        `cmd:"shell" help:"Open a shell session to a running MicroVM." json:"shell,omitempty"`
	Curl      *CurlOption         `cmd:"curl" help:"Send a request to a running MicroVM via curl." json:"curl,omitempty"`
	Delete    *DeleteOption       `cmd:"delete" help:"Delete a MicroVM image." json:"delete,omitempty"`
	Logs      *LogsOption         `cmd:"logs" help:"Show CloudWatch logs of a MicroVM image." json:"logs,omitempty"`
	Skills    *skillscmd.Commands `cmd:"skills" help:"Manage agent skills." json:"-"`
}

CLIOptions combines global options with subcommand definitions.

func ParseCLI

func ParseCLI(args []string) (string, *CLIOptions, func(), error)

ParseCLI parses command-line arguments and returns the subcommand name, parsed options, a usage function, and any error.

type CLIParseFunc

type CLIParseFunc func([]string) (string, *CLIOptions, func(), error)

CLIParseFunc is the signature of the CLI parser function.

type CallerIdentityData

type CallerIdentityData struct {
	Account string
	Arn     string
	UserID  string
}

CallerIdentityData is the data exposed to templates.

type CurlOption

type CurlOption struct {
	MicrovmID       string        `help:"MicroVM ID. If omitted, select interactively." json:"microvm_id,omitempty"`
	Port            int           `help:"Target port." default:"0" json:"port,omitempty"`
	TokenExpiration time.Duration `help:"Auth token expiration duration." default:"5m" name:"token-expiration" json:"token_expiration,omitempty"`
	Path            string        `arg:"" help:"Request path."`
	Args            []string      `arg:"" optional:"" passthrough:"" help:"Arguments passed to curl."`
}

CurlOption represents options for the curl subcommand.

type DeleteOption

type DeleteOption struct {
	DryRun bool `help:"Dry run." default:"false" json:"dry_run,omitempty"`
}

DeleteOption represents options for the delete subcommand.

type DeployOption

type DeployOption struct {
	Src          string `help:"Source directory to archive and upload. Defaults to the directory of the microvm definition file." json:"src,omitempty"`
	SkipArchive  bool   `help:"Skip creating and uploading zip archive." default:"false" json:"skip_archive,omitempty"`
	Wait         bool   `help:"Wait for the image build to complete." default:"true" negatable:"" json:"wait,omitempty"`
	BuildLogs    bool   `help:"Tail the build's CloudWatch Logs while waiting." default:"true" negatable:"" json:"build_logs,omitempty"`
	KeepVersions int    `help:"Number of latest versions to keep. Older versions will be deleted." default:"0" json:"keep_versions,omitempty"`
	DryRun       bool   `help:"Dry run." default:"false" json:"dry_run,omitempty"`
	Symlink      bool   `` /* 130-byte string literal not displayed */
}

DeployOption represents options for the deploy subcommand.

type DiffOption

type DiffOption struct {
	ExitCode bool `help:"Exit with code 2 if there are differences." default:"false" json:"exit_code,omitempty"`
}

DiffOption represents options for the diff subcommand.

type InitOption

type InitOption struct {
	ImageName      string `help:"Name of the existing MicroVM image." required:"true" name:"image-name" json:"image_name,omitempty"`
	Output         string `help:"Output file path." default:"microvm.json" json:"output,omitempty"`
	Jsonnet        bool   `help:"Output as .jsonnet format." default:"false" json:"jsonnet,omitempty"`
	ForceOverwrite bool   `help:"Overwrite existing files without prompting." default:"false" json:"force_overwrite,omitempty"`
}

InitOption represents options for the init subcommand.

type LambdaMicroVMsClient

type LambdaMicroVMsClient interface {
	CreateMicrovmImage(ctx context.Context, params *lambdamicrovms.CreateMicrovmImageInput, optFns ...func(*lambdamicrovms.Options)) (*lambdamicrovms.CreateMicrovmImageOutput, error)
	UpdateMicrovmImage(ctx context.Context, params *lambdamicrovms.UpdateMicrovmImageInput, optFns ...func(*lambdamicrovms.Options)) (*lambdamicrovms.UpdateMicrovmImageOutput, error)
	GetMicrovmImage(ctx context.Context, params *lambdamicrovms.GetMicrovmImageInput, optFns ...func(*lambdamicrovms.Options)) (*lambdamicrovms.GetMicrovmImageOutput, error)
	GetMicrovmImageVersion(ctx context.Context, params *lambdamicrovms.GetMicrovmImageVersionInput, optFns ...func(*lambdamicrovms.Options)) (*lambdamicrovms.GetMicrovmImageVersionOutput, error)
	UpdateMicrovmImageVersion(ctx context.Context, params *lambdamicrovms.UpdateMicrovmImageVersionInput, optFns ...func(*lambdamicrovms.Options)) (*lambdamicrovms.UpdateMicrovmImageVersionOutput, error)
	DeleteMicrovmImageVersion(ctx context.Context, params *lambdamicrovms.DeleteMicrovmImageVersionInput, optFns ...func(*lambdamicrovms.Options)) (*lambdamicrovms.DeleteMicrovmImageVersionOutput, error)
	ListMicrovmImages(ctx context.Context, params *lambdamicrovms.ListMicrovmImagesInput, optFns ...func(*lambdamicrovms.Options)) (*lambdamicrovms.ListMicrovmImagesOutput, error)
	ListMicrovmImageVersions(ctx context.Context, params *lambdamicrovms.ListMicrovmImageVersionsInput, optFns ...func(*lambdamicrovms.Options)) (*lambdamicrovms.ListMicrovmImageVersionsOutput, error)
	ListMicrovmImageBuilds(ctx context.Context, params *lambdamicrovms.ListMicrovmImageBuildsInput, optFns ...func(*lambdamicrovms.Options)) (*lambdamicrovms.ListMicrovmImageBuildsOutput, error)
	RunMicrovm(ctx context.Context, params *lambdamicrovms.RunMicrovmInput, optFns ...func(*lambdamicrovms.Options)) (*lambdamicrovms.RunMicrovmOutput, error)
	GetMicrovm(ctx context.Context, params *lambdamicrovms.GetMicrovmInput, optFns ...func(*lambdamicrovms.Options)) (*lambdamicrovms.GetMicrovmOutput, error)
	SuspendMicrovm(ctx context.Context, params *lambdamicrovms.SuspendMicrovmInput, optFns ...func(*lambdamicrovms.Options)) (*lambdamicrovms.SuspendMicrovmOutput, error)
	ResumeMicrovm(ctx context.Context, params *lambdamicrovms.ResumeMicrovmInput, optFns ...func(*lambdamicrovms.Options)) (*lambdamicrovms.ResumeMicrovmOutput, error)
	TerminateMicrovm(ctx context.Context, params *lambdamicrovms.TerminateMicrovmInput, optFns ...func(*lambdamicrovms.Options)) (*lambdamicrovms.TerminateMicrovmOutput, error)
	ListMicrovms(ctx context.Context, params *lambdamicrovms.ListMicrovmsInput, optFns ...func(*lambdamicrovms.Options)) (*lambdamicrovms.ListMicrovmsOutput, error)
	DeleteMicrovmImage(ctx context.Context, params *lambdamicrovms.DeleteMicrovmImageInput, optFns ...func(*lambdamicrovms.Options)) (*lambdamicrovms.DeleteMicrovmImageOutput, error)
	ListTags(ctx context.Context, params *lambdamicrovms.ListTagsInput, optFns ...func(*lambdamicrovms.Options)) (*lambdamicrovms.ListTagsOutput, error)
	TagResource(ctx context.Context, params *lambdamicrovms.TagResourceInput, optFns ...func(*lambdamicrovms.Options)) (*lambdamicrovms.TagResourceOutput, error)
	UntagResource(ctx context.Context, params *lambdamicrovms.UntagResourceInput, optFns ...func(*lambdamicrovms.Options)) (*lambdamicrovms.UntagResourceOutput, error)
	CreateMicrovmAuthToken(ctx context.Context, params *lambdamicrovms.CreateMicrovmAuthTokenInput, optFns ...func(*lambdamicrovms.Options)) (*lambdamicrovms.CreateMicrovmAuthTokenOutput, error)
	CreateMicrovmShellAuthToken(ctx context.Context, params *lambdamicrovms.CreateMicrovmShellAuthTokenInput, optFns ...func(*lambdamicrovms.Options)) (*lambdamicrovms.CreateMicrovmShellAuthTokenOutput, error)
}

LambdaMicroVMsClient is the interface for AWS Lambda MicroVMs API operations.

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

Loader loads and evaluates microvm definition files.

func NewLoader

func NewLoader(awsCfg aws.Config, extStr, extCode map[string]string) *Loader

NewLoader creates a Loader with Jsonnet native functions and template functions.

func (*Loader) Load

func (l *Loader) Load(ctx context.Context, path string) (*MicrovmImage, string, error)

Load loads a MicrovmImage from the given path and returns the resolved path. If path is empty, it searches for default files.

func (*Loader) LoadRunConfig

func (l *Loader) LoadRunConfig(ctx context.Context, path string) (*RunConfig, error)

LoadRunConfig loads a RunConfig from the given path.

type LogsOption

type LogsOption struct {
	Since         string `help:"From what time to begin displaying logs." default:"10m" json:"since,omitempty"`
	Follow        bool   `help:"Follow new logs." default:"false" json:"follow,omitempty"`
	Format        string `help:"The format to display the logs." default:"detailed" enum:"detailed,short,json" json:"format,omitempty"`
	FilterPattern string `help:"The filter pattern to use." json:"filter_pattern,omitempty"`
}

LogsOption represents options for the logs subcommand.

type MicrovmImage

MicrovmImage represents configuration based on CreateMicrovmImageInput.

func (MicrovmImage) MarshalJSON

func (m MicrovmImage) MarshalJSON() ([]byte, error)

MarshalJSON implements custom marshaling for MicrovmImage.

func (*MicrovmImage) UnmarshalJSON

func (m *MicrovmImage) UnmarshalJSON(data []byte) error

UnmarshalJSON implements custom unmarshaling for MicrovmImage.

type Option

type Option struct {
	Microvm   string `help:"Path to microvm definition file." name:"microvm" env:"LAMVMS_MICROVM" json:"microvm,omitempty"`
	LogLevel  string `` /* 128-byte string literal not displayed */
	LogFormat string `help:"Log format (text, json)." default:"text" enum:",text,json" env:"LAMVMS_LOGFORMAT" json:"log_format"`
	Color     bool   `help:"Enable colored output." default:"true" env:"LAMVMS_COLOR" negatable:"" json:"color,omitempty"`

	FilterCommand string            `help:"Filter command for interactive selection (e.g. peco, fzf)." env:"LAMVMS_FILTER_COMMAND" json:"filter_command,omitempty"`
	Region        *string           `help:"AWS region." env:"AWS_REGION" json:"region,omitempty"`
	Profile       *string           `help:"AWS credential profile name." env:"AWS_PROFILE" json:"profile,omitempty"`
	Endpoint      *string           `help:"AWS API endpoint." env:"AWS_ENDPOINT_URL" json:"endpoint,omitempty"`
	Envfile       []string          `help:"Environment files." env:"LAMVMS_ENVFILE" json:"envfile,omitempty"`
	ExtStr        map[string]string `help:"Jsonnet external variables." short:"V" json:"ext_str,omitempty"`
	ExtCode       map[string]string `help:"Jsonnet external code." name:"ext-code" json:"ext_code,omitempty"`

	Version kong.VersionFlag `help:"Show version." short:"v" json:"-"`
}

Option holds global flags shared across all subcommands.

type ResumeOption

type ResumeOption struct {
	MicrovmID       string        `arg:"" optional:"" help:"MicroVM ID to resume. If omitted, select interactively."`
	CreateAuthToken bool          `help:"Create an auth token after resume." default:"false" json:"create_auth_token,omitempty"`
	TokenExpiration time.Duration `help:"Auth token expiration duration." default:"30m" name:"token-expiration" json:"token_expiration,omitempty"`
	Output          string        `help:"Output format." default:"text" enum:"text,json" json:"output,omitempty"`
}

ResumeOption represents options for the resume subcommand.

type RollbackOption

type RollbackOption struct {
	DryRun bool `help:"Dry run." default:"false" json:"dry_run,omitempty"`
}

RollbackOption represents options for the rollback subcommand.

type RunConfig

RunConfig represents configuration based on RunMicrovmInput.

func (RunConfig) MarshalJSON

func (m RunConfig) MarshalJSON() ([]byte, error)

MarshalJSON implements custom marshaling for RunConfig.

func (*RunConfig) UnmarshalJSON

func (m *RunConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON implements custom unmarshaling for RunConfig.

type RunOption

type RunOption struct {
	RunDef                   string        `help:"Path to run definition file (run.jsonnet or run.json)." name:"run-def" json:"run_def,omitempty"`
	ImageVersion             string        `help:"Image version to run." name:"image-version" json:"image_version,omitempty"`
	ExecutionRoleArn         string        `help:"IAM role ARN for runtime permissions." name:"execution-role-arn" json:"execution_role_arn,omitempty"`
	MaximumDurationInSeconds int32         `help:"Maximum duration in seconds (1-28800)." name:"max-duration" json:"maximum_duration_in_seconds,omitempty"`
	RunHookPayload           string        `help:"Payload for /run lifecycle hook (max 16KB)." name:"run-hook-payload" json:"run_hook_payload,omitempty"`
	Wait                     bool          `help:"Wait for the MicroVM to be running." default:"true" negatable:"" json:"wait,omitempty"`
	CreateAuthToken          bool          `help:"Create an auth token after run." default:"false" json:"create_auth_token,omitempty"`
	TokenExpiration          time.Duration `help:"Auth token expiration duration." default:"30m" name:"token-expiration" json:"token_expiration,omitempty"`
	Output                   string        `help:"Output format." default:"text" enum:"text,json" json:"output,omitempty"`
}

RunOption represents options for the run subcommand.

type ShellOption

type ShellOption struct {
	MicrovmID       string        `arg:"" optional:"" help:"MicroVM ID to connect. If omitted, select interactively."`
	TokenExpiration time.Duration `help:"Shell auth token expiration duration." default:"60m" name:"token-expiration" json:"token_expiration,omitempty"`
}

ShellOption represents options for the shell subcommand.

type SuspendOption

type SuspendOption struct {
	MicrovmID string `arg:"" optional:"" help:"MicroVM ID to suspend. If omitted, select interactively."`
}

SuspendOption represents options for the suspend subcommand.

type TerminateOption

type TerminateOption struct {
	MicrovmID string `arg:"" optional:"" help:"MicroVM ID to terminate. If omitted, select interactively."`
}

TerminateOption represents options for the terminate subcommand.

type WaitOption

type WaitOption struct {
	Version      string `help:"Image version to wait for. Defaults to the latest version." name:"image-version" json:"image_version,omitempty"`
	BuildLogs    bool   `help:"Tail the build's CloudWatch Logs while waiting." default:"true" negatable:"" json:"build_logs,omitempty"`
	KeepVersions int    `help:"Number of latest versions to keep. Older versions will be deleted." default:"0" json:"keep_versions,omitempty"`
}

WaitOption represents options for the wait subcommand.

Directories

Path Synopsis
cmd
codegen command
codegen generates Go types with custom (Un)MarshalJSON for AWS SDK structs that contain union-typed fields.
codegen generates Go types with custom (Un)MarshalJSON for AWS SDK structs that contain union-typed fields.
lamvms command
Package skillscmd provides Kong-compatible command structs for skillsmith integration.
Package skillscmd provides Kong-compatible command structs for skillsmith integration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL