s3

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 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(spec *v1alpha1.S3BucketSpec) *s3.CreateBucketInput

CreateBucketInput returns a CreateBucketInput from the supplied S3BucketSpec.

func GenerateBucketUsername

func GenerateBucketUsername(spec *v1alpha1.S3BucketSpec) 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(spec *v1alpha1.S3BucketSpec) 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, spec *v1alpha1.S3BucketSpec) (*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 *v1alpha1.S3Bucket) error

DeleteBucket deletes s3 bucket, and related IAM

func (*Client) GetBucketInfo

func (c *Client) GetBucketInfo(username string, spec *v1alpha1.S3BucketSpec) (*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(spec *v1alpha1.S3BucketSpec) error

UpdateBucketACL - Updated CannedACL on Bucket

func (*Client) UpdatePolicyDocument

func (c *Client) UpdatePolicyDocument(username string, spec *v1alpha1.S3BucketSpec) (string, error)

UpdatePolicyDocument based on localPermissions

func (*Client) UpdateVersioning

func (c *Client) UpdateVersioning(spec *v1alpha1.S3BucketSpec) error

UpdateVersioning configuration for Bucket

type Service

type Service interface {
	CreateOrUpdateBucket(spec *v1alpha1.S3BucketSpec) error
	GetBucketInfo(username string, spec *v1alpha1.S3BucketSpec) (*Bucket, error)
	CreateUser(username string, spec *v1alpha1.S3BucketSpec) (*iam.AccessKey, string, error)
	UpdateBucketACL(spec *v1alpha1.S3BucketSpec) error
	UpdateVersioning(spec *v1alpha1.S3BucketSpec) error
	UpdatePolicyDocument(username string, spec *v1alpha1.S3BucketSpec) (string, error)
	DeleteBucket(bucket *v1alpha1.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