aws

package
v0.0.0-...-62c8998 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBucket

func CreateBucket(s3client S3BucketAPI, conf *appconfig.AppConfig)

func CreateBucketFromS3

func CreateBucketFromS3(ctx context.Context, api S3BucketAPI, params *s3.CreateBucketInput) (*s3.CreateBucketOutput, error)

func CreateTable

func CreateTable(appConfig *config.AppConfig, prefix string) error

func DeleteS3Bucket

func DeleteS3Bucket(bucketName string) error

Empties, then deletes a S3 bucket

func DeleteStateTable

func DeleteStateTable(prefix string) error

func EnableBucketVersioning

func EnableBucketVersioning(s3client S3BucketAPI, conf *appconfig.AppConfig, bucketName string) error

func FetchEFSMounts

func FetchEFSMounts() map[string][]string

func FetchSubnets

func FetchSubnets() ([]string, []string, error)

func GetObject

func GetObject(s3client S3BucketAPI, conf *appconfig.AppConfig, bucketName string, objectKey string) ([]byte, error)

func GetObjectFromS3

func GetObjectFromS3(ctx context.Context, api S3BucketAPI, params *s3.GetObjectInput) (*s3.GetObjectOutput, error)

func HeadBucketFromS3

func HeadBucketFromS3(ctx context.Context, api S3BucketAPI, params *s3.HeadBucketInput) error

func ListObjectsFromS3

func ListObjectsFromS3(ctx context.Context, api S3BucketAPI, params *s3.ListObjectsV2Input) (*s3.ListObjectsV2Output, error)

func ListObjectsV2

func ListObjectsV2(s3client S3BucketAPI, conf *appconfig.AppConfig, bucketName string, prefix string) []types.Object

func ReadSSMParameter

func ReadSSMParameter(path string) (*ssm.GetParameterOutput, error)

func ReadSSMParameters

func ReadSSMParameters(ssmParams []models.SSMParameters) (*marketplace.Parameters, error)

func SetBucketHealthCheckLifecyclePolicy

func SetBucketHealthCheckLifecyclePolicy(s3client S3BucketAPI, conf *appconfig.AppConfig, bucketName string, lifecycleInDays int32) error

Types

type AWSS3Client

type AWSS3Client struct {
	Client *s3.Client
}

func (*AWSS3Client) CreateBucket

func (a *AWSS3Client) CreateBucket(ctx context.Context, params *s3.CreateBucketInput, optFns ...func(*s3.Options)) (*s3.CreateBucketOutput, error)

func (*AWSS3Client) GetObject

func (a *AWSS3Client) GetObject(ctx context.Context, params *s3.GetObjectInput) (*s3.GetObjectOutput, error)

func (*AWSS3Client) HeadBucket

func (a *AWSS3Client) HeadBucket(ctx context.Context, params *s3.HeadBucketInput) (*s3.HeadBucketOutput, error)

func (*AWSS3Client) ListObjectsV2

func (a *AWSS3Client) ListObjectsV2(ctx context.Context, params *s3.ListObjectsV2Input) (*s3.ListObjectsV2Output, error)

func (*AWSS3Client) PutBucketPolicy

func (a *AWSS3Client) PutBucketPolicy(ctx context.Context, params *s3.PutBucketPolicyInput) (*s3.PutBucketPolicyOutput, error)

func (*AWSS3Client) PutBucketVersioning

func (a *AWSS3Client) PutBucketVersioning(ctx context.Context, params *s3.PutBucketVersioningInput) (*s3.PutBucketVersioningOutput, error)

type S3BucketAPI

type S3BucketAPI interface {
	CreateBucket(ctx context.Context, params *s3.CreateBucketInput, optFns ...func(*s3.Options)) (*s3.CreateBucketOutput, error)
	HeadBucket(ctx context.Context, params *s3.HeadBucketInput) (*s3.HeadBucketOutput, error)
	GetObject(ctx context.Context, params *s3.GetObjectInput) (*s3.GetObjectOutput, error)
	ListObjectsV2(ctx context.Context, params *s3.ListObjectsV2Input) (*s3.ListObjectsV2Output, error)
	PutBucketVersioning(ctx context.Context, params *s3.PutBucketVersioningInput) (*s3.PutBucketVersioningOutput, error)
	PutBucketLifecycleConfiguration(ctx context.Context, params *s3.PutBucketLifecycleConfigurationInput) (*s3.PutBucketLifecycleConfigurationOutput, error)
	PutBucketPolicy(ctx context.Context, params *s3.PutBucketPolicyInput) (*s3.PutBucketPolicyOutput, error)
}

func InitS3Client

func InitS3Client(conf *appconfig.AppConfig) S3BucketAPI

func NewAWSS3Client

func NewAWSS3Client(cfg aws.Config) S3BucketAPI

Jump to

Keyboard shortcuts

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