Documentation
¶
Overview ¶
Package ssm reads managed instance status and runs allowlisted commands over signed JSON 1.1.
Index ¶
- Variables
- func Allowed(allow []string, command string) bool
- func ValidInstance(id string) bool
- type Client
- func (c *Client) DescribeInstances(ctx context.Context, region, id string) ([]Instance, error)
- func (c *Client) GetInvocation(ctx context.Context, region, commandID, instanceID string) (Invocation, error)
- func (c *Client) SendCommand(ctx context.Context, region, instanceID, command string, allow []string, ...) (string, error)
- func (c *Client) StartSession(ctx context.Context, region, instanceID string) (Session, error)
- type Instance
- type Invocation
- type Session
Constants ¶
This section is empty.
Variables ¶
var ErrRefused = errors.New("ssm: refused")
ErrRefused marks a command or instance id the policy rejects.
var Service = awsx.Service{Name: "ssm", Prefix: "ssm", SigningName: "ssm", TargetPrefix: "AmazonSSM"}
Service is the Systems Manager API.
Functions ¶
func Allowed ¶
Allowed reports whether command matches an allowlist entry exactly. An empty list refuses all.
func ValidInstance ¶
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 (*Client) DescribeInstances ¶
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.
type Instance ¶
type Instance struct {
ID, PingStatus, Platform, PlatformName, AgentVersion, ComputerName string
LastPing time.Time
}
Instance is one managed instance row.
type Invocation ¶
Invocation is the result of one command on one instance.