awsutil

package
v0.8.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Functions

func PopulateTagFields added in v0.0.38

func PopulateTagFields(tags []types.Tag) ([]tablewriter.Field, error)

func WaitForStatus added in v0.7.0

func WaitForStatus(ctx context.Context, config WaitConfig) (string, error)

WaitForStatus polls StatusFunc at PollInterval until IsTerminal returns true or MaxWait is exceeded. Returns the final status.

Types

type BaseService

type BaseService struct {
	Config aws.Config
}

func LoadDefaultConfig

func LoadDefaultConfig(ctx context.Context, profile string, region string) (*BaseService, error)

type ResourceInfo added in v0.7.0

type ResourceInfo struct {
	Service      string
	ResourceType string
}

ResourceInfo describes an AWS resource type identified by its ID prefix.

func IdentifyResource added in v0.7.0

func IdentifyResource(id string) *ResourceInfo

IdentifyResource returns the service and resource type for a given AWS resource ID based on its prefix. Returns nil for unrecognised IDs.

type ResourceURI added in v0.7.0

type ResourceURI struct {
	Service      string
	ResourceType string
	Resource     string
	Params       map[string]string
}

ResourceURI represents a parsed protocol-style resource identifier. e.g. "rds://my-database" → {Service: "rds", ResourceType: "instance", Resource: "my-database"} e.g. "ecs://service/my-cluster/my-svc" → {Service: "ecs", ResourceType: "service", Resource: "my-svc", Params: {"cluster": "my-cluster"}}

func ParseResourceURI added in v0.7.0

func ParseResourceURI(input string) (*ResourceURI, error)

ParseResourceURI parses a protocol-style resource identifier.

Supported formats:

  • "ec2://i-xxx" → EC2 instance
  • "ec2://volume/vol-xxx" → EC2 volume
  • "rds://my-database" → RDS instance (default type)
  • "rds://cluster/my-cluster" → RDS cluster
  • "cf://my-stack" → CloudFormation stack
  • "elasticache://my-cluster" → ElastiCache cluster
  • "elb://my-lb" → ELB load balancer
  • "vpc://nat-gateway/nat-xxx" → VPC NAT gateway
  • "ecs://service/my-cluster/my-svc" → ECS service (cluster extracted as param)
  • "ecs://task/my-cluster/task-id" → ECS task (cluster extracted as param)
  • "i-xxx" → EC2 instance (detected by prefix)
  • "nat-xxx" → VPC NAT gateway (detected by prefix)

Returns an error if the input cannot be resolved to a service.

type Tag added in v0.0.38

type Tag struct {
	Name  string
	Value string
}

func NormalizeTags added in v0.0.35

func NormalizeTags(tags any) ([]Tag, error)

NormalizeTags turns the provided tags into a map

type WaitConfig added in v0.7.0

type WaitConfig struct {
	ResourceName string
	PollInterval time.Duration
	MaxWait      time.Duration
	StatusFunc   func(ctx context.Context) (string, error)
	IsTerminal   func(status string) bool
}

WaitConfig configures the polling behaviour for WaitForStatus.

Jump to

Keyboard shortcuts

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