s3

package
v0.77.4 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

README

S3 Service

This service is github.com/aws/aws-sdk-go/service/s3.S3 proxy

To check all supported method run

    endly -s="aws/s3"

To check method contract run endly -s="aws/s3" -a=methodName

    endly -s="aws/s3" -a='listObjects'

On top of that service implements setupBucketNotification to configure bucket lambda, topic or queue notification.

Usage:

Lambda s3 notification
endly deploy.yaml authWith=aws-secrets.json

where:

  setLambdaNotification:
    action: aws/s3:setupBucketNotification
    credentials: $awsCredentials
    bucket: ${myBucket}
    lambdaFunctionConfigurations:
      - functionName: $functionName
        id: ObjectCreatedEvents-${functionName}-${myBucket}
        events:
          - s3:ObjectCreated:*
        filter:
          prefix:
            - folder1
          suffix:
            - .csv

Queue s3 notification
endly deploy.yaml authWith=aws-secrets.json

where:

  setBucketQueueNotification:
    action: aws/s3:setupBucketNotification
    bucket: ${bucket}
    queueConfigurations:
      - queue: $queue
        id: ObjectCreatedEvents
        events:
          - s3:ObjectCreated:*
Topic s3 notification
endly deploy.yaml authWith=aws-secrets.json

where:

  setBucketTopicNotification:
    action: aws/s3:setupBucketNotification
    credentials: $awsCredentials
    bucket: ${triggerBucket}
    topicConfigurations:
      - topic: $topic
        id: ObjectCreatedEvents
        events:
          - s3:ObjectCreated:*

Documentation

Index

Constants

View Source
const (
	//ServiceID aws s3 service id.
	ServiceID = "aws/s3"
)

Variables

This section is empty.

Functions

func GetClient

func GetClient(context *endly.Context) (*s3.S3, error)

GetClient returns s3 client from context

func New

func New() endly.Service

New creates a new AWS S3 service.

Types

type LambdaFunctionConfiguration

type LambdaFunctionConfiguration struct {
	s3.LambdaFunctionConfiguration `yaml:",inline" json:",¬inline"`
	Filter                         *NotificationFilter `yaml:"-"`
	lambda.SetupPermissionInput
}

func (*LambdaFunctionConfiguration) Init

type NotificationConfiguration

type NotificationConfiguration struct {
	QueueConfigurations          []*QueueConfiguration          `locationName:"QueueConfiguration" type:"list" flattened:"true"`
	TopicConfigurations          []*TopicConfiguration          `locationName:"TopicConfiguration" type:"list" flattened:"true"`
	LambdaFunctionConfigurations []*LambdaFunctionConfiguration `locationName:"LambdaFunctionConfigurations" type:"list" flattened:"true"`
}

type NotificationFilter

type NotificationFilter struct {
	Prefix []string
	Suffix []string
}

func (*NotificationFilter) ToNotificationConfigurationFilter

func (f *NotificationFilter) ToNotificationConfigurationFilter() *s3.NotificationConfigurationFilter

type QueueConfiguration

type QueueConfiguration struct {
	s3.QueueConfiguration
	Filter *NotificationFilter
	Queue  string
	sqs.SetupPermissionInput
}

type SetupBucketNotificationInput

type SetupBucketNotificationInput struct {
	Bucket                     *string
	*NotificationConfiguration `json:",inline"`
}

SetupBucketNotificationInput setup permission for specified bucket

func (*SetupBucketNotificationInput) Init

func (*SetupBucketNotificationInput) Validate

func (i *SetupBucketNotificationInput) Validate() error

type SetupBucketNotificationOutput

type SetupBucketNotificationOutput struct {
	Bucket                        *string
	*s3.NotificationConfiguration `json:",inline"`
	LambdaPermissions             []*lambda.SetupPermissionInput
	QueuePermissions              []*sqs.SetupPermissionInput
}

type TopicConfiguration

type TopicConfiguration struct {
	s3.TopicConfiguration
	Filter *NotificationFilter
	sns.SetupPermissionInput
	Topic string
}

Directories

Path Synopsis
usage
sns
sqs

Jump to

Keyboard shortcuts

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