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.
Merge pull request #24 from christopherhein/feature/7-adding-sqs
Adding SQS resource
- Loading branch information
Showing
17 changed files
with
1,243 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: operator.aws/v1alpha1 | ||
kind: SQS | ||
metadata: | ||
name: chrishein-test-sqs-1 | ||
spec: | ||
contentBasedDeduplication: false | ||
delaySeconds: 1 | ||
usedeadletterQueue: false |
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,109 @@ | ||
apiVersion: operator.aws/v1alpha1 | ||
kind: ModelDefinition | ||
metadata: | ||
name: SQSResource | ||
spec: | ||
kind: SQSQueue | ||
type: Spec # can be Spec or Data | ||
queue: true | ||
useCloudFormation: true | ||
resource: | ||
name: sqsqueue | ||
plural: sqsqueues | ||
shortNames: | ||
- name: sqs | ||
- name: queue | ||
- name: queues | ||
body: | ||
schema: | ||
type: object | ||
properties: | ||
- key: contentBasedDeduplication | ||
type: bool | ||
description: | | ||
ContentBasedDeduplication enables content deduping on the queue | ||
structKey: ContentBasedDeduplication | ||
templateKey: ContentBasedDeduplication | ||
- key: delaySeconds | ||
type: int | ||
description: | | ||
DelaySeconds is how long the message should delay on recieving. | ||
structKey: DelaySeconds | ||
templateKey: DelaySeconds | ||
- key: maximumMessageSize | ||
type: int | ||
description: | | ||
MaximumMessageSize the maximum size a message should be and int | ||
structKey: MaximumMessageSize | ||
templateKey: MaximumMessageSize | ||
- key: messageRetentionPeriod | ||
type: int | ||
description: | | ||
MaximumMessageSize the maximum size a message should be | ||
MessageRetentionPeriod determines how long to keep a message | ||
structKey: MessageRetentionPeriod | ||
templateKey: MessageRetentionPeriod | ||
- key: receiveMessageWaitTimeSeconds | ||
type: int | ||
description: | | ||
Time it will wait until it tries to find another message to process. | ||
structKey: ReceiveMessageWaitTimeSeconds | ||
templateKey: ReceiveMessageWaitTimeSeconds | ||
- key: usedeadletterQueue | ||
type: bool | ||
description: | | ||
Queue specifically made for messages that cannot be processed | ||
structKey: UsedeadletterQueue | ||
templateKey: UsedeadletterQueue | ||
- key: visibilityTimeout | ||
type: int | ||
description: | | ||
Timeout for processing a message. | ||
structKey: VisibilityTimeout | ||
templateKey: VisibilityTimeout | ||
- key: fifoQueue | ||
type: bool | ||
description: | | ||
Should this queue process messages in a first in first out manner | ||
structKey: FifoQueue | ||
templateKey: FifoQueue | ||
output: | ||
schema: | ||
type: object | ||
properties: | ||
- key: queueURL | ||
type: string | ||
description: | | ||
URL of newly created SQS Queue | ||
structKey: QueueURL | ||
templateKey: QueueURL | ||
- key: queueARN | ||
type: string | ||
description: | | ||
ARN of newly created SQS Queue | ||
structKey: QueueARN | ||
templateKey: QueueARN | ||
- key: queueName | ||
type: string | ||
description: | | ||
Name newly created SQS Queue | ||
structKey: QueueName | ||
templateKey: QueueName | ||
- key: deadLetterQueueURL | ||
type: string | ||
description: | | ||
URL of newly created SQS Queue | ||
structKey: DeadLetterQueueURL | ||
templateKey: DeadLetterQueueURL | ||
- key: deadLetterQueueARN | ||
type: string | ||
description: | | ||
ARN of newly created SQS Queue | ||
structKey: DeadLetterQueueARN | ||
templateKey: DeadLetterQueueARN | ||
- key: deadLetterQueueName | ||
type: string | ||
description: | | ||
Name newly created SQS Queue | ||
structKey: DeadLetterQueueName | ||
templateKey: DeadLetterQueueName |
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,77 @@ | ||
package v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"k8s.io/apimachinery/pkg/runtime" | ||
) | ||
|
||
// +genclient | ||
// +genclient:noStatus | ||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// SQSQueue defines the base resource | ||
type SQSQueue struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata"` | ||
Spec SQSQueueSpec `json:"spec"` | ||
Status SQSQueueStatus `json:"status"` | ||
Output SQSQueueOutput `json:"output"` | ||
AdditionalResources SQSQueueAdditionalResources `json:"additionalResources"` | ||
} | ||
// SQSQueueSpec defines the Spec resource for SQSQueue | ||
type SQSQueueSpec struct { | ||
CloudFormationTemplateName string `json:"cloudFormationTemplateName"` | ||
CloudFormationTemplateNamespace string `json:"cloudFormationTemplateNamespace"` | ||
ContentBasedDeduplication bool `json:"contentBasedDeduplication"` | ||
DelaySeconds int `json:"delaySeconds"` | ||
MaximumMessageSize int `json:"maximumMessageSize"` | ||
MessageRetentionPeriod int `json:"messageRetentionPeriod"` | ||
ReceiveMessageWaitTimeSeconds int `json:"receiveMessageWaitTimeSeconds"` | ||
UsedeadletterQueue bool `json:"usedeadletterQueue"` | ||
VisibilityTimeout int `json:"visibilityTimeout"` | ||
FifoQueue bool `json:"fifoQueue"` | ||
} | ||
|
||
|
||
// SQSQueueOutput defines the output resource for SQSQueue | ||
type SQSQueueOutput struct { | ||
QueueURL string `json:"queueURL"` | ||
QueueARN string `json:"queueARN"` | ||
QueueName string `json:"queueName"` | ||
DeadLetterQueueURL string `json:"deadLetterQueueURL"` | ||
DeadLetterQueueARN string `json:"deadLetterQueueARN"` | ||
DeadLetterQueueName string `json:"deadLetterQueueName"` | ||
} | ||
|
||
// SQSQueueStatus holds the status of the Cloudformation template | ||
type SQSQueueStatus struct { | ||
ResourceStatus string `json:"resourceStatus"` | ||
ResourceStatusReason string `json:"resourceStatusReason"` | ||
StackID string `json:"stackID"` | ||
} | ||
|
||
// SQSQueueAdditionalResources holds the additional resources | ||
type SQSQueueAdditionalResources struct { | ||
} | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// SQSQueueList defines the list attribute for the SQSQueue type | ||
type SQSQueueList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata"` | ||
Items []SQSQueue `json:"items"` | ||
} | ||
|
||
func init() { | ||
localSchemeBuilder.Register(addSQSQueueTypes) | ||
} | ||
|
||
func addSQSQueueTypes(scheme *runtime.Scheme) error { | ||
scheme.AddKnownTypes(SchemeGroupVersion, | ||
&SQSQueue{}, | ||
&SQSQueueList{}, | ||
) | ||
metav1.AddToGroupVersion(scheme, SchemeGroupVersion) | ||
return nil | ||
} |
127 changes: 127 additions & 0 deletions
127
pkg/apis/operator.aws/v1alpha1/zz_generated.deepcopy.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
pkg/client/clientset/versioned/typed/operator.aws/v1alpha1/fake/fake_operator.aws_client.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.