Documentation
¶
Index ¶
- Variables
- func ArgumentNotSupported(err error) bool
- func CORSConfigurationNotFound(err error) bool
- func CopyAWSTags(tags []s3types.Tag) []v1beta1.Tag
- func CopyTags(tags []v1beta1.Tag) []s3types.Tag
- func GenerateBucketObservation(name string) v1beta1.BucketExternalStatus
- func GenerateCreateBucketInput(name string, s v1beta1.BucketParameters) *s3.CreateBucketInput
- func IsAlreadyExists(err error) bool
- func IsErrorBucketNotFound(err error) bool
- func IsErrorPolicyNotFound(err error) bool
- func IsNotFound(err error) bool
- func LifecycleConfigurationNotFound(err error) bool
- func MethodNotSupported(err error) bool
- func PublicAccessBlockConfigurationNotFound(err error) bool
- func ReplicationConfigurationNotFound(err error) bool
- func SSEConfigurationNotFound(err error) bool
- func Serialize(p *v1alpha3.BucketPolicyBody) (interface{}, error)
- func SerializeAWSPrincipal(p v1alpha3.AWSPrincipal) *string
- func SerializeBucketCondition(p []v1alpha3.Condition) (interface{}, error)
- func SerializeBucketPolicyStatement(p v1alpha3.BucketPolicyStatement) (interface{}, error)
- func SerializeBucketPrincipal(p *v1alpha3.BucketPrincipal) (interface{}, error)
- func SortS3TagSet(tags []s3types.Tag) []s3types.Tag
- func TaggingNotFound(err error) bool
- func UpdateBucketACL(ctx context.Context, client BucketClient, bucket *v1beta1.Bucket) error
- func WebsiteConfigurationNotFound(err error) bool
- type BucketClient
- type BucketPolicyClient
Constants ¶
This section is empty.
Variables ¶
var ( // BucketNotFoundErrCode is the error code sent by AWS when a bucket does not exist BucketNotFoundErrCode = "NotFound" // CORSNotFoundErrCode is the error code sent by AWS when the CORS configuration does not exist CORSNotFoundErrCode = "NoSuchCORSConfiguration" // PublicAccessBlockNotFoundErrCode is NotFound error for PublicAccessBlock PublicAccessBlockNotFoundErrCode = "NoSuchPublicAccessBlockConfiguration" // ReplicationNotFoundErrCode is the error code sent by AWS when the replication config does not exist ReplicationNotFoundErrCode = "ReplicationConfigurationNotFoundError" // LifecycleNotFoundErrCode is the error code sent by AWS when the lifecycle config does not exist LifecycleNotFoundErrCode = "NoSuchLifecycleConfiguration" // SSENotFoundErrCode is the error code sent by AWS when the SSE config does not exist SSENotFoundErrCode = "ServerSideEncryptionConfigurationNotFoundError" // TaggingNotFoundErrCode is the error code sent by AWS when the tagging does not exist TaggingNotFoundErrCode = "NoSuchTagSet" // WebsiteNotFoundErrCode is the error code sent by AWS when the website config does not exist WebsiteNotFoundErrCode = "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" )
See - https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#RESTErrorResponses
Functions ¶
func ArgumentNotSupported ¶ added in v0.15.0
ArgumentNotSupported is parses the aws Error and validates if parameters are now allowed for a request
func CORSConfigurationNotFound ¶ added in v0.12.0
CORSConfigurationNotFound is parses the aws Error and validates if the cors configuration does not exist
func CopyAWSTags ¶ added in v0.18.0
CopyAWSTags converts a list of external s3.Tags to local 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
IsAlreadyExists helper function to test for ErrCodeBucketAlreadyOwnedByYou error
func IsErrorBucketNotFound ¶ added in v0.12.0
IsErrorBucketNotFound returns true if the error code indicates that the bucket was not found
func IsErrorPolicyNotFound ¶ added in v0.12.0
IsErrorPolicyNotFound returns true if the error code indicates that the item was not found
func IsNotFound ¶ added in v0.12.0
IsNotFound helper function to test for NotFound error
func LifecycleConfigurationNotFound ¶ added in v0.12.0
LifecycleConfigurationNotFound is parses the aws Error and validates if the lifecycle configuration does not exist
func MethodNotSupported ¶ added in v0.15.0
MethodNotSupported is parses the aws Error and validates if the method is allowed for a request
func PublicAccessBlockConfigurationNotFound ¶ added in v0.19.0
PublicAccessBlockConfigurationNotFound is parses the aws Error and validates if the public access block does not exist
func ReplicationConfigurationNotFound ¶ added in v0.12.0
ReplicationConfigurationNotFound is parses the aws Error and validates if the replication configuration does not exist
func SSEConfigurationNotFound ¶ added in v0.12.0
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 *v1alpha3.BucketPolicyBody) (interface{}, error)
Serialize is the custom marshaller for the BucketPolicyParameters
func SerializeAWSPrincipal ¶ added in v0.15.0
func SerializeAWSPrincipal(p v1alpha3.AWSPrincipal) *string
SerializeAWSPrincipal converts an AWSPrincipal to a string
func SerializeBucketCondition ¶ added in v0.15.0
SerializeBucketCondition converts the string -> Condition map into a serialized version
func SerializeBucketPolicyStatement ¶ added in v0.15.0
func SerializeBucketPolicyStatement(p v1alpha3.BucketPolicyStatement) (interface{}, error)
SerializeBucketPolicyStatement is the custom marshaller for the BucketPolicyStatement
func SerializeBucketPrincipal ¶ added in v0.15.0
func SerializeBucketPrincipal(p *v1alpha3.BucketPrincipal) (interface{}, error)
SerializeBucketPrincipal is the custom serializer for the BucketPrincipal
func SortS3TagSet ¶ added in v0.13.0
SortS3TagSet stable sorts an external s3 tag list by the key and value.
func TaggingNotFound ¶ added in v0.12.0
TaggingNotFound is parses the aws Error and validates if the tagging configuration does not exist
func UpdateBucketACL ¶ added in v0.12.0
UpdateBucketACL creates the ACLInput, sends the request to put an ACL based on the bucket
func WebsiteConfigurationNotFound ¶ added in v0.12.0
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 {
HeadBucket(ctx context.Context, input *s3.HeadBucketInput, opts ...func(*s3.Options)) (*s3.HeadBucketOutput, error)
CreateBucket(ctx context.Context, input *s3.CreateBucketInput, opts ...func(*s3.Options)) (*s3.CreateBucketOutput, error)
DeleteBucket(ctx context.Context, input *s3.DeleteBucketInput, opts ...func(*s3.Options)) (*s3.DeleteBucketOutput, error)
PutBucketEncryption(ctx context.Context, input *s3.PutBucketEncryptionInput, opts ...func(*s3.Options)) (*s3.PutBucketEncryptionOutput, error)
GetBucketEncryption(ctx context.Context, input *s3.GetBucketEncryptionInput, opts ...func(*s3.Options)) (*s3.GetBucketEncryptionOutput, error)
DeleteBucketEncryption(ctx context.Context, input *s3.DeleteBucketEncryptionInput, opts ...func(*s3.Options)) (*s3.DeleteBucketEncryptionOutput, error)
PutBucketVersioning(ctx context.Context, input *s3.PutBucketVersioningInput, opts ...func(*s3.Options)) (*s3.PutBucketVersioningOutput, error)
GetBucketVersioning(ctx context.Context, input *s3.GetBucketVersioningInput, opts ...func(*s3.Options)) (*s3.GetBucketVersioningOutput, error)
PutBucketAccelerateConfiguration(ctx context.Context, input *s3.PutBucketAccelerateConfigurationInput, opts ...func(*s3.Options)) (*s3.PutBucketAccelerateConfigurationOutput, error)
GetBucketAccelerateConfiguration(ctx context.Context, input *s3.GetBucketAccelerateConfigurationInput, opts ...func(*s3.Options)) (*s3.GetBucketAccelerateConfigurationOutput, error)
PutBucketCors(ctx context.Context, input *s3.PutBucketCorsInput, opts ...func(*s3.Options)) (*s3.PutBucketCorsOutput, error)
GetBucketCors(ctx context.Context, input *s3.GetBucketCorsInput, opts ...func(*s3.Options)) (*s3.GetBucketCorsOutput, error)
DeleteBucketCors(ctx context.Context, input *s3.DeleteBucketCorsInput, opts ...func(*s3.Options)) (*s3.DeleteBucketCorsOutput, error)
PutBucketWebsite(ctx context.Context, input *s3.PutBucketWebsiteInput, opts ...func(*s3.Options)) (*s3.PutBucketWebsiteOutput, error)
GetBucketWebsite(ctx context.Context, input *s3.GetBucketWebsiteInput, opts ...func(*s3.Options)) (*s3.GetBucketWebsiteOutput, error)
DeleteBucketWebsite(ctx context.Context, input *s3.DeleteBucketWebsiteInput, opts ...func(*s3.Options)) (*s3.DeleteBucketWebsiteOutput, error)
PutBucketLogging(ctx context.Context, input *s3.PutBucketLoggingInput, opts ...func(*s3.Options)) (*s3.PutBucketLoggingOutput, error)
GetBucketLogging(ctx context.Context, input *s3.GetBucketLoggingInput, opts ...func(*s3.Options)) (*s3.GetBucketLoggingOutput, error)
PutBucketReplication(ctx context.Context, input *s3.PutBucketReplicationInput, opts ...func(*s3.Options)) (*s3.PutBucketReplicationOutput, error)
GetBucketReplication(ctx context.Context, input *s3.GetBucketReplicationInput, opts ...func(*s3.Options)) (*s3.GetBucketReplicationOutput, error)
DeleteBucketReplication(ctx context.Context, input *s3.DeleteBucketReplicationInput, opts ...func(*s3.Options)) (*s3.DeleteBucketReplicationOutput, error)
PutBucketRequestPayment(ctx context.Context, input *s3.PutBucketRequestPaymentInput, opts ...func(*s3.Options)) (*s3.PutBucketRequestPaymentOutput, error)
GetBucketRequestPayment(ctx context.Context, input *s3.GetBucketRequestPaymentInput, opts ...func(*s3.Options)) (*s3.GetBucketRequestPaymentOutput, error)
PutBucketTagging(ctx context.Context, input *s3.PutBucketTaggingInput, opts ...func(*s3.Options)) (*s3.PutBucketTaggingOutput, error)
GetBucketTagging(ctx context.Context, input *s3.GetBucketTaggingInput, opts ...func(*s3.Options)) (*s3.GetBucketTaggingOutput, error)
DeleteBucketTagging(ctx context.Context, input *s3.DeleteBucketTaggingInput, opts ...func(*s3.Options)) (*s3.DeleteBucketTaggingOutput, error)
PutBucketAnalyticsConfiguration(ctx context.Context, input *s3.PutBucketAnalyticsConfigurationInput, opts ...func(*s3.Options)) (*s3.PutBucketAnalyticsConfigurationOutput, error)
GetBucketAnalyticsConfiguration(ctx context.Context, input *s3.GetBucketAnalyticsConfigurationInput, opts ...func(*s3.Options)) (*s3.GetBucketAnalyticsConfigurationOutput, error)
PutBucketLifecycleConfiguration(ctx context.Context, input *s3.PutBucketLifecycleConfigurationInput, opts ...func(*s3.Options)) (*s3.PutBucketLifecycleConfigurationOutput, error)
GetBucketLifecycleConfiguration(ctx context.Context, input *s3.GetBucketLifecycleConfigurationInput, opts ...func(*s3.Options)) (*s3.GetBucketLifecycleConfigurationOutput, error)
DeleteBucketLifecycle(ctx context.Context, input *s3.DeleteBucketLifecycleInput, opts ...func(*s3.Options)) (*s3.DeleteBucketLifecycleOutput, error)
PutBucketNotificationConfiguration(ctx context.Context, input *s3.PutBucketNotificationConfigurationInput, opts ...func(*s3.Options)) (*s3.PutBucketNotificationConfigurationOutput, error)
GetBucketNotificationConfiguration(ctx context.Context, input *s3.GetBucketNotificationConfigurationInput, opts ...func(*s3.Options)) (*s3.GetBucketNotificationConfigurationOutput, error)
GetBucketAcl(ctx context.Context, input *s3.GetBucketAclInput, opts ...func(*s3.Options)) (*s3.GetBucketAclOutput, error) //nolint
PutBucketAcl(ctx context.Context, input *s3.PutBucketAclInput, opts ...func(*s3.Options)) (*s3.PutBucketAclOutput, error) //nolint
GetPublicAccessBlock(ctx context.Context, input *s3.GetPublicAccessBlockInput, opts ...func(*s3.Options)) (*s3.GetPublicAccessBlockOutput, error)
PutPublicAccessBlock(ctx context.Context, input *s3.PutPublicAccessBlockInput, opts ...func(*s3.Options)) (*s3.PutPublicAccessBlockOutput, error)
DeletePublicAccessBlock(ctx context.Context, input *s3.DeletePublicAccessBlockInput, opts ...func(*s3.Options)) (*s3.DeletePublicAccessBlockOutput, error)
}
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 {
GetBucketPolicy(ctx context.Context, input *s3.GetBucketPolicyInput, opts ...func(*s3.Options)) (*s3.GetBucketPolicyOutput, error)
PutBucketPolicy(ctx context.Context, input *s3.PutBucketPolicyInput, opts ...func(*s3.Options)) (*s3.PutBucketPolicyOutput, error)
DeleteBucketPolicy(ctx context.Context, input *s3.DeleteBucketPolicyInput, opts ...func(*s3.Options)) (*s3.DeleteBucketPolicyOutput, error)
}
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