ssm

package
v1.5.8 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ssm reads managed instance status and runs allowlisted commands over signed JSON 1.1.

Index

Constants

This section is empty.

Variables

View Source
var ErrRefused = errors.New("ssm: refused")

ErrRefused marks a command or instance id the policy rejects.

View Source
var Service = awsx.Service{Name: "ssm", Prefix: "ssm", SigningName: "ssm", TargetPrefix: "AmazonSSM"}

Service is the Systems Manager API.

Functions

func Allowed

func Allowed(allow []string, command string) bool

Allowed reports whether command matches an allowlist entry exactly. An empty list refuses all.

func ValidInstance

func ValidInstance(id string) bool

ValidInstance reports whether id looks like an EC2 or hybrid managed instance id.

Types

type Client

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

Client is the lazy SSM module.

func New

func New(c *awsx.Client) *Client

New wraps a shared client.

func (*Client) DescribeInstances

func (c *Client) DescribeInstances(ctx context.Context, region, id string) ([]Instance, error)

DescribeInstances lists managed instances, or only one when id is set.

func (*Client) GetInvocation

func (c *Client) GetInvocation(ctx context.Context, region, commandID, instanceID string) (Invocation, error)

GetInvocation reads the status and output of a command on an instance.

func (*Client) SendCommand

func (c *Client) SendCommand(ctx context.Context, region, instanceID, command string, allow []string, timeoutSeconds int) (string, error)

SendCommand runs one allowlisted shell command on a single instance and returns the command id.

func (*Client) StartSession

func (c *Client) StartSession(ctx context.Context, region, instanceID string) (Session, error)

StartSession opens a session and returns its token info. No stream is proxied here.

type Instance

type Instance struct {
	ID, PingStatus, Platform, PlatformName, AgentVersion, ComputerName string
	LastPing                                                           time.Time
}

Instance is one managed instance row.

type Invocation

type Invocation struct {
	Status, Detail, Stdout, Stderr string
	ExitCode                       int
}

Invocation is the result of one command on one instance.

type Session

type Session struct {
	ID, Token, StreamURL string
}

Session is the token info a client needs to open a session with the session manager plugin. The token is a secret, so callers must not log it.

Jump to

Keyboard shortcuts

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