Documentation
¶
Overview ¶
Package aws provides AMI caching functionality for the Universal AMI System
Package aws provides AMI cost analysis functionality for the Universal AMI System ¶
Package aws provides AMI integration methods for the Universal AMI System ¶
Package aws provides AMI resolution capabilities for the Universal AMI System ¶
Package aws provides enhanced error messages with actionable guidance ¶
Package aws provides retry logic with exponential backoff for transient AWS failures
Index ¶
- Constants
- func EnhanceError(err error, operation string) error
- func ExponentialBackoff(attempt int, initialDelay, maxDelay time.Duration, multiplier float64) time.Duration
- func FormatFreshnessReport(results []AMIFreshnessResult) string
- func GetRecommendedUpdateFrequency() map[string]string
- func GetStaticAMILocations() map[string]string
- func IsRetryable(err error) bool
- func WithRetry(ctx context.Context, config *RetryConfig, operation RetryableOperation) error
- func WithRetryAndTracking(ctx context.Context, config *RetryConfig, tracker *RetryTracker, ...) error
- type AMICache
- func (c *AMICache) CleanupExpired() int
- func (c *AMICache) Clear()
- func (c *AMICache) ConfigureCache(config *AMICacheConfig)
- func (c *AMICache) GetAMI(amiID, region string) *types.AMIInfo
- func (c *AMICache) GetStats() *AMICacheStats
- func (c *AMICache) InvalidateAMI(amiID, region string)
- func (c *AMICache) InvalidateRegion(region string)
- func (c *AMICache) SetAMI(amiID, region string, ami *types.AMIInfo)
- func (c *AMICache) SetAMIWithTTL(amiID, region string, ami *types.AMIInfo, ttl time.Duration)
- func (c *AMICache) StartCleanupRoutine(interval time.Duration)
- type AMICacheConfig
- type AMICacheStats
- type AMICostAnalyzer
- func (a *AMICostAnalyzer) AnalyzeCosts(templateName, region string, amiInfo *types.AMIInfo, scriptTime time.Duration) *types.AMICostAnalysis
- func (a *AMICostAnalyzer) CalculateAMICost(ami *types.AMIInfo, region string) float64
- func (a *AMICostAnalyzer) CompareDeploymentCosts(strategies []string, duration float64, region string) map[string]float64
- func (a *AMICostAnalyzer) EstimateCrossRegionCost(amiSize float64, sourceRegion, targetRegion string) float64
- func (a *AMICostAnalyzer) GetOptimizedInstanceType(templateDomain string, region string) (string, float64)
- type AMICreateParams
- type AMIDiscovery
- func (d *AMIDiscovery) BulkDiscoverAMIs(ctx context.Context, region string) (map[string]map[string]map[string]map[string]string, error)
- func (d *AMIDiscovery) CheckAMIFreshness(ctx context.Context, ...) ([]AMIFreshnessResult, error)
- func (d *AMIDiscovery) GetAMIWithFallback(ctx context.Context, distro, version, region, arch, staticFallback string) (string, string, error)
- func (d *AMIDiscovery) GetLatestAMI(ctx context.Context, distro, version, region, arch string) (string, error)
- func (d *AMIDiscovery) GetSSMParameterPaths() map[string][]string
- func (d *AMIDiscovery) ValidateAMI(ctx context.Context, amiID, region string) (bool, error)
- type AMIFreshnessResult
- type AMISearchCriteria
- type AMIStatusInfo
- type EC2ClientInterface
- type EFSClientInterface
- type EnhancedError
- type InstanceBuilder
- type InstanceConfigBuilder
- type InstanceLauncher
- type InstanceListProcessor
- type InstanceStateConverter
- type InstanceTagExtractor
- type LaunchOptionsProcessor
- type LaunchOrchestrator
- type Manager
- func (m *Manager) ApplyHibernationPolicy(instanceName string, policyID string) error
- func (m *Manager) AttachStorage(volumeName, instanceName string) error
- func (m *Manager) CheckAMIFreshness(ctx context.Context, ...) ([]AMIFreshnessResult, error)
- func (m *Manager) CleanupOldAMIs(maxAge string, dryRun bool) (*types.AMICleanupResult, error)
- func (m *Manager) CreateAMIFromInstance(request *types.AMICreationRequest) (*types.AMICreationResult, error)
- func (m *Manager) CreateInstanceAMISnapshot(instanceName, snapshotName, description string, noReboot bool) (*ctypes.InstanceSnapshotResult, error)
- func (m *Manager) CreateInstanceSnapshot(instanceID, description string, noReboot bool) (*types.SnapshotCreationResult, error)
- func (m *Manager) CreateS3Client() (*s3.Client, error)
- func (m *Manager) CreateStorage(req ctypes.StorageCreateRequest) (*ctypes.StorageVolume, error)
- func (m *Manager) CreateVolume(req ctypes.VolumeCreateRequest) (*ctypes.StorageVolume, error)
- func (m *Manager) DeleteAMI(amiID string, deregisterOnly bool) (*types.AMIDeletionResult, error)
- func (m *Manager) DeleteInstance(name string) error
- func (m *Manager) DeleteInstanceSnapshot(snapshotName string) (*ctypes.InstanceSnapshotDeleteResult, error)
- func (m *Manager) DeleteKeyPair(keyName string) error
- func (m *Manager) DeleteSnapshot(snapshotID string) (*types.SnapshotDeletionResult, error)
- func (m *Manager) DeleteStorage(name string) error
- func (m *Manager) DeleteVolume(name string) error
- func (m *Manager) DetachStorage(volumeName string) error
- func (m *Manager) DiscoverDefaultVPC() (string, error)
- func (m *Manager) DiscoverPublicSubnet(vpcID string) (string, error)
- func (m *Manager) DiscoverPublicSubnetForInstanceType(vpcID, instanceType string) (string, error)
- func (m *Manager) EnsureKeyPairExists(keyName, publicKeyContent string) error
- func (m *Manager) ExecuteCommand(instanceName string, execRequest ctypes.ExecRequest) (*ctypes.ExecResult, error)
- func (m *Manager) GetAMICostAnalysis(templateName string) (*types.AMICostAnalysis, error)
- func (m *Manager) GetAMICreationStatus(creationID string) (*types.AMICreationResult, error)
- func (m *Manager) GetAWSConfig() aws.Config
- func (m *Manager) GetAvailableLogTypes() []string
- func (m *Manager) GetBillingInfo() (*ctypes.BillingInfo, error)
- func (m *Manager) GetConnectionInfo(name string) (string, error)
- func (m *Manager) GetDefaultRegion() string
- func (m *Manager) GetDiscountConfig() ctypes.DiscountConfig
- func (m *Manager) GetIdlePolicy(policyID string) (*idle.PolicyTemplate, error)
- func (m *Manager) GetIdleScheduler() *idle.Scheduler
- func (m *Manager) GetInstance(instanceID string) (*ctypes.Instance, error)
- func (m *Manager) GetInstanceConsoleOutput(instanceID string) (string, error)
- func (m *Manager) GetInstanceHibernationStatus(name string) (bool, string, bool, error)
- func (m *Manager) GetInstancePolicies(instanceName string) ([]*idle.PolicyTemplate, error)
- func (m *Manager) GetInstanceSnapshotInfo(snapshotName string) (*ctypes.InstanceSnapshotInfo, error)
- func (m *Manager) GetInstanceSystemLogs(instanceID string, logType string) ([]string, error)
- func (m *Manager) GetOrCreatePrismSecurityGroup(vpcID string) (string, error)
- func (m *Manager) GetPolicyManager() *idle.PolicyManager
- func (m *Manager) GetTemplate(name string) (*ctypes.Template, error)
- func (m *Manager) GetTemplates() map[string]ctypes.Template
- func (m *Manager) HibernateInstance(name string) error
- func (m *Manager) LaunchInstance(req ctypes.LaunchRequest) (*ctypes.Instance, error)
- func (m *Manager) LaunchInstanceWithAMI(req types.LaunchRequest) (*types.Instance, error)
- func (m *Manager) ListAMISnapshots(instanceID, maxAge string) ([]types.SnapshotInfo, error)
- func (m *Manager) ListIdlePolicies() []*idle.PolicyTemplate
- func (m *Manager) ListInstanceSnapshots() ([]ctypes.InstanceSnapshotInfo, error)
- func (m *Manager) ListInstances() ([]ctypes.Instance, error)
- func (m *Manager) ListPrismKeyPairs() ([]string, error)
- func (m *Manager) ListUserAMIs() ([]*types.AMIInfo, error)
- func (m *Manager) MountVolume(volumeName, instanceName, mountPoint string) error
- func (m *Manager) PreviewAMIResolution(templateName string) (*types.AMIResolutionResult, error)
- func (m *Manager) PublishAMIToCommunity(amiID string, public bool, tags map[string]string) error
- func (m *Manager) RecommendIdlePolicy(instanceName string) (*idle.PolicyTemplate, error)
- func (m *Manager) RemoveHibernationPolicy(instanceName string, policyID string) error
- func (m *Manager) ResizeInstance(resizeRequest ctypes.ResizeRequest) (*ctypes.ResizeResponse, error)
- func (m *Manager) ResolveAMIForTemplate(templateName string) (*types.AMIResolutionResult, error)
- func (m *Manager) RestoreAMIFromSnapshot(snapshotID, name, description, architecture string) (*types.AMIRestoreResult, error)
- func (m *Manager) RestoreInstanceFromSnapshot(snapshotName, newInstanceName string) (*ctypes.InstanceRestoreResult, error)
- func (m *Manager) ResumeInstance(name string) error
- func (m *Manager) SetDiscountConfig(config ctypes.DiscountConfig)
- func (m *Manager) StartInstance(name string) error
- func (m *Manager) StopInstance(name string) error
- func (m *Manager) TestAMIAvailability(templateName string, regions []string) (*types.AMITestResult, error)
- func (m *Manager) UnmountVolume(volumeName, instanceName string) error
- type ManagerOptions
- type NetworkingResolver
- type PricingCache
- type PricingClient
- type RetryConfig
- type RetryMetrics
- type RetryTracker
- type RetryableOperation
- type SSMClientInterface
- type STSClientInterface
- type StateLoader
- type StateManagerInterface
- type TemplateConfigExtractor
- type UniversalAMIResolver
- func (r *UniversalAMIResolver) CreateAMIFromInstance(ctx context.Context, request *types.AMICreationRequest) (*types.AMICreationResult, error)
- func (r *UniversalAMIResolver) GetAMICreationStatus(ctx context.Context, amiID string) (*types.AMICreationResult, error)
- func (r *UniversalAMIResolver) ResolveAMI(ctx context.Context, template *templates.Template, region string) (*types.AMIResolutionResult, error)
- type UserDataProcessor
Constants ¶
const ( DocsURLBase = "https://docs.prism.org" DocsPermissions = DocsURLBase + "/troubleshooting/permissions" DocsSSHKeys = DocsURLBase + "/getting-started/ssh-keys" DocsConfiguration = DocsURLBase + "/troubleshooting/configuration" DocsCapacity = DocsURLBase + "/troubleshooting/capacity" DocsQuotas = DocsURLBase + "/troubleshooting/quotas" DocsStorage = DocsURLBase + "/storage/ebs" DocsNetworking = DocsURLBase + "/networking/vpc" DocsRateLimits = DocsURLBase + "/troubleshooting/rate-limits" DocsDryRun = DocsURLBase + "/cli/dry-run" DocsCompatibility = DocsURLBase + "/troubleshooting/compatibility" DocsTroubleshooting = DocsURLBase + "/troubleshooting" )
Common documentation links
Variables ¶
This section is empty.
Functions ¶
func EnhanceError ¶ added in v0.5.11
EnhanceError wraps an AWS error with actionable guidance
func ExponentialBackoff ¶ added in v0.5.11
func ExponentialBackoff(attempt int, initialDelay, maxDelay time.Duration, multiplier float64) time.Duration
ExponentialBackoff calculates the delay for a given attempt
func FormatFreshnessReport ¶
func FormatFreshnessReport(results []AMIFreshnessResult) string
FormatFreshnessReport generates a human-readable AMI freshness report
This can be displayed to users or logged for monitoring
func GetRecommendedUpdateFrequency ¶
GetRecommendedUpdateFrequency returns how often static AMI mappings should be updated
This helps with maintenance planning
func GetStaticAMILocations ¶
GetStaticAMILocations returns where to find current AMI IDs for manual updates
This is useful documentation for maintainers
func IsRetryable ¶ added in v0.5.11
IsRetryable returns true if the error is transient and should be retried
func WithRetry ¶ added in v0.5.11
func WithRetry(ctx context.Context, config *RetryConfig, operation RetryableOperation) error
WithRetry executes an operation with exponential backoff retry logic
func WithRetryAndTracking ¶ added in v0.5.11
func WithRetryAndTracking(ctx context.Context, config *RetryConfig, tracker *RetryTracker, operation RetryableOperation) error
WithRetryAndTracking executes an operation with retry logic and tracks metrics
Types ¶
type AMICache ¶
type AMICache struct {
// contains filtered or unexported fields
}
AMICache provides in-memory caching for AMI information to improve performance
func NewAMICache ¶
func NewAMICache() *AMICache
NewAMICache creates a new AMI cache with default configuration
func NewAMICacheWithConfig ¶
NewAMICacheWithConfig creates a new AMI cache with custom configuration
func (*AMICache) CleanupExpired ¶
CleanupExpired removes expired entries from the cache
func (*AMICache) ConfigureCache ¶
func (c *AMICache) ConfigureCache(config *AMICacheConfig)
ConfigureCache applies configuration to the cache
func (*AMICache) GetStats ¶
func (c *AMICache) GetStats() *AMICacheStats
GetStats returns cache statistics
func (*AMICache) InvalidateAMI ¶
InvalidateAMI removes AMI information from cache
func (*AMICache) InvalidateRegion ¶
InvalidateRegion removes all AMI information for a specific region
func (*AMICache) SetAMIWithTTL ¶
SetAMIWithTTL stores AMI information in cache with custom TTL
func (*AMICache) StartCleanupRoutine ¶
StartCleanupRoutine starts a background goroutine to periodically clean up expired entries
type AMICacheConfig ¶
type AMICacheConfig struct {
DefaultTTL time.Duration `json:"default_ttl"` // Default time-to-live for cached entries
MaxSize int `json:"max_size"` // Maximum number of cached entries
CleanupInterval time.Duration `json:"cleanup_interval"` // How often to clean up expired entries
}
AMICacheConfig represents cache configuration
type AMICacheStats ¶
type AMICacheStats struct {
Size int `json:"size"` // Current number of cached entries
MaxSize int `json:"max_size"` // Maximum cache size
Hits int64 `json:"hits"` // Cache hits
Misses int64 `json:"misses"` // Cache misses
HitRatio float64 `json:"hit_ratio"` // Hit ratio (0.0 to 1.0)
TTL time.Duration `json:"ttl"` // Default TTL
}
AMICacheStats represents cache statistics
type AMICostAnalyzer ¶
type AMICostAnalyzer struct {
// contains filtered or unexported fields
}
AMICostAnalyzer provides cost analysis for AMI vs script deployment strategies
func NewAMICostAnalyzer ¶
func NewAMICostAnalyzer() *AMICostAnalyzer
NewAMICostAnalyzer creates a new AMI cost analyzer with default pricing data
func (*AMICostAnalyzer) AnalyzeCosts ¶
func (a *AMICostAnalyzer) AnalyzeCosts(templateName, region string, amiInfo *types.AMIInfo, scriptTime time.Duration) *types.AMICostAnalysis
AnalyzeCosts performs comprehensive cost analysis for AMI vs script deployment
func (*AMICostAnalyzer) CalculateAMICost ¶
func (a *AMICostAnalyzer) CalculateAMICost(ami *types.AMIInfo, region string) float64
CalculateAMICost calculates the cost of using an AMI for deployment
func (*AMICostAnalyzer) CompareDeploymentCosts ¶
func (a *AMICostAnalyzer) CompareDeploymentCosts(strategies []string, duration float64, region string) map[string]float64
CompareDeploymentCosts compares costs between different deployment strategies
func (*AMICostAnalyzer) EstimateCrossRegionCost ¶
func (a *AMICostAnalyzer) EstimateCrossRegionCost(amiSize float64, sourceRegion, targetRegion string) float64
EstimateCrossRegionCost estimates the cost of copying an AMI across regions
func (*AMICostAnalyzer) GetOptimizedInstanceType ¶
func (a *AMICostAnalyzer) GetOptimizedInstanceType(templateDomain string, region string) (string, float64)
GetOptimizedInstanceType recommends the most cost-effective instance type for a template
type AMICreateParams ¶
type AMIDiscovery ¶
type AMIDiscovery struct {
// contains filtered or unexported fields
}
AMIDiscovery handles dynamic AMI discovery via AWS SSM Parameter Store
func NewAMIDiscovery ¶
func NewAMIDiscovery(ssmClient *ssm.Client) *AMIDiscovery
NewAMIDiscovery creates a new AMI discovery service
func (*AMIDiscovery) BulkDiscoverAMIs ¶
func (d *AMIDiscovery) BulkDiscoverAMIs(ctx context.Context, region string) (map[string]map[string]map[string]map[string]string, error)
BulkDiscoverAMIs discovers AMIs for multiple distro/version/arch combinations
This is useful for warming up the AMI cache at daemon startup ¶
Returns:
- Map of discovered AMIs: distro -> version -> region -> arch -> AMI
- Combinations not found in SSM are omitted (caller uses static fallback)
func (*AMIDiscovery) CheckAMIFreshness ¶
func (d *AMIDiscovery) CheckAMIFreshness(ctx context.Context, staticAMIs map[string]map[string]map[string]map[string]string, region string) ([]AMIFreshnessResult, error)
CheckAMIFreshness validates if static AMI IDs match the latest available AMIs
This should be run monthly (or when fallback is triggered) to ensure static AMI mappings are up-to-date. Returns a report of all outdated AMIs.
Parameters:
- staticAMIs: Map of static AMI IDs (distro → version → region → arch → AMI)
- region: AWS region to check
Returns:
- Slice of freshness results with update recommendations
- Error only for serious issues
func (*AMIDiscovery) GetAMIWithFallback ¶
func (d *AMIDiscovery) GetAMIWithFallback(ctx context.Context, distro, version, region, arch, staticFallback string) (string, string, error)
GetAMIWithFallback attempts dynamic discovery first, then falls back to static AMI
This is the primary method that should be used by the launch system ¶
Parameters:
- distro: Base OS distro
- version: OS version
- region: AWS region
- arch: Architecture
- staticFallback: Static AMI ID to use if discovery fails
Returns:
- AMI ID (from SSM or fallback)
- Source indicator ("ssm" or "static")
- Error only for serious issues
func (*AMIDiscovery) GetLatestAMI ¶
func (d *AMIDiscovery) GetLatestAMI(ctx context.Context, distro, version, region, arch string) (string, error)
GetLatestAMI queries AWS SSM Parameter Store for the latest AMI ID
Parameters:
- distro: Base OS distro (ubuntu, rocky, amazonlinux, alpine, rhel, debian)
- version: OS version (24.04, 22.04, 9, 10, 2023, etc.)
- region: AWS region (us-east-1, us-west-2, etc.)
- arch: Architecture (x86_64 or arm64)
Returns:
- AMI ID if found
- Empty string if not found (caller should use static fallback)
- Error only for serious issues (network failures, etc.)
func (*AMIDiscovery) GetSSMParameterPaths ¶
func (d *AMIDiscovery) GetSSMParameterPaths() map[string][]string
GetSSMParameterPaths returns all SSM parameter paths that Prism queries
This is useful for documentation and debugging
func (*AMIDiscovery) ValidateAMI ¶
ValidateAMI checks if an AMI exists and is accessible in the specified region
This is useful for validating static AMI mappings
type AMIFreshnessResult ¶
type AMIFreshnessResult struct {
Distro string
Version string
Region string
Arch string
StaticAMI string
LatestAMI string
IsOutdated bool
NeedsUpdate bool
HasSSMSupport bool
CheckTimestamp string
}
AMIFreshnessResult contains the result of an AMI freshness check
func GetOutdatedAMIs ¶
func GetOutdatedAMIs(results []AMIFreshnessResult) []AMIFreshnessResult
GetOutdatedAMIs returns only the AMIs that need updating
Convenience method to filter freshness check results
type AMISearchCriteria ¶
type AMISearchCriteria struct {
Owner string
NamePattern string
Region string
Architecture []string
RequiredTags map[string]string
}
AMISearchCriteria defines search criteria for dynamic AMI discovery
type AMIStatusInfo ¶
type AMIStatusInfo struct {
State string
Status types.AMICreationStatus
ElapsedTime time.Duration
}
type EC2ClientInterface ¶
type EC2ClientInterface interface {
RunInstances(ctx context.Context, params *ec2.RunInstancesInput, optFns ...func(*ec2.Options)) (*ec2.RunInstancesOutput, error)
DescribeInstances(ctx context.Context, params *ec2.DescribeInstancesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeInstancesOutput, error)
TerminateInstances(ctx context.Context, params *ec2.TerminateInstancesInput, optFns ...func(*ec2.Options)) (*ec2.TerminateInstancesOutput, error)
CreateImage(ctx context.Context, params *ec2.CreateImageInput, optFns ...func(*ec2.Options)) (*ec2.CreateImageOutput, error)
DescribeImages(ctx context.Context, params *ec2.DescribeImagesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeImagesOutput, error)
CopyImage(ctx context.Context, params *ec2.CopyImageInput, optFns ...func(*ec2.Options)) (*ec2.CopyImageOutput, error)
DescribeSecurityGroups(ctx context.Context, params *ec2.DescribeSecurityGroupsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeSecurityGroupsOutput, error)
CreateSecurityGroup(ctx context.Context, params *ec2.CreateSecurityGroupInput, optFns ...func(*ec2.Options)) (*ec2.CreateSecurityGroupOutput, error)
AuthorizeSecurityGroupIngress(ctx context.Context, params *ec2.AuthorizeSecurityGroupIngressInput, optFns ...func(*ec2.Options)) (*ec2.AuthorizeSecurityGroupIngressOutput, error)
DescribeVpcs(ctx context.Context, params *ec2.DescribeVpcsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeVpcsOutput, error)
DescribeSubnets(ctx context.Context, params *ec2.DescribeSubnetsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeSubnetsOutput, error)
DescribeRouteTables(ctx context.Context, params *ec2.DescribeRouteTablesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeRouteTablesOutput, error)
StartInstances(ctx context.Context, params *ec2.StartInstancesInput, optFns ...func(*ec2.Options)) (*ec2.StartInstancesOutput, error)
StopInstances(ctx context.Context, params *ec2.StopInstancesInput, optFns ...func(*ec2.Options)) (*ec2.StopInstancesOutput, error)
ModifyInstanceAttribute(ctx context.Context, params *ec2.ModifyInstanceAttributeInput, optFns ...func(*ec2.Options)) (*ec2.ModifyInstanceAttributeOutput, error)
CreateVolume(ctx context.Context, params *ec2.CreateVolumeInput, optFns ...func(*ec2.Options)) (*ec2.CreateVolumeOutput, error)
DeleteVolume(ctx context.Context, params *ec2.DeleteVolumeInput, optFns ...func(*ec2.Options)) (*ec2.DeleteVolumeOutput, error)
DescribeVolumes(ctx context.Context, params *ec2.DescribeVolumesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeVolumesOutput, error)
AttachVolume(ctx context.Context, params *ec2.AttachVolumeInput, optFns ...func(*ec2.Options)) (*ec2.AttachVolumeOutput, error)
DetachVolume(ctx context.Context, params *ec2.DetachVolumeInput, optFns ...func(*ec2.Options)) (*ec2.DetachVolumeOutput, error)
DescribeKeyPairs(ctx context.Context, params *ec2.DescribeKeyPairsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeKeyPairsOutput, error)
ImportKeyPair(ctx context.Context, params *ec2.ImportKeyPairInput, optFns ...func(*ec2.Options)) (*ec2.ImportKeyPairOutput, error)
DeleteKeyPair(ctx context.Context, params *ec2.DeleteKeyPairInput, optFns ...func(*ec2.Options)) (*ec2.DeleteKeyPairOutput, error)
GetConsoleOutput(ctx context.Context, params *ec2.GetConsoleOutputInput, optFns ...func(*ec2.Options)) (*ec2.GetConsoleOutputOutput, error)
DeregisterImage(ctx context.Context, params *ec2.DeregisterImageInput, optFns ...func(*ec2.Options)) (*ec2.DeregisterImageOutput, error)
DeleteSnapshot(ctx context.Context, params *ec2.DeleteSnapshotInput, optFns ...func(*ec2.Options)) (*ec2.DeleteSnapshotOutput, error)
DescribeSnapshots(ctx context.Context, params *ec2.DescribeSnapshotsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeSnapshotsOutput, error)
ModifyImageAttribute(ctx context.Context, params *ec2.ModifyImageAttributeInput, optFns ...func(*ec2.Options)) (*ec2.ModifyImageAttributeOutput, error)
CreateTags(ctx context.Context, params *ec2.CreateTagsInput, optFns ...func(*ec2.Options)) (*ec2.CreateTagsOutput, error)
DescribeInstanceTypes(ctx context.Context, params *ec2.DescribeInstanceTypesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeInstanceTypesOutput, error)
DescribeInstanceTypeOfferings(ctx context.Context, params *ec2.DescribeInstanceTypeOfferingsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeInstanceTypeOfferingsOutput, error)
DescribeInstanceStatus(ctx context.Context, params *ec2.DescribeInstanceStatusInput, optFns ...func(*ec2.Options)) (*ec2.DescribeInstanceStatusOutput, error)
}
EC2ClientInterface defines the interface for EC2 client operations.
type EFSClientInterface ¶
type EFSClientInterface interface {
DescribeMountTargets(ctx context.Context, params *efs.DescribeMountTargetsInput, optFns ...func(*efs.Options)) (*efs.DescribeMountTargetsOutput, error)
DeleteMountTarget(ctx context.Context, params *efs.DeleteMountTargetInput, optFns ...func(*efs.Options)) (*efs.DeleteMountTargetOutput, error)
DeleteFileSystem(ctx context.Context, params *efs.DeleteFileSystemInput, optFns ...func(*efs.Options)) (*efs.DeleteFileSystemOutput, error)
CreateFileSystem(ctx context.Context, params *efs.CreateFileSystemInput, optFns ...func(*efs.Options)) (*efs.CreateFileSystemOutput, error)
DescribeFileSystems(ctx context.Context, params *efs.DescribeFileSystemsInput, optFns ...func(*efs.Options)) (*efs.DescribeFileSystemsOutput, error)
}
EFSClientInterface defines the interface for EFS client operations.
type EnhancedError ¶ added in v0.5.11
type EnhancedError struct {
OriginalError error
Operation string // e.g., "launch instance", "start instance"
Suggestions []string
DocsLink string
Category string // e.g., "permissions", "quota", "configuration"
}
EnhancedError wraps an AWS error with actionable guidance
func (*EnhancedError) Error ¶ added in v0.5.11
func (e *EnhancedError) Error() string
type InstanceBuilder ¶
type InstanceBuilder struct {
// contains filtered or unexported fields
}
InstanceBuilder builds Prism instance objects (Builder Pattern - SOLID)
func NewInstanceBuilder ¶
func NewInstanceBuilder(ec2Client EC2ClientInterface, pricingClient *PricingClient, region string) *InstanceBuilder
NewInstanceBuilder creates instance builder
func (*InstanceBuilder) BuildInstance ¶
func (b *InstanceBuilder) BuildInstance(ec2Instance ec2types.Instance, localState *ctypes.State) *ctypes.Instance
BuildInstance creates Prism instance from EC2 instance
type InstanceConfigBuilder ¶
type InstanceConfigBuilder struct {
// contains filtered or unexported fields
}
InstanceConfigBuilder builds EC2 RunInstances configuration (Builder Pattern - SOLID)
func (*InstanceConfigBuilder) BuildRunInstancesInput ¶
func (b *InstanceConfigBuilder) BuildRunInstancesInput(req ctypes.LaunchRequest, ami, instanceType, userDataEncoded, subnetID, securityGroupID, primaryUsername string) (*ec2.RunInstancesInput, error)
BuildRunInstancesInput creates configured RunInstancesInput
type InstanceLauncher ¶
type InstanceLauncher struct {
// contains filtered or unexported fields
}
InstanceLauncher executes the actual instance launch (Single Responsibility - SOLID)
func (*InstanceLauncher) LaunchInstance ¶
func (l *InstanceLauncher) LaunchInstance(req ctypes.LaunchRequest, runInput *ec2.RunInstancesInput, hourlyRate float64, template *ctypes.RuntimeTemplate, primaryUsername string) (*ctypes.Instance, error)
LaunchInstance orchestrates instance launch with extracted helper methods
type InstanceListProcessor ¶
type InstanceListProcessor struct {
// contains filtered or unexported fields
}
InstanceListProcessor processes EC2 reservations into Prism instances (Strategy Pattern - SOLID)
func NewInstanceListProcessor ¶
func NewInstanceListProcessor(ec2Client EC2ClientInterface, pricingClient *PricingClient, region string) *InstanceListProcessor
NewInstanceListProcessor creates instance list processor
func (*InstanceListProcessor) ProcessReservations ¶
func (p *InstanceListProcessor) ProcessReservations(reservations []ec2types.Reservation) []ctypes.Instance
ProcessReservations converts EC2 reservations to Prism instances
type InstanceStateConverter ¶
type InstanceStateConverter struct{}
InstanceStateConverter converts AWS states to Prism states (Single Responsibility - SOLID)
func (*InstanceStateConverter) ConvertState ¶
func (c *InstanceStateConverter) ConvertState(ec2Instance ec2types.Instance) string
ConvertState converts EC2 instance state to Prism state
type InstanceTagExtractor ¶
type InstanceTagExtractor struct{}
InstanceTagExtractor extracts tags from EC2 instances (Single Responsibility - SOLID)
func (*InstanceTagExtractor) ExtractTags ¶
func (e *InstanceTagExtractor) ExtractTags(ec2Instance ec2types.Instance) (name, template, project string)
ExtractTags extracts Prism-specific tags from EC2 instance
type LaunchOptionsProcessor ¶
type LaunchOptionsProcessor struct {
// contains filtered or unexported fields
}
LaunchOptionsProcessor processes hibernation and spot options (Strategy Pattern - SOLID)
func (*LaunchOptionsProcessor) ProcessOptions ¶
func (p *LaunchOptionsProcessor) ProcessOptions(req ctypes.LaunchRequest, runInput *ec2.RunInstancesInput, ami, instanceType string, rootVolumeGB int) error
ProcessOptions validates and applies hibernation/spot options
type LaunchOrchestrator ¶
type LaunchOrchestrator struct {
// contains filtered or unexported fields
}
LaunchOrchestrator coordinates instance launch using SOLID principles (Strategy Pattern - SOLID)
func NewLaunchOrchestrator ¶
func NewLaunchOrchestrator(manager *Manager, region string) *LaunchOrchestrator
NewLaunchOrchestrator creates launch orchestrator
func (*LaunchOrchestrator) ExecuteLaunch ¶
func (o *LaunchOrchestrator) ExecuteLaunch(req ctypes.LaunchRequest, template *ctypes.RuntimeTemplate, arch, primaryUsername string) (*ctypes.Instance, error)
ExecuteLaunch performs complete instance launch using SOLID strategy pattern
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles all AWS operations
func NewManager ¶
func NewManager(opts ...ManagerOptions) (*Manager, error)
NewManager creates a new AWS manager
func (*Manager) ApplyHibernationPolicy ¶
ApplyHibernationPolicy applies a hibernation policy template to an instance
func (*Manager) AttachStorage ¶
AttachStorage attaches an EBS volume to an instance
func (*Manager) CheckAMIFreshness ¶
func (m *Manager) CheckAMIFreshness(ctx context.Context, staticAMIs map[string]map[string]map[string]map[string]string) ([]AMIFreshnessResult, error)
CheckAMIFreshness validates static AMI IDs against latest SSM values (v0.5.4)
func (*Manager) CleanupOldAMIs ¶
CleanupOldAMIs removes old and unused AMIs
func (*Manager) CreateAMIFromInstance ¶
func (m *Manager) CreateAMIFromInstance(request *types.AMICreationRequest) (*types.AMICreationResult, error)
CreateAMIFromInstance creates an AMI from a running instance
func (*Manager) CreateInstanceAMISnapshot ¶
func (m *Manager) CreateInstanceAMISnapshot(instanceName, snapshotName, description string, noReboot bool) (*ctypes.InstanceSnapshotResult, error)
CreateInstanceAMISnapshot creates an AMI snapshot from a Prism instance
func (*Manager) CreateInstanceSnapshot ¶
func (m *Manager) CreateInstanceSnapshot(instanceID, description string, noReboot bool) (*types.SnapshotCreationResult, error)
CreateInstanceSnapshot creates a snapshot from an instance
func (*Manager) CreateS3Client ¶ added in v0.5.7
CreateS3Client creates a new S3 client using the manager's AWS config (v0.5.7)
func (*Manager) CreateStorage ¶
func (m *Manager) CreateStorage(req ctypes.StorageCreateRequest) (*ctypes.StorageVolume, error)
CreateStorage creates a new EBS volume
func (*Manager) CreateVolume ¶
func (m *Manager) CreateVolume(req ctypes.VolumeCreateRequest) (*ctypes.StorageVolume, error)
CreateVolume creates a new EFS volume
func (*Manager) DeleteInstance ¶
DeleteInstance terminates an EC2 instance
func (*Manager) DeleteInstanceSnapshot ¶
func (m *Manager) DeleteInstanceSnapshot(snapshotName string) (*ctypes.InstanceSnapshotDeleteResult, error)
DeleteInstanceSnapshot deletes a Prism instance snapshot (AMI)
func (*Manager) DeleteKeyPair ¶
DeleteKeyPair deletes an SSH key pair from AWS
func (*Manager) DeleteSnapshot ¶
func (m *Manager) DeleteSnapshot(snapshotID string) (*types.SnapshotDeletionResult, error)
DeleteSnapshot deletes a specific snapshot
func (*Manager) DeleteStorage ¶
DeleteStorage deletes an EBS volume
func (*Manager) DeleteVolume ¶
DeleteVolume deletes an EFS volume
func (*Manager) DetachStorage ¶
DetachStorage detaches an EBS volume from an instance
func (*Manager) DiscoverDefaultVPC ¶
DiscoverDefaultVPC finds the default VPC in the current region
func (*Manager) DiscoverPublicSubnet ¶
DiscoverPublicSubnet finds a public subnet (legacy method, kept for fallback)
func (*Manager) DiscoverPublicSubnetForInstanceType ¶
DiscoverPublicSubnet finds a public subnet in the specified VPC DiscoverPublicSubnetForInstanceType finds a public subnet that supports the specified instance type This prevents launch failures due to instance type not being available in a randomly selected AZ
func (*Manager) EnsureKeyPairExists ¶
EnsureKeyPairExists ensures the SSH key pair exists in AWS, creating it if necessary
func (*Manager) ExecuteCommand ¶
func (m *Manager) ExecuteCommand(instanceName string, execRequest ctypes.ExecRequest) (*ctypes.ExecResult, error)
ExecuteCommand executes a command on an instance via SSM
func (*Manager) GetAMICostAnalysis ¶
func (m *Manager) GetAMICostAnalysis(templateName string) (*types.AMICostAnalysis, error)
GetAMICostAnalysis provides cost analysis for AMI vs script deployment
func (*Manager) GetAMICreationStatus ¶
func (m *Manager) GetAMICreationStatus(creationID string) (*types.AMICreationResult, error)
GetAMICreationStatus checks the status of AMI creation
func (*Manager) GetAWSConfig ¶
GetAWSConfig returns the AWS config for creating additional service clients
func (*Manager) GetAvailableLogTypes ¶
GetAvailableLogTypes returns the available log types that can be retrieved
func (*Manager) GetBillingInfo ¶
func (m *Manager) GetBillingInfo() (*ctypes.BillingInfo, error)
GetBillingInfo retrieves current billing and credit information
func (*Manager) GetConnectionInfo ¶
GetConnectionInfo returns connection information for an instance with SSH key path
func (*Manager) GetDefaultRegion ¶
GetDefaultRegion returns the default AWS region
func (*Manager) GetDiscountConfig ¶
func (m *Manager) GetDiscountConfig() ctypes.DiscountConfig
GetDiscountConfig returns the current discount configuration
func (*Manager) GetIdlePolicy ¶
func (m *Manager) GetIdlePolicy(policyID string) (*idle.PolicyTemplate, error)
GetIdlePolicy gets a specific idle policy template
func (*Manager) GetIdleScheduler ¶
GetIdleScheduler returns the idle scheduler for direct access
func (*Manager) GetInstance ¶
GetInstance retrieves real-time information for a specific instance from AWS
func (*Manager) GetInstanceConsoleOutput ¶
GetInstanceConsoleOutput retrieves console output logs from an EC2 instance
func (*Manager) GetInstanceHibernationStatus ¶
GetInstanceHibernationStatus returns hibernation support, current state, and whether it might be hibernated
func (*Manager) GetInstancePolicies ¶
func (m *Manager) GetInstancePolicies(instanceName string) ([]*idle.PolicyTemplate, error)
GetInstancePolicies returns the idle policies applied to an instance
func (*Manager) GetInstanceSnapshotInfo ¶
func (m *Manager) GetInstanceSnapshotInfo(snapshotName string) (*ctypes.InstanceSnapshotInfo, error)
GetInstanceSnapshotInfo gets detailed information about a specific snapshot
func (*Manager) GetInstanceSystemLogs ¶
GetInstanceSystemLogs retrieves system logs via SSM (Systems Manager)
func (*Manager) GetOrCreatePrismSecurityGroup ¶
GetOrCreatePrismSecurityGroup creates or finds the Prism security group
func (*Manager) GetPolicyManager ¶
func (m *Manager) GetPolicyManager() *idle.PolicyManager
GetPolicyManager returns the policy manager for direct access
func (*Manager) GetTemplate ¶
GetTemplate returns a specific template
func (*Manager) GetTemplates ¶
GetTemplates returns all available templates
func (*Manager) HibernateInstance ¶
HibernateInstance hibernates (pauses) a running EC2 instance This preserves the RAM state to storage for faster resume than regular stop/start
func (*Manager) LaunchInstance ¶
LaunchInstance launches a new EC2 instance
func (*Manager) LaunchInstanceWithAMI ¶
LaunchInstanceWithAMI launches an instance using AMI resolution
func (*Manager) ListAMISnapshots ¶
func (m *Manager) ListAMISnapshots(instanceID, maxAge string) ([]types.SnapshotInfo, error)
ListAMISnapshots lists available snapshots
func (*Manager) ListIdlePolicies ¶
func (m *Manager) ListIdlePolicies() []*idle.PolicyTemplate
ListHibernationPolicies returns all available hibernation policy templates
func (*Manager) ListInstanceSnapshots ¶
func (m *Manager) ListInstanceSnapshots() ([]ctypes.InstanceSnapshotInfo, error)
ListInstanceSnapshots lists all Prism instance snapshots (AMIs)
func (*Manager) ListInstances ¶
ListInstances returns all Prism instances using Strategy Pattern (SOLID: Single Responsibility)
func (*Manager) ListPrismKeyPairs ¶
ListPrismKeyPairs lists all SSH key pairs managed by Prism
func (*Manager) ListUserAMIs ¶
ListUserAMIs lists AMIs created by the user
func (*Manager) MountVolume ¶
MountVolume mounts an EFS volume to an instance
func (*Manager) PreviewAMIResolution ¶
func (m *Manager) PreviewAMIResolution(templateName string) (*types.AMIResolutionResult, error)
PreviewAMIResolution shows what would happen during AMI resolution without actually resolving
func (*Manager) PublishAMIToCommunity ¶
PublishAMIToCommunity makes an AMI available to the community
func (*Manager) RecommendIdlePolicy ¶
func (m *Manager) RecommendIdlePolicy(instanceName string) (*idle.PolicyTemplate, error)
RecommendIdlePolicy recommends an idle policy based on instance characteristics
func (*Manager) RemoveHibernationPolicy ¶
RemoveHibernationPolicy removes a hibernation policy from an instance
func (*Manager) ResizeInstance ¶
func (m *Manager) ResizeInstance(resizeRequest ctypes.ResizeRequest) (*ctypes.ResizeResponse, error)
ResizeInstance orchestrates instance resize with extracted helper methods
func (*Manager) ResolveAMIForTemplate ¶
func (m *Manager) ResolveAMIForTemplate(templateName string) (*types.AMIResolutionResult, error)
ResolveAMIForTemplate resolves AMI information for a template using the Universal AMI System
func (*Manager) RestoreAMIFromSnapshot ¶
func (m *Manager) RestoreAMIFromSnapshot(snapshotID, name, description, architecture string) (*types.AMIRestoreResult, error)
RestoreAMIFromSnapshot creates an AMI from a snapshot
func (*Manager) RestoreInstanceFromSnapshot ¶
func (m *Manager) RestoreInstanceFromSnapshot(snapshotName, newInstanceName string) (*ctypes.InstanceRestoreResult, error)
RestoreInstanceFromSnapshot launches a new instance from a snapshot
func (*Manager) ResumeInstance ¶
ResumeInstance resumes a hibernated instance (same as StartInstance for hibernated instances)
func (*Manager) SetDiscountConfig ¶
func (m *Manager) SetDiscountConfig(config ctypes.DiscountConfig)
SetDiscountConfig configures pricing discounts for various AWS services
func (*Manager) StartInstance ¶
StartInstance starts a stopped EC2 instance
func (*Manager) StopInstance ¶
StopInstance stops a running EC2 instance
func (*Manager) TestAMIAvailability ¶
func (m *Manager) TestAMIAvailability(templateName string, regions []string) (*types.AMITestResult, error)
TestAMIAvailability tests AMI availability for a template across regions
func (*Manager) UnmountVolume ¶
UnmountVolume unmounts an EFS volume from an instance
type ManagerOptions ¶
ManagerOptions contains optional parameters for creating a new Manager
type NetworkingResolver ¶
type NetworkingResolver struct {
// contains filtered or unexported fields
}
NetworkingResolver resolves VPC, subnet, and security group (Single Responsibility - SOLID)
func (*NetworkingResolver) ResolveNetworking ¶
func (n *NetworkingResolver) ResolveNetworking(req ctypes.LaunchRequest, instanceType string) (string, string, string, error)
ResolveNetworking determines VPC, subnet, and security group for launch
type PricingCache ¶
type PricingCache struct {
// contains filtered or unexported fields
}
PricingCache caches AWS pricing data to avoid repeated API calls
func NewPricingCache ¶
func NewPricingCache() *PricingCache
NewPricingCache creates a new pricing cache with 24-hour TTL
func (*PricingCache) Get ¶
func (c *PricingCache) Get(region, instanceType string) (float64, bool)
Get retrieves a cached price if available and not expired
func (*PricingCache) Set ¶
func (c *PricingCache) Set(region, instanceType string, price float64)
Set stores a price in the cache
type PricingClient ¶
type PricingClient struct {
// contains filtered or unexported fields
}
PricingClient wraps AWS Pricing API with caching
func NewPricingClient ¶
func NewPricingClient(cfg aws.Config) *PricingClient
NewPricingClient creates a new pricing client with the given AWS config
func (*PricingClient) GetEBSVolumeHourlyRate ¶
func (p *PricingClient) GetEBSVolumeHourlyRate(volumeType string, sizeGB int) float64
GetEBSVolumeHourlyRate calculates the hourly cost for an EBS volume
func (*PricingClient) GetInstanceHourlyRate ¶
func (p *PricingClient) GetInstanceHourlyRate(ctx context.Context, region, instanceType string) (float64, error)
GetInstanceHourlyRate fetches the on-demand hourly rate for an instance type in a region
type RetryConfig ¶ added in v0.5.11
type RetryConfig struct {
MaxAttempts int // Maximum number of retry attempts (default: 3)
InitialDelay time.Duration // Initial delay before first retry (default: 1s)
MaxDelay time.Duration // Maximum delay between retries (default: 30s)
Multiplier float64 // Exponential backoff multiplier (default: 2.0)
JitterFraction float64 // Jitter as fraction of delay (default: 0.1 = 10%)
RetryableErrors []string // Additional retryable error patterns
}
RetryConfig configures retry behavior for AWS operations
func DefaultRetryConfig ¶ added in v0.5.11
func DefaultRetryConfig() *RetryConfig
DefaultRetryConfig returns the default retry configuration
type RetryMetrics ¶ added in v0.5.11
type RetryMetrics struct {
TotalOperations int
SuccessfulRetries int
FailedRetries int
AverageAttempts float64
}
RetryMetrics tracks retry statistics
type RetryTracker ¶ added in v0.5.11
type RetryTracker struct {
// contains filtered or unexported fields
}
RetryTracker tracks retry metrics for monitoring
func NewRetryTracker ¶ added in v0.5.11
func NewRetryTracker() *RetryTracker
NewRetryTracker creates a new retry tracker
func (*RetryTracker) GetMetrics ¶ added in v0.5.11
func (t *RetryTracker) GetMetrics() RetryMetrics
GetMetrics returns current retry metrics
func (*RetryTracker) RecordFailure ¶ added in v0.5.11
func (t *RetryTracker) RecordFailure(attempts int)
RecordFailure records a failed operation (after all retries exhausted)
func (*RetryTracker) RecordSuccess ¶ added in v0.5.11
func (t *RetryTracker) RecordSuccess(attempts int)
RecordSuccess records a successful operation (with retry count)
type RetryableOperation ¶ added in v0.5.11
RetryableOperation is a function that can be retried
type SSMClientInterface ¶
type SSMClientInterface interface {
SendCommand(ctx context.Context, params *ssm.SendCommandInput, optFns ...func(*ssm.Options)) (*ssm.SendCommandOutput, error)
GetCommandInvocation(ctx context.Context, params *ssm.GetCommandInvocationInput, optFns ...func(*ssm.Options)) (*ssm.GetCommandInvocationOutput, error)
DescribeInstanceInformation(ctx context.Context, params *ssm.DescribeInstanceInformationInput, optFns ...func(*ssm.Options)) (*ssm.DescribeInstanceInformationOutput, error)
PutParameter(ctx context.Context, params *ssm.PutParameterInput, optFns ...func(*ssm.Options)) (*ssm.PutParameterOutput, error)
GetParameter(ctx context.Context, params *ssm.GetParameterInput, optFns ...func(*ssm.Options)) (*ssm.GetParameterOutput, error)
DeleteParameter(ctx context.Context, params *ssm.DeleteParameterInput, optFns ...func(*ssm.Options)) (*ssm.DeleteParameterOutput, error)
GetParametersByPath(ctx context.Context, params *ssm.GetParametersByPathInput, optFns ...func(*ssm.Options)) (*ssm.GetParametersByPathOutput, error)
}
SSMClientInterface defines the interface for SSM client operations.
type STSClientInterface ¶
type STSClientInterface interface {
GetCallerIdentity(ctx context.Context, params *sts.GetCallerIdentityInput, optFns ...func(*sts.Options)) (*sts.GetCallerIdentityOutput, error)
}
STSClientInterface defines the interface for STS client operations.
type StateLoader ¶
type StateLoader struct{}
StateLoader loads local state for instance merging (Single Responsibility - SOLID)
func (*StateLoader) LoadLocalState ¶
func (l *StateLoader) LoadLocalState() *ctypes.State
LoadLocalState attempts to load local state for deletion timestamp merging
type StateManagerInterface ¶
type StateManagerInterface interface {
LoadState() (*types.State, error)
SaveState(*types.State) error
SaveInstance(types.Instance) error
RemoveInstance(string) error
SaveStorageVolume(types.StorageVolume) error
RemoveStorageVolume(string) error
UpdateConfig(types.Config) error
}
StateManagerInterface defines the interface for state operations.
type TemplateConfigExtractor ¶
type TemplateConfigExtractor struct {
// contains filtered or unexported fields
}
TemplateConfigExtractor extracts configuration from unified template (Single Responsibility - SOLID)
func (*TemplateConfigExtractor) ExtractConfig ¶
func (e *TemplateConfigExtractor) ExtractConfig(template *ctypes.RuntimeTemplate, arch string) (string, string, float64, error)
ExtractConfig extracts AMI, instance type, and cost from template
type UniversalAMIResolver ¶
type UniversalAMIResolver struct {
// contains filtered or unexported fields
}
UniversalAMIResolver implements multi-tier AMI resolution for Prism templates
func NewUniversalAMIResolver ¶
func NewUniversalAMIResolver(ec2Client EC2ClientInterface) *UniversalAMIResolver
NewUniversalAMIResolver creates a new Universal AMI resolver
func (*UniversalAMIResolver) CreateAMIFromInstance ¶
func (r *UniversalAMIResolver) CreateAMIFromInstance(ctx context.Context, request *types.AMICreationRequest) (*types.AMICreationResult, error)
CreateAMIFromInstance creates an AMI from a running instance
func (*UniversalAMIResolver) GetAMICreationStatus ¶
func (r *UniversalAMIResolver) GetAMICreationStatus(ctx context.Context, amiID string) (*types.AMICreationResult, error)
GetAMICreationStatus checks the status of AMI creation
func (*UniversalAMIResolver) ResolveAMI ¶
func (r *UniversalAMIResolver) ResolveAMI(ctx context.Context, template *templates.Template, region string) (*types.AMIResolutionResult, error)
ResolveAMI performs multi-tier AMI resolution for a template in a specific region
type UserDataProcessor ¶
type UserDataProcessor struct {
// contains filtered or unexported fields
}
UserDataProcessor processes and configures user data (Single Responsibility - SOLID)
func (*UserDataProcessor) ProcessUserData ¶
func (p *UserDataProcessor) ProcessUserData(template *ctypes.RuntimeTemplate, req ctypes.LaunchRequest) string
ProcessUserData configures and encodes user data for instance launch