Documentation ¶
Index ¶
- func BlockBucketPublicAccess(s3Client Client, bucketName string) error
- func ClearBucketTags(s3Client Client, bucketName string) (err error)
- func CreateBucket(s3Client Client, bucketName string) error
- func CreateBucketTaggingInput(bucketname string, tags map[string]string) *s3.PutBucketTaggingInput
- func DoesBucketExist(s3Client Client, bucketName string) (bool, error)
- func EncryptBucket(s3Client Client, bucketName string) error
- func FindMatchingTags(buckets map[string][]*s3.Tag, infraName string) string
- func ListBucketTags(s3Client Client, buckets []*s3.Bucket) (map[string][]*s3.Tag, error)
- func ListBuckets(s3Client Client) (*s3.ListBucketsOutput, error)
- func ListBucketsInRegion(s3Client Client, region string) (*s3.ListBucketsOutput, error)
- func NewDriver(ctx context.Context, cfg *configv1.InfrastructureStatus, clnt client.Client) *driver
- func SetBucketLifecycle(s3Client Client, bucketName string) error
- func TagBucket(s3Client Client, bucketName string, backUpLocation string, infraName string) error
- type Client
- type S3
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlockBucketPublicAccess ¶
BlockBucketPublicAccess blocks public access to the bucket's contents.
func ClearBucketTags ¶
ClearBucketTags wipes all existing tags from a bucket so that velero-specific tags can be applied to the bucket instead.
func CreateBucket ¶
CreateBucket creates a new S3 bucket.
func CreateBucketTaggingInput ¶
func CreateBucketTaggingInput(bucketname string, tags map[string]string) *s3.PutBucketTaggingInput
CreateBucketTaggingInput creates an S3 PutBucketTaggingInput object, which is used to associate a list of tags with a bucket.
func DoesBucketExist ¶
DoesBucketExist checks that the bucket exists, and that we have access to it.
func EncryptBucket ¶
EncryptBucket sets the encryption configuration for the bucket.
func FindMatchingTags ¶
FindMatchingTags looks through the TagSets for all AWS buckets and determines if any of the buckets are tagged for velero updates for the cluster. If matching tags are found, the bucket name is returned.
func ListBucketTags ¶
ListBucketTags returns a list of s3.GetBucketTagging objects, one for each bucket. If the bucket is not readable, or has no tags, the bucket name is omitted from the taglist. So taglist only contains the list of buckets that have tags.
func ListBuckets ¶
func ListBuckets(s3Client Client) (*s3.ListBucketsOutput, error)
ListBuckets lists all buckets in the AWS account.
func ListBucketsInRegion ¶
func ListBucketsInRegion(s3Client Client, region string) (*s3.ListBucketsOutput, error)
ListBucketsInRegion lists buckets in the AWS account in the given region.
func SetBucketLifecycle ¶
SetBucketLifecycle sets a lifecycle on the specified bucket.
Types ¶
type Client ¶
type Client interface { CreateBucket(*s3.CreateBucketInput) (*s3.CreateBucketOutput, error) DeleteBucketTagging(*s3.DeleteBucketTaggingInput) (*s3.DeleteBucketTaggingOutput, error) HeadBucket(*s3.HeadBucketInput) (*s3.HeadBucketOutput, error) GetAWSClientConfig() *aws.Config GetBucketLocation(*s3.GetBucketLocationInput) (*s3.GetBucketLocationOutput, error) GetBucketTagging(*s3.GetBucketTaggingInput) (*s3.GetBucketTaggingOutput, error) GetPublicAccessBlock(*s3.GetPublicAccessBlockInput) (*s3.GetPublicAccessBlockOutput, error) ListBuckets(*s3.ListBucketsInput) (*s3.ListBucketsOutput, error) PutBucketEncryption(*s3.PutBucketEncryptionInput) (*s3.PutBucketEncryptionOutput, error) PutBucketLifecycleConfiguration(*s3.PutBucketLifecycleConfigurationInput) (*s3.PutBucketLifecycleConfigurationOutput, error) PutBucketTagging(*s3.PutBucketTaggingInput) (*s3.PutBucketTaggingOutput, error) PutPublicAccessBlock(*s3.PutPublicAccessBlockInput) (*s3.PutPublicAccessBlockOutput, error) }
Client is a wrapper object for the actual AWS SDK client to allow for easier testing.