Skip to content

Commit

Permalink
feat: Add support for custom SQS endpoints
Browse files Browse the repository at this point in the history
Signed-off-by: itamarom <itamarnine4@gmail.com>
  • Loading branch information
itamarom committed Feb 13, 2022
1 parent b2936c1 commit c83de03
Show file tree
Hide file tree
Showing 9 changed files with 482 additions and 389 deletions.
12 changes: 12 additions & 0 deletions api/event-source.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions api/event-source.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions api/jsonschema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2212,6 +2212,10 @@
"description": "DLQ specifies if a dead-letter queue is configured for messages that can't be processed successfully. If set to true, messages with invalid payload won't be acknowledged to allow to forward them farther to the dead-letter queue. The default value is false.",
"type": "boolean"
},
"endpoint": {
"description": "Endpoint configures connection to a specific SQS endpoint instead of Amazons servers",
"type": "string"
},
"filter": {
"$ref": "#/definitions/io.argoproj.eventsource.v1alpha1.EventSourceFilter",
"description": "Filter"
Expand Down
4 changes: 4 additions & 0 deletions api/openapi-spec/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion eventsources/sources/awssqs/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,13 @@ func (el *EventListener) StartListening(ctx context.Context, dispatch func([]byt
return errors.Wrapf(err, "failed to create aws session for %s", el.GetEventName())
}

sqsClient := sqslib.New(awsSession)
var sqsClient *sqslib.SQS

if sqsEventSource.Endpoint == "" {
sqsClient = sqslib.New(awsSession)
} else {
sqsClient = sqslib.New(awsSession, &aws.Config{Endpoint: &sqsEventSource.Endpoint, Region: &sqsEventSource.Region})
}

log.Info("fetching queue url...")
getQueueURLInput := &sqslib.GetQueueUrlInput{
Expand Down
816 changes: 428 additions & 388 deletions pkg/apis/eventsource/v1alpha1/generated.pb.go

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions pkg/apis/eventsource/v1alpha1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions pkg/apis/eventsource/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pkg/apis/eventsource/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,9 @@ type SQSEventSource struct {
// Filter
// +optional
Filter *EventSourceFilter `json:"filter,omitempty" protobuf:"bytes,11,opt,name=filter"`
// Endpoint configures connection to a specific SQS endpoint instead of Amazons servers
// +optional
Endpoint string `json:"endpoint" protobuf:"bytes,12,opt,name=endpoint"`
}

// PubSubEventSource refers to event-source for GCP PubSub related events.
Expand Down

0 comments on commit c83de03

Please sign in to comment.