aws

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package aws provides AWS adapters shared by Podmin's CLI and agent.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, region, profile, bucket string) (*cloud.Client, error)

New loads AWS configuration using an optional shared-config profile.

Types

type Compute

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

Compute provides the EC2 queries required during setup.

func (*Compute) Architecture

func (c *Compute) Architecture(ctx context.Context, instanceType string) (string, error)

Architecture validates an EC2 instance type and returns its Go architecture.

func (*Compute) SubnetCIDRs

func (c *Compute) SubnetCIDRs(ctx context.Context, cluster string, cidr netip.Prefix, nodeGroups []string) (map[string]string, bool, error)

SubnetCIDRs validates a reused VPC, reports its ownership, and allocates stable IPv6 /64s.

type Config

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

Config constructs AWS resources from one SDK configuration.

func Load

func Load(ctx context.Context, region, profile string) (Config, error)

Load loads AWS configuration using an optional shared-config profile.

func (Config) Compute

func (c Config) Compute() *Compute

Compute returns the AWS infrastructure discovery client.

func (Config) InstanceID

func (c Config) InstanceID(ctx context.Context) (string, error)

InstanceID returns the current EC2 instance identifier from IMDS.

func (Config) ObjectStore

func (c Config) ObjectStore(bucket string, maxObjectSize int64) *ObjectStore

ObjectStore returns object storage for one S3 bucket; zero disables the read limit.

func (Config) ParameterStore

func (c Config) ParameterStore() *ParameterStore

ParameterStore returns an AWS Systems Manager Parameter Store client.

func (Config) Secrets

func (c Config) Secrets() *Secrets

Secrets returns an AWS Secrets Manager client.

type ObjectStore

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

ObjectStore provides object operations for one S3 bucket.

func (*ObjectStore) Delete

func (s *ObjectStore) Delete(ctx context.Context, key string) error

Delete removes an object.

func (*ObjectStore) EmptyAndDeleteBucket

func (s *ObjectStore) EmptyAndDeleteBucket(ctx context.Context) error

EmptyAndDeleteBucket permanently removes all current objects and the bucket.

func (*ObjectStore) EnsureBucket

func (s *ObjectStore) EnsureBucket(ctx context.Context) error

EnsureBucket creates an absent bucket, checks its region, and verifies write/read/delete access.

func (*ObjectStore) Get

func (s *ObjectStore) Get(ctx context.Context, key string) ([]byte, string, error)

Get returns an object's bytes and ETag for a later conditional write.

func (*ObjectStore) List

func (s *ObjectStore) List(ctx context.Context, prefix string) ([]cloud.ObjectInfo, error)

List returns one paginated listing beneath prefix.

func (*ObjectStore) PutIfMatch

func (s *ObjectStore) PutIfMatch(ctx context.Context, key string, body []byte, version string) error

PutIfMatch replaces an object matching version, or creates it when version is empty.

func (*ObjectStore) PutStream added in v0.2.0

func (s *ObjectStore) PutStream(ctx context.Context, key string, body io.Reader, size int64) error

PutStream stores an object from a stream.

type ParameterStore

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

ParameterStore reads and writes AWS Systems Manager parameters.

func (*ParameterStore) Archive

func (s *ParameterStore) Archive(context.Context, string) error

Archive reports that Parameter Store does not support recoverable deletion.

func (*ParameterStore) Create

func (s *ParameterStore) Create(ctx context.Context, name string, value []byte) error

Create creates a SecureString parameter without overwriting one that exists.

func (*ParameterStore) Destroy

func (s *ParameterStore) Destroy(ctx context.Context, path string) error

Destroy permanently deletes a Parameter Store parameter.

func (*ParameterStore) Get

func (s *ParameterStore) Get(ctx context.Context, path string) ([]byte, error)

Get returns one decrypted String, StringList, or SecureString value.

func (*ParameterStore) List

func (s *ParameterStore) List(ctx context.Context, path string) ([]string, error)

List returns immediate parameter names beneath path without values.

func (*ParameterStore) Restore

func (s *ParameterStore) Restore(context.Context, string) error

Restore reports that Parameter Store does not support restoration.

func (*ParameterStore) Update

func (s *ParameterStore) Update(ctx context.Context, name string, value []byte) error

Update updates a SecureString parameter.

type Secrets

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

Secrets returns explicitly named current Secrets Manager values.

func (*Secrets) Archive

func (s *Secrets) Archive(ctx context.Context, name string) error

Archive schedules deletion with a 30-day recovery window.

func (*Secrets) Create

func (s *Secrets) Create(ctx context.Context, name string, value []byte) error

Create creates a new secret.

func (*Secrets) Destroy

func (s *Secrets) Destroy(ctx context.Context, name string) error

Destroy permanently deletes a secret without recovery.

func (*Secrets) Get

func (s *Secrets) Get(ctx context.Context, name string) ([]byte, error)

Get fetches the current AWSCURRENT SecretString or SecretBinary value.

func (*Secrets) List

func (s *Secrets) List(ctx context.Context, prefix string) ([]string, error)

List returns sorted immediate valid keys under the exact scope prefix.

func (*Secrets) Restore

func (s *Secrets) Restore(ctx context.Context, name string) error

Restore cancels a secret's scheduled deletion.

func (*Secrets) Update

func (s *Secrets) Update(ctx context.Context, name string, value []byte) error

Update adds a current value to an existing secret.

Jump to

Keyboard shortcuts

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