aws

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSConfig

type AWSConfig struct {
	Region          string `json:"region" yaml:"region"`
	AccessKeyID     string `json:"access_key_id" yaml:"access_key_id"`
	SecretAccessKey string `json:"secret_access_key" yaml:"secret_access_key"`
	// TODO: implement IAM role assumption via STS AssumeRole for cross-account access.
	RoleARN    string `json:"role_arn" yaml:"role_arn"`
	ECSCluster string `json:"ecs_cluster" yaml:"ecs_cluster"`
	EKSCluster string `json:"eks_cluster" yaml:"eks_cluster"`
	Service    string `json:"service" yaml:"service"`
}

AWSConfig holds configuration for the AWS cloud provider.

type AWSProvider

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

AWSProvider implements CloudProvider for Amazon Web Services.

func NewAWSProvider

func NewAWSProvider(config AWSConfig) *AWSProvider

NewAWSProvider creates a new AWSProvider with the given configuration. AWS SDK clients are initialized lazily from the config on first use.

func NewAWSProviderWithClients added in v0.1.5

func NewAWSProviderWithClients(config AWSConfig, ecsClient ECSClient, eksClient EKSClientIface, cwClient CloudWatchClient) *AWSProvider

NewAWSProviderWithClients creates an AWSProvider with pre-built clients (useful for testing).

func (*AWSProvider) Dependencies

func (p *AWSProvider) Dependencies() []plugin.PluginDependency

func (*AWSProvider) Deploy

func (*AWSProvider) Description

func (p *AWSProvider) Description() string

func (*AWSProvider) GetDeploymentStatus

func (p *AWSProvider) GetDeploymentStatus(ctx context.Context, deployID string) (*provider.DeployStatus, error)

GetDeploymentStatus returns the current status of an ECS service deployment. The deployID must be in the format "<serviceARN>|<taskDefARN>" (as returned by Deploy). EKS deploy IDs (prefix "eks:") return a static pending status.

func (*AWSProvider) GetMetrics

func (p *AWSProvider) GetMetrics(ctx context.Context, deployID string, window time.Duration) (*provider.Metrics, error)

GetMetrics fetches CPU and memory utilisation for an ECS service from CloudWatch. The deployID must be in the format "<serviceARN>|<taskDefARN>". EKS deploy IDs are not supported; use a dedicated EKS metrics integration instead.

func (*AWSProvider) ListImages

func (p *AWSProvider) ListImages(ctx context.Context, repo string) ([]provider.ImageTag, error)

ListImages lists container images in an Amazon ECR repository.

func (*AWSProvider) Name

func (p *AWSProvider) Name() string

func (*AWSProvider) OnDisable

func (p *AWSProvider) OnDisable(_ plugin.PluginContext) error

func (*AWSProvider) OnEnable

func (p *AWSProvider) OnEnable(_ plugin.PluginContext) error

func (*AWSProvider) PullImage

func (p *AWSProvider) PullImage(ctx context.Context, image string, auth provider.RegistryAuth) error

PullImage pulls a container image from Amazon ECR.

func (*AWSProvider) PushImage

func (p *AWSProvider) PushImage(ctx context.Context, image string, auth provider.RegistryAuth) error

PushImage pushes a container image to Amazon ECR.

func (*AWSProvider) RegisterRoutes

func (p *AWSProvider) RegisterRoutes(mux *http.ServeMux)

func (*AWSProvider) Rollback

func (p *AWSProvider) Rollback(ctx context.Context, deployID string) error

Rollback reverts an ECS service to the previous task definition revision. The deployID must be in the format "<serviceARN>|<taskDefARN>".

func (*AWSProvider) TestConnection

func (p *AWSProvider) TestConnection(ctx context.Context, config map[string]any) (*provider.ConnectionResult, error)

TestConnection verifies connectivity to the configured ECS cluster.

func (*AWSProvider) UIPages

func (p *AWSProvider) UIPages() []plugin.UIPageDef

func (*AWSProvider) Version

func (p *AWSProvider) Version() string

type CloudWatchClient added in v0.1.5

type CloudWatchClient interface {
	GetMetricData(ctx context.Context, params *cloudwatch.GetMetricDataInput, optFns ...func(*cloudwatch.Options)) (*cloudwatch.GetMetricDataOutput, error)
}

CloudWatchClient defines the CloudWatch operations used by AWSProvider.

type ECSClient added in v0.1.5

type ECSClient interface {
	RegisterTaskDefinition(ctx context.Context, params *ecs.RegisterTaskDefinitionInput, optFns ...func(*ecs.Options)) (*ecs.RegisterTaskDefinitionOutput, error)
	UpdateService(ctx context.Context, params *ecs.UpdateServiceInput, optFns ...func(*ecs.Options)) (*ecs.UpdateServiceOutput, error)
	DescribeServices(ctx context.Context, params *ecs.DescribeServicesInput, optFns ...func(*ecs.Options)) (*ecs.DescribeServicesOutput, error)
	DescribeClusters(ctx context.Context, params *ecs.DescribeClustersInput, optFns ...func(*ecs.Options)) (*ecs.DescribeClustersOutput, error)
	DescribeTaskDefinition(ctx context.Context, params *ecs.DescribeTaskDefinitionInput, optFns ...func(*ecs.Options)) (*ecs.DescribeTaskDefinitionOutput, error)
}

ECSClient defines the ECS operations used by AWSProvider.

type EKSClientIface added in v0.1.5

type EKSClientIface interface {
	DescribeCluster(ctx context.Context, params *eks.DescribeClusterInput, optFns ...func(*eks.Options)) (*eks.DescribeClusterOutput, error)
}

EKSClientIface defines the EKS operations used by AWSProvider.

Jump to

Keyboard shortcuts

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