s3

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// BucketErrCode is the error code sent by AWS when a bucket does not exist
	BucketErrCode = "NotFound"
	// CORSErrCode is the error code sent by AWS when the CORS configuration does not exist
	CORSErrCode = "NoSuchCORSConfiguration"
	// ReplicationErrCode is the error code sent by AWS when the replication config does not exist
	ReplicationErrCode = "ReplicationConfigurationNotFoundError"
	// LifecycleErrCode is the error code sent by AWS when the lifecycle config does not exist
	LifecycleErrCode = "NoSuchLifecycleConfiguration"
	// SSEErrCode is the error code sent by AWS when the SSE config does not exist
	SSEErrCode = "ServerSideEncryptionConfigurationNotFoundError"
	// TaggingErrCode is the error code sent by AWS when the tagging does not exist
	TaggingErrCode = "NoSuchTagSet"
	// WebsiteErrCode is the error code sent by AWS when the website config does not exist
	WebsiteErrCode = "NoSuchWebsiteConfiguration"
	// MethodNotAllowed is the error code sent by AWS when the request method for an object is not allowed
	MethodNotAllowed = "MethodNotAllowed"
	// UnsupportedArgument is the error code sent by AWS when the request fields contain an argument that is not supported
	UnsupportedArgument = "UnsupportedArgument"
)

Functions

func ArgumentNotSupported added in v0.15.0

func ArgumentNotSupported(err error) bool

ArgumentNotSupported is parses the aws Error and validates if parameters are now allowed for a request

func CORSConfigurationNotFound added in v0.12.0

func CORSConfigurationNotFound(err error) bool

CORSConfigurationNotFound is parses the aws Error and validates if the cors configuration does not exist

func CopyTags added in v0.13.0

func CopyTags(tags []v1beta1.Tag) []s3.Tag

CopyTags converts a list of local v1beta.Tags to S3 Tags

func GenerateBucketObservation added in v0.12.0

func GenerateBucketObservation(name string) v1beta1.BucketExternalStatus

GenerateBucketObservation generates the ARN string for the external status

func GenerateCreateBucketInput added in v0.12.0

func GenerateCreateBucketInput(name string, s v1beta1.BucketParameters) *s3.CreateBucketInput

GenerateCreateBucketInput creates the input for CreateBucket S3 Client request

func IsAlreadyExists added in v0.12.0

func IsAlreadyExists(err error) bool

IsAlreadyExists helper function to test for ErrCodeBucketAlreadyOwnedByYou error

func IsErrorBucketNotFound added in v0.12.0

func IsErrorBucketNotFound(err error) bool

IsErrorBucketNotFound returns true if the error code indicates that the bucket was not found

func IsErrorPolicyNotFound added in v0.12.0

func IsErrorPolicyNotFound(err error) bool

IsErrorPolicyNotFound returns true if the error code indicates that the item was not found

func IsNotFound added in v0.12.0

func IsNotFound(err error) bool

IsNotFound helper function to test for NotFound error

func LifecycleConfigurationNotFound added in v0.12.0

func LifecycleConfigurationNotFound(err error) bool

LifecycleConfigurationNotFound is parses the aws Error and validates if the lifecycle configuration does not exist

func MethodNotSupported added in v0.15.0

func MethodNotSupported(err error) bool

MethodNotSupported is parses the aws Error and validates if the method is allowed for a request

func ReplicationConfigurationNotFound added in v0.12.0

func ReplicationConfigurationNotFound(err error) bool

ReplicationConfigurationNotFound is parses the aws Error and validates if the replication configuration does not exist

func SSEConfigurationNotFound added in v0.12.0

func SSEConfigurationNotFound(err error) bool

SSEConfigurationNotFound is parses the aws Error and validates if the SSE configuration does not exist

func Serialize added in v0.15.0

func Serialize(p v1alpha2.BucketPolicyParameters) (interface{}, error)

Serialize is the custom marshaller for the BucketPolicyParameters

func SerializeAWSPrincipal added in v0.15.0

func SerializeAWSPrincipal(p v1alpha2.AWSPrincipal) *string

SerializeAWSPrincipal converts an AWSPrincipal to a string

func SerializeBucketCondition added in v0.15.0

func SerializeBucketCondition(p map[string]v1alpha2.Condition) (interface{}, error)

SerializeBucketCondition converts the string -> Condition map into a serialized version

func SerializeBucketPolicyStatement added in v0.15.0

func SerializeBucketPolicyStatement(p v1alpha2.BucketPolicyStatement) (interface{}, error)

SerializeBucketPolicyStatement is the custom marshaller for the BucketPolicyStatement

func SerializeBucketPrincipal added in v0.15.0

func SerializeBucketPrincipal(p *v1alpha2.BucketPrincipal) (interface{}, error)

SerializeBucketPrincipal is the custom serializer for the BucketPrincipal

func SortS3TagSet added in v0.13.0

func SortS3TagSet(tags []s3.Tag) []s3.Tag

SortS3TagSet stable sorts an external s3 tag list by the key and value.

func TaggingNotFound added in v0.12.0

func TaggingNotFound(err error) bool

TaggingNotFound is parses the aws Error and validates if the tagging configuration does not exist

func UpdateBucketACL added in v0.12.0

func UpdateBucketACL(ctx context.Context, client BucketClient, bucket *v1beta1.Bucket) error

UpdateBucketACL creates the ACLInput, sends the request to put an ACL based on the bucket

func WebsiteConfigurationNotFound added in v0.12.0

func WebsiteConfigurationNotFound(err error) bool

WebsiteConfigurationNotFound is parses the aws Error and validates if the website configuration does not exist

