s3

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBucketInput

func CreateBucketInput(bucket *v1alpha2.S3Bucket) *s3.CreateBucketInput

CreateBucketInput returns a CreateBucketInput from the supplied S3Bucket.

func GenerateBucketUsername

func GenerateBucketUsername(bucket *v1alpha2.S3Bucket) string

GenerateBucketUsername - Genereates a username that is within AWS size specifications, and adds a random suffix

Types

type Bucket

type Bucket struct {
	Versioning        bool
	UserPolicyVersion string
}

Bucket represents crossplane metadata about the bucket

type Client

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

Client implements S3 Client

func (*Client) CreateOrUpdateBucket

func (c *Client) CreateOrUpdateBucket(bucket *v1alpha2.S3Bucket) error

CreateOrUpdateBucket creates or updates the supplied S3 bucket with provided specification, and returns access keys with permissions of localPermission

func (*Client) CreateUser

func (c *Client) CreateUser(username string, bucket *v1alpha2.S3Bucket) (*iam.AccessKey, string, error)

CreateUser - Create as user to access bucket per permissions in BucketSpec returing access key and policy version

func (*Client) DeleteBucket

func (c *Client) DeleteBucket(bucket *v1alpha2.S3Bucket) error

DeleteBucket deletes s3 bucket, and related IAM

func (*Client) GetBucketInfo

func (c *Client) GetBucketInfo(username string, bucket *v1alpha2.S3Bucket) (*Bucket, error)

GetBucketInfo returns the status of key bucket settings including user's policy version for permission status

func (*Client) UpdateBucketACL

func (c *Client) UpdateBucketACL(bucket *v1alpha2.S3Bucket) error

UpdateBucketACL - Updated CannedACL on Bucket

func (*Client) UpdatePolicyDocument

func (c *Client) UpdatePolicyDocument(username string, bucket *v1alpha2.S3Bucket) (string, error)

UpdatePolicyDocument based on localPermissions

func (*Client) UpdateVersioning

func (c *Client) UpdateVersioning(bucket *v1alpha2.S3Bucket) error

UpdateVersioning configuration for Bucket

type Service

type Service interface {
	CreateOrUpdateBucket(bucket *v1alpha2.S3Bucket) error
	GetBucketInfo(username string, bucket *v1alpha2.S3Bucket) (*Bucket, error)
	CreateUser(username string, bucket *v1alpha2.S3Bucket) (*iam.AccessKey, string, error)
	UpdateBucketACL(bucket *v1alpha2.S3Bucket) error
	UpdateVersioning(bucket *v1alpha2.S3Bucket) error
	UpdatePolicyDocument(username string, bucket *v1alpha2.S3Bucket) (string, error)
	DeleteBucket(bucket *v1alpha2.S3Bucket) error
}

Service defines S3 Client operations

func NewClient

func NewClient(config *aws.Config) Service

NewClient creates new S3 Client with provided AWS Configurations/Credentials

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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