This repository has been archived by the owner on Nov 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Support for SNS Subscriptions
**Why:** * Allows you to take a SNS topic and subscribe to any standrad protocol with custom hoosk for SQS **This change addresses the need by:** * closes #36 Signed-off-by: Christopher Hein <me@christopherhein.com>
- Loading branch information
1 parent
1bfa2b8
commit 030a0cb
Showing
23 changed files
with
525 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
AWSTemplateFormatVersion: 2010-09-09 | ||
Description: 'AWS Operator - Amazon SNS Subscription' | ||
Parameters: | ||
Namespace: | ||
Description: >- | ||
This is the namespace for the Kubernetes object. | ||
Type: String | ||
ResourceVersion: | ||
Type: String | ||
Description: >- | ||
This is the resource version for the Kubernetes object. | ||
ResourceName: | ||
Description: >- | ||
This is the resource name for the Kubernetes object | ||
Type: String | ||
ClusterName: | ||
Description: >- | ||
This is the cluster name for the operator | ||
Type: String | ||
TopicARN: | ||
Type: String | ||
Description: >- | ||
What is the Amazon SNS Topic ARN to subscribe to? | ||
Protocol: | ||
Type: String | ||
Description: >- | ||
What is the protocol for the endpoint? | ||
Endpoint: | ||
Type: String | ||
Description: >- | ||
What is the endpoint address? | ||
QueueURL: | ||
Type: String | ||
Description: >- | ||
What is the SQS Queue URL? | ||
Conditions: | ||
UseSQS: !Equals [!Ref Protocol, "sqs"] | ||
|
||
Resources: | ||
SNSSubscription: | ||
Type: 'AWS::SNS::Subscription' | ||
Properties: | ||
Endpoint: !Ref Endpoint | ||
Protocol: !Ref Protocol | ||
TopicArn: !Ref TopicARN | ||
Region: !Ref "AWS::Region" | ||
|
||
SQSQueuePolicy: | ||
Type: 'AWS::SQS::QueuePolicy' | ||
Condition: UseSQS | ||
Properties: | ||
PolicyDocument: | ||
Id: AWSOperatorQueuePolicy | ||
Version: '2012-10-17' | ||
Statement: | ||
- Sid: AllowSendReceive | ||
Effect: Allow | ||
Principal: "*" | ||
Action: | ||
- SQS:SendMessage | ||
Resource: !Ref Endpoint | ||
Condition: | ||
ArnEquals: | ||
"aws:SourceArn": !Ref TopicARN | ||
Queues: | ||
- !Ref QueueURL | ||
|
||
Outputs: | ||
SubscriptionARN: | ||
Value: !Ref SNSSubscription | ||
Description: Subscription ARN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,3 +98,4 @@ data: | |
TableArn: | ||
Description: Arn of the DynamoDB Table | ||
Value: !GetAtt DynamoDBTable.Arn | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
apiVersion: operator.aws/v1alpha1 | ||
kind: CloudFormationTemplate | ||
metadata: | ||
name: ecrrepository | ||
data: | ||
key: ecrrepository.yaml | ||
template: | | ||
AWSTemplateFormatVersion: 2010-09-09 | ||
Description: 'AWS Operator - Amazon ECR Repository' | ||
Parameters: | ||
Namespace: | ||
Description: >- | ||
This is the namespace for the Kubernetes object. | ||
Type: String | ||
ResourceVersion: | ||
Type: String | ||
Description: >- | ||
This is the resource version for the Kubernetes object. | ||
ResourceName: | ||
Description: >- | ||
This is the resource name for the Kubernetes object | ||
Type: String | ||
ClusterName: | ||
Description: >- | ||
This is the cluster name for the operator | ||
Type: String | ||
RepositoryName: | ||
Type: String | ||
Description: >- | ||
What should the ECR Repository be named | ||
Resources: | ||
ECRRepository: | ||
Type: AWS::ECR::Repository | ||
Properties: | ||
RepositoryName: !Ref RepositoryName | ||
Outputs: | ||
RepositoryName: | ||
Value: !Ref ECRRepository | ||
Description: Name of the topic | ||
RepositoryARN: | ||
Value: !GetAtt ECRRepository.Arn | ||
Description: ARN of the Repository |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
apiVersion: operator.aws/v1alpha1 | ||
kind: CloudFormationTemplate | ||
metadata: | ||
name: snssubscription | ||
data: | ||
key: snssubscription.yaml | ||
template: | | ||
AWSTemplateFormatVersion: 2010-09-09 | ||
Description: 'AWS Operator - Amazon SNS Subscription' | ||
Parameters: | ||
Namespace: | ||
Description: >- | ||
This is the namespace for the Kubernetes object. | ||
Type: String | ||
ResourceVersion: | ||
Type: String | ||
Description: >- | ||
This is the resource version for the Kubernetes object. | ||
ResourceName: | ||
Description: >- | ||
This is the resource name for the Kubernetes object | ||
Type: String | ||
ClusterName: | ||
Description: >- | ||
This is the cluster name for the operator | ||
Type: String | ||
TopicARN: | ||
Type: String | ||
Description: >- | ||
What is the Amazon SNS Topic ARN to subscribe to? | ||
Protocol: | ||
Type: String | ||
Description: >- | ||
What is the protocol for the endpoint? | ||
Endpoint: | ||
Type: String | ||
Description: >- | ||
What is the endpoint address? | ||
QueueURL: | ||
Type: String | ||
Description: >- | ||
What is the SQS Queue URL? | ||
Conditions: | ||
UseSQS: !Equals [!Ref Protocol, "sqs"] | ||
Resources: | ||
SNSSubscription: | ||
Type: 'AWS::SNS::Subscription' | ||
Properties: | ||
Endpoint: !Ref Endpoint | ||
Protocol: !Ref Protocol | ||
TopicArn: !Ref TopicARN | ||
Region: !Ref "AWS::Region" | ||
SQSQueuePolicy: | ||
Type: 'AWS::SQS::QueuePolicy' | ||
Condition: UseSQS | ||
Properties: | ||
PolicyDocument: | ||
Id: AWSOperatorQueuePolicy | ||
Version: '2012-10-17' | ||
Statement: | ||
- Sid: AllowSendReceive | ||
Effect: Allow | ||
Principal: "*" | ||
Action: | ||
- SQS:SendMessage | ||
Resource: !Ref Endpoint | ||
Condition: | ||
ArnEquals: | ||
"aws:SourceArn": !Ref TopicARN | ||
Queues: | ||
- !Ref QueueURL | ||
Outputs: | ||
SubscriptionARN: | ||
Value: !Ref SNSSubscription | ||
Description: Subscription ARN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
apiVersion: operator.aws/v1alpha1 | ||
kind: CloudFormationTemplate | ||
metadata: | ||
name: snstopic | ||
data: | ||
key: snstopic.yaml | ||
template: | | ||
AWSTemplateFormatVersion: 2010-09-09 | ||
Description: 'AWS Operator - Amazon SNS Topic' | ||
Parameters: | ||
Namespace: | ||
Description: >- | ||
This is the namespace for the Kubernetes object. | ||
Type: String | ||
ResourceVersion: | ||
Type: String | ||
Description: >- | ||
This is the resource version for the Kubernetes object. | ||
ResourceName: | ||
Description: >- | ||
This is the resource name for the Kubernetes object | ||
Type: String | ||
ClusterName: | ||
Description: >- | ||
This is the cluster name for the operator | ||
Type: String | ||
Resources: | ||
SNSTopic: | ||
Type: 'AWS::SNS::Topic' | ||
Outputs: | ||
TopicARN: | ||
Value: !Ref SNSTopic | ||
Description: Name of the topic |
Oops, something went wrong.