api

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// SSMDocumentLinux / SSMDocumentWindows are the canonical AWS-managed SSM
	// documents the validation flow uses to run shell or PowerShell commands.
	SSMDocumentLinux   = "AWS-RunShellScript"
	SSMDocumentWindows = "AWS-RunPowerShellScript"
)

AWS SSM API constants — JSON-1.1 RPC endpoint with X-Amz-Target dispatch.

View Source
const (
	DefaultTimeout = 30 * time.Second
)

Variables

This section is empty.

Functions

func DecodeError

func DecodeError(statusCode int, body []byte) error

func ErrorCode

func ErrorCode(err error) string

func IsAccessDenied added in v0.2.5

func IsAccessDenied(err error) bool

func NewHTTPClient

func NewHTTPClient() *http.Client

func NewTransport

func NewTransport() *http.Transport

func RandomPassword added in v0.3.1

func RandomPassword() (string, error)

RandomPassword returns a base64 string suitable for an AWS RDS master password rotation when callers want to lock out access (the `userdel` branch). 24 random bytes encode to 32 base64 chars — well below the RDS 41-char limit and above the 8-char minimum.

Types

type APIError

type APIError struct {
	StatusCode int
	Code       string
	Message    string
	RequestID  string
}

func (*APIError) Error

func (e *APIError) Error() string

type AttachedUserPolicy

type AttachedUserPolicy struct {
	PolicyName string
	PolicyArn  string
}

type Client

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

func NewClient

func NewClient(credential auth.Credential, opts ...Option) *Client

func (*Client) AttachUserPolicy

func (c *Client) AttachUserPolicy(ctx context.Context, region, userName, policyArn string) error

func (*Client) CloudTrailLookupEvents added in v0.3.1

func (c *Client) CloudTrailLookupEvents(ctx context.Context, region string, startTime, endTime int64, maxResults int64, nextToken string) (LookupEventsOutput, error)

CloudTrailLookupEvents reads recent management-event entries from AWS CloudTrail. startTime / endTime are Unix seconds (0 = unset → CloudTrail default 90-day window). nextToken paginates. The response includes both the parsed event header *and* the original `CloudTrailEvent` JSON blob, which the caller can re-parse for richer fields.

func (*Client) CloudWatchLogsDescribeLogGroups added in v0.3.1

func (c *Client) CloudWatchLogsDescribeLogGroups(ctx context.Context, region string, limit int64, nextToken string) (DescribeLogGroupsOutput, error)

CloudWatchLogsDescribeLogGroups lists log groups in `region`. nextToken paginates; pass "" for the first call.

func (*Client) CostExplorerCurrentMonthSpend added in v0.3.1

func (c *Client) CostExplorerCurrentMonthSpend(ctx context.Context) (string, string, error)

CostExplorerCurrentMonthSpend returns the unblended cost for the current calendar month in USD. The first day of the month inclusive → today exclusive matches Cost Explorer's expected window.

func (*Client) CreateAccessKey added in v0.3.1

func (c *Client) CreateAccessKey(ctx context.Context, region, userName string) (CreateAccessKeyOutput, error)

func (*Client) CreateLoginProfile

func (c *Client) CreateLoginProfile(ctx context.Context, region, userName, password string) error

func (*Client) CreateUser

func (c *Client) CreateUser(ctx context.Context, region, userName string) (CreateUserOutput, error)

func (*Client) DeleteAccessKey added in v0.3.1

func (c *Client) DeleteAccessKey(ctx context.Context, region, userName, accessKeyID string) error

func (*Client) DeleteLoginProfile

func (c *Client) DeleteLoginProfile(ctx context.Context, region, userName string) error

func (*Client) DeletePublicAccessBlock added in v0.3.1

func (c *Client) DeletePublicAccessBlock(ctx context.Context, region, bucket string) error

DeletePublicAccessBlock clears the BlockPublicAcls / IgnorePublicAcls settings on bucket so a subsequent canned ACL change actually surfaces. New AWS accounts ship with BPA enabled by default; without this call the `expose` flow will silently no-op even after PutBucketAcl returns 200.

func (*Client) DeleteUser

func (c *Client) DeleteUser(ctx context.Context, region, userName string) error

func (*Client) DescribeDBInstances added in v0.3.1

func (c *Client) DescribeDBInstances(ctx context.Context, region, marker string) (DescribeDBInstancesOutput, error)

DescribeDBInstances paginates through RDS DescribeDBInstances. Pass an empty marker for the first call.

func (*Client) DescribeInstances

func (c *Client) DescribeInstances(ctx context.