awscloud

package
v0.244.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: Apache-2.0 Imports: 24 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

S3PermissionsMatrix Maps a requested permission to all permissions that are sufficient for the requested one

Functions

func NewUploader added in v0.40.2

func NewUploader(region, bucketName, imageName string, opts *UploaderOptions) (cloud.Uploader, error)

Types

type AWS

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

func New

func New(region string, accessKeyID string, accessKey string, sessionToken string) (*AWS, error)

Initialize a new AWS object from individual bits. SessionToken is optional

func NewDefault

func NewDefault(region string, profile string) (*AWS, error)

Initialize a new AWS object from defaults. Looks for env variables, shared credential file, and EC2 Instance Roles.

func NewForEndpoint

func NewForEndpoint(endpoint, region, accessKeyID, accessKey, sessionToken, caBundle string, skipSSLVerification bool) (*AWS, error)

Initialize a new AWS object targeting a specific endpoint from individual bits. SessionToken is optional

func NewForEndpointFromFile

func NewForEndpointFromFile(filename, endpoint, region, caBundle string, skipSSLVerification bool) (*AWS, error)

Initializes a new AWS object targeting a specific endpoint with the credentials info found at filename's location. The credential files should match the AWS format, such as: [default] aws_access_key_id = secretString1 aws_secret_access_key = secretString2

If filename is empty the underlying function will look for the "AWS_SHARED_CREDENTIALS_FILE" env variable or will default to $HOME/.aws/credentials.

func NewFromFile

func NewFromFile(filename string, region string) (*AWS, error)

Initializes a new AWS object with the credentials info found at filename's location. The credential files should match the AWS format, such as: [default] aws_access_key_id = secretString1 aws_secret_access_key = secretString2

If filename is empty the underlying function will look for the "AWS_SHARED_CREDENTIALS_FILE" env variable or will default to $HOME/.aws/credentials.

func (*AWS) AuthorizeSecurityGroupIngressEC2

func (a *AWS) AuthorizeSecurityGroupIngressEC2(groupID, address string, from, to int32, proto string) (*ec2.AuthorizeSecurityGroupIngressOutput, error)

func (*AWS) Buckets added in v0.40.2

func (a *AWS) Buckets() ([]string, error)

func (*AWS) CheckBucketPermission added in v0.40.2

func (a *AWS) CheckBucketPermission(bucketName string, permission s3types.Permission) (bool, error)

CheckBucketPermission check if the current account (of a.s3) has the `permission` on the given bucket

func (*AWS) CreateSecurityGroupEC2

func (a *AWS) CreateSecurityGroupEC2(name, description string) (*ec2.CreateSecurityGroupOutput, error)

func (*AWS) DeleteEC2Image

func (a *AWS) DeleteEC2Image(imageID string) error

DeleteEC2Image deletes the specified image and all of its associated snapshots

func (*AWS) DeleteObject added in v0.40.2

func (a *AWS) DeleteObject(bucket, key string) error

func (*AWS) DeleteSecurityGroupEC2

func (a *AWS) DeleteSecurityGroupEC2(groupID string) (*ec2.DeleteSecurityGroupOutput, error)

func (*AWS) GetInstanceAddress

func (a *AWS) GetInstanceAddress(instanceID string) (string, error)

func (*AWS) MarkS3ObjectAsPublic

func (a *AWS) MarkS3ObjectAsPublic(bucket, objectKey string) error

func (*AWS) Regions

func (a *AWS) Regions() ([]string, error)

func (*AWS) Register

func (a *AWS) Register(name, bucket, key string, tags []AWSTag, shareWith []string, architecture arch.Arch, bootMode *platform.BootMode, importRole *string) (string, string, error)

Register is a function that imports a snapshot, waits for the snapshot to fully import, tags the snapshot, cleans up the image in S3, and registers an AMI in AWS. The caller can optionally specify the boot mode of the AMI. If the boot mode is not specified, then the instances launched from this AMI use the default boot mode value of the instance type.

func (*AWS) RunInstanceEC2

func (a *AWS) RunInstanceEC2(imageID, secGroupID, userData, instanceType string) (*ec2types.Reservation, error)

func (*AWS) S3ObjectPresignedURL

func (a *AWS) S3ObjectPresignedURL(bucket, objectKey string) (string, error)

func (*AWS) ShareImage

func (a *AWS) ShareImage(ami string, snapshotIDs, userIDs []string) error

ShareImage shares the AMI and its associated snapshots with the specified user IDs. If no snapshot IDs are provided, it will find the snapshot IDs associated with the AMI.

func (*AWS) TerminateInstancesEC2 added in v0.174.0

func (a *AWS) TerminateInstancesEC2(instanceIDs []string, timeout time.Duration) (*ec2.TerminateInstancesOutput, error)

TerminateInstancesEC2 terminates the specified EC2 instances and waits for them to be terminated if timeout is greater than 0.

func (*AWS) Upload

func (a *AWS) Upload(filename, bucket, key string) (*s3manager.UploadOutput, error)

func (*AWS) UploadFromReader added in v0.33.0

func (a *AWS) UploadFromReader(r io.Reader, bucket, key string) (*s3manager.UploadOutput, error)

type AWSTag added in v0.204.0

type AWSTag struct {
	Name  string
	Value string
}

type UploaderOptions added in v0.40.2

type UploaderOptions struct {
	TargetArch arch.Arch
	// BootMode to set for the AMI. If nil, no explicit boot mode will be set.
	BootMode *platform.BootMode
	Profile  string
	Tags     []AWSTag
}

Jump to

Keyboard shortcuts

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