Documentation
¶
Overview ¶
Package session manages SSM session lifecycle and shell/exec/forward modes.
Index ¶
- func Connect(ctx context.Context, cfg aws.Config, instanceID, region, profile string) error
- func Exec(ctx context.Context, cfg aws.Config, ...) error
- func Forward(ctx context.Context, cfg aws.Config, instanceID, region, profile string, ...) error
- func SSHProxy(ctx context.Context, cfg aws.Config, instanceID, region, profile string) error
- type ForwardSpec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Connect ¶
Connect starts an interactive SSM session on instanceID by exec-ing session-manager-plugin. Only returns if an error occurs before exec.
func Exec ¶
Exec starts a non-interactive SSM session that runs command on instanceID, streaming output through session-manager-plugin. The context may carry a deadline (e.g. from --timeout); cancellation kills the plugin process.
func Forward ¶
func Forward(ctx context.Context, cfg aws.Config, instanceID, region, profile string, fwd ForwardSpec) error
Forward starts a native SSM port-forwarding session via session-manager-plugin. It blocks until the plugin exits. The caller is responsible for running multiple forwards concurrently when needed.
Types ¶
type ForwardSpec ¶
ForwardSpec describes a single port-forwarding rule.
func (ForwardSpec) IsLocal ¶
func (f ForwardSpec) IsLocal() bool
IsLocal reports whether the forward targets the instance itself (remoteHost is localhost or 127.0.0.1), selecting AWS-StartPortForwardingSession instead of AWS-StartPortForwardingSessionToRemoteHost.