Skip to content

Commit

Permalink
Add SQS Custom endpoint support (#1632)
Browse files Browse the repository at this point in the history
* feat: Add support for custom SQS endpoints

Signed-off-by: itamarom <[email protected]>
  • Loading branch information
itamarom authored Feb 15, 2022
1 parent 4721cf3 commit 00e2ae8
Show file tree
Hide file tree
Showing 10 changed files with 483 additions and 389 deletions.
1 change: 1 addition & 0 deletions USERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Organizations below are **officially** using Argo Events. Please send a PR with
1. [Helio](https://helio.exchange)
1. [InsideBoard](https://www.insideboard.com)
1. [Intuit](https://www.intuit.com/)
1. [Loam](https://www.getloam.com/)
1. [Mobimeo GmbH](https://mobimeo.com/en/home/)
1. [OneCause](https://www.onecause.com/)
1. [Produvar](https://www.produvar.com/)
Expand Down
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 00e2ae8

Please sign in to comment.