Skip to content
This repository has been archived by the owner on Nov 7, 2019. It is now read-only.

Commit

Permalink
Adding Generated Code for SNS Subscriptions
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Hein <me@christopherhein.com>
  • Loading branch information
christopherhein committed Sep 5, 2018
1 parent e8e0d9a commit 1bfa2b8
Show file tree
Hide file tree
Showing 33 changed files with 2,124 additions and 227 deletions.
1 change: 1 addition & 0 deletions pkg/apis/operator.aws/v1alpha1/cloudformationtemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type CloudFormationTemplate struct {
type CloudFormationTemplateData struct {
CloudFormationTemplateName string `json:"cloudFormationTemplateName"`
CloudFormationTemplateNamespace string `json:"cloudFormationTemplateNamespace"`
RollbackCount int `json:"rollbackCount"`
Key string `json:"key"`
Template string `json:"template"`
}
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/operator.aws/v1alpha1/dynamodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type DynamoDBRangeAttribute struct {
type DynamoDBSpec struct {
CloudFormationTemplateName string `json:"cloudFormationTemplateName"`
CloudFormationTemplateNamespace string `json:"cloudFormationTemplateNamespace"`
RollbackCount int `json:"rollbackCount"`
RangeAttribute DynamoDBRangeAttribute `json:"rangeAttribute"`
ReadCapacityUnits int `json:"readCapacityUnits"`
WriteCapacityUnits int `json:"writeCapacityUnits"`
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/operator.aws/v1alpha1/ecrrepository.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type ECRRepository struct {
type ECRRepositorySpec struct {
CloudFormationTemplateName string `json:"cloudFormationTemplateName"`
CloudFormationTemplateNamespace string `json:"cloudFormationTemplateNamespace"`
RollbackCount int `json:"rollbackCount"`
}


Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/operator.aws/v1alpha1/s3bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ type S3BucketLogging struct {
type S3BucketSpec struct {
CloudFormationTemplateName string `json:"cloudFormationTemplateName"`
CloudFormationTemplateNamespace string `json:"cloudFormationTemplateNamespace"`
RollbackCount int `json:"rollbackCount"`
Versioning bool `json:"versioning"`
AccessControl string `json:"accessControl"`
Logging S3BucketLogging `json:"logging"`
}

Expand Down
69 changes: 69 additions & 0 deletions pkg/apis/operator.aws/v1alpha1/snssubscription.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
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

// SNSSubscription defines the base resource
type SNSSubscription struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
Spec SNSSubscriptionSpec `json:"spec"`
Status SNSSubscriptionStatus `json:"status"`
Output SNSSubscriptionOutput `json:"output"`
AdditionalResources SNSSubscriptionAdditionalResources `json:"additionalResources"`
}
// SNSSubscriptionSpec defines the Spec resource for SNSSubscription
type SNSSubscriptionSpec struct {
CloudFormationTemplateName string `json:"cloudFormationTemplateName"`
CloudFormationTemplateNamespace string `json:"cloudFormationTemplateNamespace"`
RollbackCount int `json:"rollbackCount"`
TopicName string `json:"topicName"`
Protocol string `json:"protocol"`
Endpoint string `json:"endpoint"`
QueueURL string `json:"queueURL"`
}


// SNSSubscriptionOutput defines the output resource for SNSSubscription
type SNSSubscriptionOutput struct {
SubscriptionARN string `json:"subscriptionARN"`
}

// SNSSubscriptionStatus holds the status of the Cloudformation template
type SNSSubscriptionStatus struct {
ResourceStatus string `json:"resourceStatus"`
ResourceStatusReason string `json:"resourceStatusReason"`
StackID string `json:"stackID"`
}

// SNSSubscriptionAdditionalResources holds the additional resources
type SNSSubscriptionAdditionalResources struct {
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// SNSSubscriptionList defines the list attribute for the SNSSubscription type
type SNSSubscriptionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []SNSSubscription `json:"items"`
}

func init() {
localSchemeBuilder.Register(addSNSSubscriptionTypes)
}

func addSNSSubscriptionTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&SNSSubscription{},
&SNSSubscriptionList{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}
3 changes: 2 additions & 1 deletion pkg/apis/operator.aws/v1alpha1/snstopic.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ type SNSTopic struct {
type SNSTopicSpec struct {
CloudFormationTemplateName string `json:"cloudFormationTemplateName"`
CloudFormationTemplateNamespace string `json:"cloudFormationTemplateNamespace"`
RollbackCount int `json:"rollbackCount"`
}

// SNSTopicOutput defines the output resource for SNSTopic
type SNSTopicOutput struct {
TopicName string `json:"topicName"`
TopicARN string `json:"topicARN"`
}

// SNSTopicStatus holds the status of the Cloudformation template
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/operator.aws/v1alpha1/sqsqueue.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type SQSQueue struct {
type SQSQueueSpec struct {
CloudFormationTemplateName string `json:"cloudFormationTemplateName"`
CloudFormationTemplateNamespace string `json:"cloudFormationTemplateNamespace"`
RollbackCount int `json:"rollbackCount"`
ContentBasedDeduplication bool `json:"contentBasedDeduplication"`
DelaySeconds int `json:"delaySeconds"`
MaximumMessageSize int `json:"maximumMessageSize"`
Expand Down
127 changes: 127 additions & 0 deletions 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.

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

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

Loading

0 comments on commit 1bfa2b8

Please sign in to comment.