Types

type BucketClient added in v0.12.0

type BucketClient interface {
	HeadBucketRequest(input *s3.HeadBucketInput) s3.HeadBucketRequest
	CreateBucketRequest(input *s3.CreateBucketInput) s3.CreateBucketRequest
	DeleteBucketRequest(input *s3.DeleteBucketInput) s3.DeleteBucketRequest

	PutBucketEncryptionRequest(input *s3.PutBucketEncryptionInput) s3.PutBucketEncryptionRequest
	GetBucketEncryptionRequest(input *s3.GetBucketEncryptionInput) s3.GetBucketEncryptionRequest
	DeleteBucketEncryptionRequest(input *s3.DeleteBucketEncryptionInput) s3.DeleteBucketEncryptionRequest

	PutBucketVersioningRequest(input *s3.PutBucketVersioningInput) s3.PutBucketVersioningRequest
	GetBucketVersioningRequest(input *s3.GetBucketVersioningInput) s3.GetBucketVersioningRequest

	PutBucketAccelerateConfigurationRequest(input *s3.PutBucketAccelerateConfigurationInput) s3.PutBucketAccelerateConfigurationRequest
	GetBucketAccelerateConfigurationRequest(input *s3.GetBucketAccelerateConfigurationInput) s3.GetBucketAccelerateConfigurationRequest

	PutBucketCorsRequest(input *s3.PutBucketCorsInput) s3.PutBucketCorsRequest
	GetBucketCorsRequest(input *s3.GetBucketCorsInput) s3.GetBucketCorsRequest
	DeleteBucketCorsRequest(input *s3.DeleteBucketCorsInput) s3.DeleteBucketCorsRequest

	PutBucketWebsiteRequest(input *s3.PutBucketWebsiteInput) s3.PutBucketWebsiteRequest
	GetBucketWebsiteRequest(input *s3.GetBucketWebsiteInput) s3.GetBucketWebsiteRequest
	DeleteBucketWebsiteRequest(input *s3.DeleteBucketWebsiteInput) s3.DeleteBucketWebsiteRequest

	PutBucketLoggingRequest(input *s3.PutBucketLoggingInput) s3.PutBucketLoggingRequest
	GetBucketLoggingRequest(input *s3.GetBucketLoggingInput) s3.GetBucketLoggingRequest

	PutBucketReplicationRequest(input *s3.PutBucketReplicationInput) s3.PutBucketReplicationRequest
	GetBucketReplicationRequest(input *s3.GetBucketReplicationInput) s3.GetBucketReplicationRequest
	DeleteBucketReplicationRequest(input *s3.DeleteBucketReplicationInput) s3.DeleteBucketReplicationRequest

	PutBucketRequestPaymentRequest(input *s3.PutBucketRequestPaymentInput) s3.PutBucketRequestPaymentRequest
	GetBucketRequestPaymentRequest(input *s3.GetBucketRequestPaymentInput) s3.GetBucketRequestPaymentRequest

	PutBucketTaggingRequest(input *s3.PutBucketTaggingInput) s3.PutBucketTaggingRequest
	GetBucketTaggingRequest(input *s3.GetBucketTaggingInput) s3.GetBucketTaggingRequest
	DeleteBucketTaggingRequest(input *s3.DeleteBucketTaggingInput) s3.DeleteBucketTaggingRequest

	PutBucketAnalyticsConfigurationRequest(input *s3.PutBucketAnalyticsConfigurationInput) s3.PutBucketAnalyticsConfigurationRequest
	GetBucketAnalyticsConfigurationRequest(input *s3.GetBucketAnalyticsConfigurationInput) s3.GetBucketAnalyticsConfigurationRequest

	PutBucketLifecycleConfigurationRequest(input *s3.PutBucketLifecycleConfigurationInput) s3.PutBucketLifecycleConfigurationRequest
	GetBucketLifecycleConfigurationRequest(input *s3.GetBucketLifecycleConfigurationInput) s3.GetBucketLifecycleConfigurationRequest
	DeleteBucketLifecycleRequest(input *s3.DeleteBucketLifecycleInput) s3.DeleteBucketLifecycleRequest

	PutBucketNotificationConfigurationRequest(input *s3.PutBucketNotificationConfigurationInput) s3.PutBucketNotificationConfigurationRequest
	GetBucketNotificationConfigurationRequest(input *s3.GetBucketNotificationConfigurationInput) s3.GetBucketNotificationConfigurationRequest

	GetBucketAclRequest(*s3.GetBucketAclInput) s3.GetBucketAclRequest
	PutBucketAclRequest(*s3.PutBucketAclInput) s3.PutBucketAclRequest
}

BucketClient is the interface for Client for making S3 Bucket requests.

func NewClient

func NewClient(cfg aws.Config) BucketClient

NewClient returns a new client using AWS credentials as JSON encoded data.

type BucketPolicyClient added in v0.12.0

type BucketPolicyClient interface {
	GetBucketPolicyRequest(input *s3.GetBucketPolicyInput) s3.GetBucketPolicyRequest
	PutBucketPolicyRequest(input *s3.PutBucketPolicyInput) s3.PutBucketPolicyRequest
	DeleteBucketPolicyRequest(input *s3.DeleteBucketPolicyInput) s3.DeleteBucketPolicyRequest
}

BucketPolicyClient is the external client used for S3BucketPolicy Custom Resource

func NewBucketPolicyClient added in v0.12.0

func NewBucketPolicyClient(cfg aws.Config) BucketPolicyClient

NewBucketPolicyClient returns a new client given an aws config

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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