From 23b80f39f8c3bcedd152fd80bfba617064921a55 Mon Sep 17 00:00:00 2001 From: ezgidemirel Date: Wed, 27 Apr 2022 18:03:04 +0300 Subject: [PATCH] Add MQ broker and configuration resources Signed-off-by: ezgidemirel --- apis/mq/v1alpha2/zz_broker_types.go | 278 ++++++ apis/mq/v1alpha2/zz_configuration_types.go | 114 +++ apis/mq/v1alpha2/zz_generated.deepcopy.go | 888 ++++++++++++++++++ apis/mq/v1alpha2/zz_generated.managed.go | 152 +++ apis/mq/v1alpha2/zz_generated.managedlist.go | 38 + apis/mq/v1alpha2/zz_generated.resolvers.go | 52 + apis/mq/v1alpha2/zz_generated_terraformed.go | 174 ++++ apis/mq/v1alpha2/zz_groupversion_info.go | 44 + apis/zz_register.go | 2 + config/mq/config.go | 43 + config/provider.go | 7 + examples/mq/broker.yaml | 19 + examples/mq/configuration.yaml | 22 + .../controller/mq/broker/zz_controller.go | 65 ++ .../mq/configuration/zz_controller.go | 63 ++ internal/controller/zz_setup.go | 4 + .../mq.aws.jet.crossplane.io_brokers.yaml | 425 +++++++++ ....aws.jet.crossplane.io_configurations.yaml | 251 +++++ 18 files changed, 2641 insertions(+) create mode 100755 apis/mq/v1alpha2/zz_broker_types.go create mode 100755 apis/mq/v1alpha2/zz_configuration_types.go create mode 100644 apis/mq/v1alpha2/zz_generated.deepcopy.go create mode 100644 apis/mq/v1alpha2/zz_generated.managed.go create mode 100644 apis/mq/v1alpha2/zz_generated.managedlist.go create mode 100644 apis/mq/v1alpha2/zz_generated.resolvers.go create mode 100755 apis/mq/v1alpha2/zz_generated_terraformed.go create mode 100755 apis/mq/v1alpha2/zz_groupversion_info.go create mode 100644 config/mq/config.go create mode 100644 examples/mq/broker.yaml create mode 100644 examples/mq/configuration.yaml create mode 100755 internal/controller/mq/broker/zz_controller.go create mode 100755 internal/controller/mq/configuration/zz_controller.go create mode 100644 package/crds/mq.aws.jet.crossplane.io_brokers.yaml create mode 100644 package/crds/mq.aws.jet.crossplane.io_configurations.yaml diff --git a/apis/mq/v1alpha2/zz_broker_types.go b/apis/mq/v1alpha2/zz_broker_types.go new file mode 100755 index 000000000..fa0096314 --- /dev/null +++ b/apis/mq/v1alpha2/zz_broker_types.go @@ -0,0 +1,278 @@ +/* +Copyright 2021 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by terrajet. DO NOT EDIT. + +package v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type BrokerObservation struct { + Arn *string `json:"arn,omitempty" tf:"arn,omitempty"` + + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + Instances []InstancesObservation `json:"instances,omitempty" tf:"instances,omitempty"` + + TagsAll map[string]*string `json:"tagsAll,omitempty" tf:"tags_all,omitempty"` +} + +type BrokerParameters struct { + + // +kubebuilder:validation:Optional + ApplyImmediately *bool `json:"applyImmediately,omitempty" tf:"apply_immediately,omitempty"` + + // +kubebuilder:validation:Optional + AuthenticationStrategy *string `json:"authenticationStrategy,omitempty" tf:"authentication_strategy,omitempty"` + + // +kubebuilder:validation:Optional + AutoMinorVersionUpgrade *bool `json:"autoMinorVersionUpgrade,omitempty" tf:"auto_minor_version_upgrade,omitempty"` + + // +kubebuilder:validation:Required + BrokerName *string `json:"brokerName" tf:"broker_name,omitempty"` + + // +kubebuilder:validation:Optional + Configuration []ConfigurationParameters `json:"configuration,omitempty" tf:"configuration,omitempty"` + + // +kubebuilder:validation:Optional + DeploymentMode *string `json:"deploymentMode,omitempty" tf:"deployment_mode,omitempty"` + + // +kubebuilder:validation:Optional + EncryptionOptions []EncryptionOptionsParameters `json:"encryptionOptions,omitempty" tf:"encryption_options,omitempty"` + + // +kubebuilder:validation:Required + EngineType *string `json:"engineType" tf:"engine_type,omitempty"` + + // +kubebuilder:validation:Required + EngineVersion *string `json:"engineVersion" tf:"engine_version,omitempty"` + + // +kubebuilder:validation:Required + HostInstanceType *string `json:"hostInstanceType" tf:"host_instance_type,omitempty"` + + // +kubebuilder:validation:Optional + LdapServerMetadata []LdapServerMetadataParameters `json:"ldapServerMetadata,omitempty" tf:"ldap_server_metadata,omitempty"` + + // +kubebuilder:validation:Optional + Logs []LogsParameters `json:"logs,omitempty" tf:"logs,omitempty"` + + // +kubebuilder:validation:Optional + MaintenanceWindowStartTime []MaintenanceWindowStartTimeParameters `json:"maintenanceWindowStartTime,omitempty" tf:"maintenance_window_start_time,omitempty"` + + // +kubebuilder:validation:Optional + PubliclyAccessible *bool `json:"publiclyAccessible,omitempty" tf:"publicly_accessible,omitempty"` + + // Region is the region you'd like your resource to be created in. + // +terrajet:crd:field:TFTag=- + // +kubebuilder:validation:Required + Region *string `json:"region" tf:"-"` + + // +kubebuilder:validation:Optional + SecurityGroups []*string `json:"securityGroups,omitempty" tf:"security_groups,omitempty"` + + // +kubebuilder:validation:Optional + StorageType *string `json:"storageType,omitempty" tf:"storage_type,omitempty"` + + // +kubebuilder:validation:Optional + SubnetIdRefs []v1.Reference `json:"subnetIdRefs,omitempty" tf:"-"` + + // +kubebuilder:validation:Optional + SubnetIdSelector *v1.Selector `json:"subnetIdSelector,omitempty" tf:"-"` + + // +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-jet-aws/apis/ec2/v1alpha2.Subnet + // +crossplane:generate:reference:refFieldName=SubnetIdRefs + // +crossplane:generate:reference:selectorFieldName=SubnetIdSelector + // +kubebuilder:validation:Optional + SubnetIds []*string `json:"subnetIds,omitempty" tf:"subnet_ids,omitempty"` + + // +kubebuilder:validation:Optional + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // +kubebuilder:validation:Required + User []UserParameters `json:"user" tf:"user,omitempty"` +} + +type ConfigurationObservation struct { +} + +type ConfigurationParameters struct { + + // +kubebuilder:validation:Optional + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // +kubebuilder:validation:Optional + Revision *float64 `json:"revision,omitempty" tf:"revision,omitempty"` +} + +type EncryptionOptionsObservation struct { +} + +type EncryptionOptionsParameters struct { + + // +kubebuilder:validation:Optional + KMSKeyID *string `json:"kmsKeyId,omitempty" tf:"kms_key_id,omitempty"` + + // +kubebuilder:validation:Optional + UseAwsOwnedKey *bool `json:"useAwsOwnedKey,omitempty" tf:"use_aws_owned_key,omitempty"` +} + +type InstancesObservation struct { + ConsoleURL *string `json:"consoleUrl,omitempty" tf:"console_url,omitempty"` + + Endpoints []*string `json:"endpoints,omitempty" tf:"endpoints,omitempty"` + + IPAddress *string `json:"ipAddress,omitempty" tf:"ip_address,omitempty"` +} + +type InstancesParameters struct { +} + +type LdapServerMetadataObservation struct { +} + +type LdapServerMetadataParameters struct { + + // +kubebuilder:validation:Optional + Hosts []*string `json:"hosts,omitempty" tf:"hosts,omitempty"` + + // +kubebuilder:validation:Optional + RoleBase *string `json:"roleBase,omitempty" tf:"role_base,omitempty"` + + // +kubebuilder:validation:Optional + RoleName *string `json:"roleName,omitempty" tf:"role_name,omitempty"` + + // +kubebuilder:validation:Optional + RoleSearchMatching *string `json:"roleSearchMatching,omitempty" tf:"role_search_matching,omitempty"` + + // +kubebuilder:validation:Optional + RoleSearchSubtree *bool `json:"roleSearchSubtree,omitempty" tf:"role_search_subtree,omitempty"` + + // +kubebuilder:validation:Optional + ServiceAccountPasswordSecretRef *v1.SecretKeySelector `json:"serviceAccountPasswordSecretRef,omitempty" tf:"-"` + + // +kubebuilder:validation:Optional + ServiceAccountUsername *string `json:"serviceAccountUsername,omitempty" tf:"service_account_username,omitempty"` + + // +kubebuilder:validation:Optional + UserBase *string `json:"userBase,omitempty" tf:"user_base,omitempty"` + + // +kubebuilder:validation:Optional + UserRoleName *string `json:"userRoleName,omitempty" tf:"user_role_name,omitempty"` + + // +kubebuilder:validation:Optional + UserSearchMatching *string `json:"userSearchMatching,omitempty" tf:"user_search_matching,omitempty"` + + // +kubebuilder:validation:Optional + UserSearchSubtree *bool `json:"userSearchSubtree,omitempty" tf:"user_search_subtree,omitempty"` +} + +type LogsObservation struct { +} + +type LogsParameters struct { + + // +kubebuilder:validation:Optional + Audit *string `json:"audit,omitempty" tf:"audit,omitempty"` + + // +kubebuilder:validation:Optional + General *bool `json:"general,omitempty" tf:"general,omitempty"` +} + +type MaintenanceWindowStartTimeObservation struct { +} + +type MaintenanceWindowStartTimeParameters struct { + + // +kubebuilder:validation:Required + DayOfWeek *string `json:"dayOfWeek" tf:"day_of_week,omitempty"` + + // +kubebuilder:validation:Required + TimeOfDay *string `json:"timeOfDay" tf:"time_of_day,omitempty"` + + // +kubebuilder:validation:Required + TimeZone *string `json:"timeZone" tf:"time_zone,omitempty"` +} + +type UserObservation struct { +} + +type UserParameters struct { + + // +kubebuilder:validation:Optional + ConsoleAccess *bool `json:"consoleAccess,omitempty" tf:"console_access,omitempty"` + + // +kubebuilder:validation:Optional + Groups []*string `json:"groups,omitempty" tf:"groups,omitempty"` + + // +kubebuilder:validation:Required + PasswordSecretRef v1.SecretKeySelector `json:"passwordSecretRef" tf:"-"` + + // +kubebuilder:validation:Required + Username *string `json:"username" tf:"username,omitempty"` +} + +// BrokerSpec defines the desired state of Broker +type BrokerSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider BrokerParameters `json:"forProvider"` +} + +// BrokerStatus defines the observed state of Broker. +type BrokerStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider BrokerObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// Broker is the Schema for the Brokers API +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,awsjet} +type Broker struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec BrokerSpec `json:"spec"` + Status BrokerStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// BrokerList contains a list of Brokers +type BrokerList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Broker `json:"items"` +} + +// Repository type metadata. +var ( + Broker_Kind = "Broker" + Broker_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: Broker_Kind}.String() + Broker_KindAPIVersion = Broker_Kind + "." + CRDGroupVersion.String() + Broker_GroupVersionKind = CRDGroupVersion.WithKind(Broker_Kind) +) + +func init() { + SchemeBuilder.Register(&Broker{}, &BrokerList{}) +} diff --git a/apis/mq/v1alpha2/zz_configuration_types.go b/apis/mq/v1alpha2/zz_configuration_types.go new file mode 100755 index 000000000..9b8588aaf --- /dev/null +++ b/apis/mq/v1alpha2/zz_configuration_types.go @@ -0,0 +1,114 @@ +/* +Copyright 2021 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by terrajet. DO NOT EDIT. + +package v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type ConfigurationObservation_2 struct { + Arn *string `json:"arn,omitempty" tf:"arn,omitempty"` + + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + LatestRevision *float64 `json:"latestRevision,omitempty" tf:"latest_revision,omitempty"` + + TagsAll map[string]*string `json:"tagsAll,omitempty" tf:"tags_all,omitempty"` +} + +type ConfigurationParameters_2 struct { + + // +kubebuilder:validation:Optional + AuthenticationStrategy *string `json:"authenticationStrategy,omitempty" tf:"authentication_strategy,omitempty"` + + // +kubebuilder:validation:Required + Data *string `json:"data" tf:"data,omitempty"` + + // +kubebuilder:validation:Optional + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // +kubebuilder:validation:Required + EngineType *string `json:"engineType" tf:"engine_type,omitempty"` + + // +kubebuilder:validation:Required + EngineVersion *string `json:"engineVersion" tf:"engine_version,omitempty"` + + // +kubebuilder:validation:Required + Name *string `json:"name" tf:"name,omitempty"` + + // Region is the region you'd like your resource to be created in. + // +terrajet:crd:field:TFTag=- + // +kubebuilder:validation:Required + Region *string `json:"region" tf:"-"` + + // +kubebuilder:validation:Optional + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` +} + +// ConfigurationSpec defines the desired state of Configuration +type ConfigurationSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider ConfigurationParameters_2 `json:"forProvider"` +} + +// ConfigurationStatus defines the observed state of Configuration. +type ConfigurationStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider ConfigurationObservation_2 `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// Configuration is the Schema for the Configurations API +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,awsjet} +type Configuration struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec ConfigurationSpec `json:"spec"` + Status ConfigurationStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// ConfigurationList contains a list of Configurations +type ConfigurationList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Configuration `json:"items"` +} + +// Repository type metadata. +var ( + Configuration_Kind = "Configuration" + Configuration_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: Configuration_Kind}.String() + Configuration_KindAPIVersion = Configuration_Kind + "." + CRDGroupVersion.String() + Configuration_GroupVersionKind = CRDGroupVersion.WithKind(Configuration_Kind) +) + +func init() { + SchemeBuilder.Register(&Configuration{}, &ConfigurationList{}) +} diff --git a/apis/mq/v1alpha2/zz_generated.deepcopy.go b/apis/mq/v1alpha2/zz_generated.deepcopy.go new file mode 100644 index 000000000..77bcdfe9e --- /dev/null +++ b/apis/mq/v1alpha2/zz_generated.deepcopy.go @@ -0,0 +1,888 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright 2021 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + "github.com/crossplane/crossplane-runtime/apis/common/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Broker) DeepCopyInto(out *Broker) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Broker. +func (in *Broker) DeepCopy() *Broker { + if in == nil { + return nil + } + out := new(Broker) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Broker) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BrokerList) DeepCopyInto(out *BrokerList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Broker, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BrokerList. +func (in *BrokerList) DeepCopy() *BrokerList { + if in == nil { + return nil + } + out := new(BrokerList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BrokerList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BrokerObservation) DeepCopyInto(out *BrokerObservation) { + *out = *in + if in.Arn != nil { + in, out := &in.Arn, &out.Arn + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Instances != nil { + in, out := &in.Instances, &out.Instances + *out = make([]InstancesObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.TagsAll != nil { + in, out := &in.TagsAll, &out.TagsAll + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BrokerObservation. +func (in *BrokerObservation) DeepCopy() *BrokerObservation { + if in == nil { + return nil + } + out := new(BrokerObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BrokerParameters) DeepCopyInto(out *BrokerParameters) { + *out = *in + if in.ApplyImmediately != nil { + in, out := &in.ApplyImmediately, &out.ApplyImmediately + *out = new(bool) + **out = **in + } + if in.AuthenticationStrategy != nil { + in, out := &in.AuthenticationStrategy, &out.AuthenticationStrategy + *out = new(string) + **out = **in + } + if in.AutoMinorVersionUpgrade != nil { + in, out := &in.AutoMinorVersionUpgrade, &out.AutoMinorVersionUpgrade + *out = new(bool) + **out = **in + } + if in.BrokerName != nil { + in, out := &in.BrokerName, &out.BrokerName + *out = new(string) + **out = **in + } + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = make([]ConfigurationParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.DeploymentMode != nil { + in, out := &in.DeploymentMode, &out.DeploymentMode + *out = new(string) + **out = **in + } + if in.EncryptionOptions != nil { + in, out := &in.EncryptionOptions, &out.EncryptionOptions + *out = make([]EncryptionOptionsParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.EngineType != nil { + in, out := &in.EngineType, &out.EngineType + *out = new(string) + **out = **in + } + if in.EngineVersion != nil { + in, out := &in.EngineVersion, &out.EngineVersion + *out = new(string) + **out = **in + } + if in.HostInstanceType != nil { + in, out := &in.HostInstanceType, &out.HostInstanceType + *out = new(string) + **out = **in + } + if in.LdapServerMetadata != nil { + in, out := &in.LdapServerMetadata, &out.LdapServerMetadata + *out = make([]LdapServerMetadataParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Logs != nil { + in, out := &in.Logs, &out.Logs + *out = make([]LogsParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.MaintenanceWindowStartTime != nil { + in, out := &in.MaintenanceWindowStartTime, &out.MaintenanceWindowStartTime + *out = make([]MaintenanceWindowStartTimeParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PubliclyAccessible != nil { + in, out := &in.PubliclyAccessible, &out.PubliclyAccessible + *out = new(bool) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.SecurityGroups != nil { + in, out := &in.SecurityGroups, &out.SecurityGroups + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } + if in.StorageType != nil { + in, out := &in.StorageType, &out.StorageType + *out = new(string) + **out = **in + } + if in.SubnetIdRefs != nil { + in, out := &in.SubnetIdRefs, &out.SubnetIdRefs + *out = make([]v1.Reference, len(*in)) + copy(*out, *in) + } + if in.SubnetIdSelector != nil { + in, out := &in.SubnetIdSelector, &out.SubnetIdSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.SubnetIds != nil { + in, out := &in.SubnetIds, &out.SubnetIds + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.User != nil { + in, out := &in.User, &out.User + *out = make([]UserParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BrokerParameters. +func (in *BrokerParameters) DeepCopy() *BrokerParameters { + if in == nil { + return nil + } + out := new(BrokerParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BrokerSpec) DeepCopyInto(out *BrokerSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BrokerSpec. +func (in *BrokerSpec) DeepCopy() *BrokerSpec { + if in == nil { + return nil + } + out := new(BrokerSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BrokerStatus) DeepCopyInto(out *BrokerStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BrokerStatus. +func (in *BrokerStatus) DeepCopy() *BrokerStatus { + if in == nil { + return nil + } + out := new(BrokerStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Configuration) DeepCopyInto(out *Configuration) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Configuration. +func (in *Configuration) DeepCopy() *Configuration { + if in == nil { + return nil + } + out := new(Configuration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Configuration) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigurationList) DeepCopyInto(out *ConfigurationList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Configuration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigurationList. +func (in *ConfigurationList) DeepCopy() *ConfigurationList { + if in == nil { + return nil + } + out := new(ConfigurationList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ConfigurationList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigurationObservation) DeepCopyInto(out *ConfigurationObservation) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigurationObservation. +func (in *ConfigurationObservation) DeepCopy() *ConfigurationObservation { + if in == nil { + return nil + } + out := new(ConfigurationObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigurationObservation_2) DeepCopyInto(out *ConfigurationObservation_2) { + *out = *in + if in.Arn != nil { + in, out := &in.Arn, &out.Arn + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.LatestRevision != nil { + in, out := &in.LatestRevision, &out.LatestRevision + *out = new(float64) + **out = **in + } + if in.TagsAll != nil { + in, out := &in.TagsAll, &out.TagsAll + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigurationObservation_2. +func (in *ConfigurationObservation_2) DeepCopy() *ConfigurationObservation_2 { + if in == nil { + return nil + } + out := new(ConfigurationObservation_2) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigurationParameters) DeepCopyInto(out *ConfigurationParameters) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Revision != nil { + in, out := &in.Revision, &out.Revision + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigurationParameters. +func (in *ConfigurationParameters) DeepCopy() *ConfigurationParameters { + if in == nil { + return nil + } + out := new(ConfigurationParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigurationParameters_2) DeepCopyInto(out *ConfigurationParameters_2) { + *out = *in + if in.AuthenticationStrategy != nil { + in, out := &in.AuthenticationStrategy, &out.AuthenticationStrategy + *out = new(string) + **out = **in + } + if in.Data != nil { + in, out := &in.Data, &out.Data + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.EngineType != nil { + in, out := &in.EngineType, &out.EngineType + *out = new(string) + **out = **in + } + if in.EngineVersion != nil { + in, out := &in.EngineVersion, &out.EngineVersion + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigurationParameters_2. +func (in *ConfigurationParameters_2) DeepCopy() *ConfigurationParameters_2 { + if in == nil { + return nil + } + out := new(ConfigurationParameters_2) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigurationSpec) DeepCopyInto(out *ConfigurationSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigurationSpec. +func (in *ConfigurationSpec) DeepCopy() *ConfigurationSpec { + if in == nil { + return nil + } + out := new(ConfigurationSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigurationStatus) DeepCopyInto(out *ConfigurationStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigurationStatus. +func (in *ConfigurationStatus) DeepCopy() *ConfigurationStatus { + if in == nil { + return nil + } + out := new(ConfigurationStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EncryptionOptionsObservation) DeepCopyInto(out *EncryptionOptionsObservation) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EncryptionOptionsObservation. +func (in *EncryptionOptionsObservation) DeepCopy() *EncryptionOptionsObservation { + if in == nil { + return nil + } + out := new(EncryptionOptionsObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EncryptionOptionsParameters) DeepCopyInto(out *EncryptionOptionsParameters) { + *out = *in + if in.KMSKeyID != nil { + in, out := &in.KMSKeyID, &out.KMSKeyID + *out = new(string) + **out = **in + } + if in.UseAwsOwnedKey != nil { + in, out := &in.UseAwsOwnedKey, &out.UseAwsOwnedKey + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EncryptionOptionsParameters. +func (in *EncryptionOptionsParameters) DeepCopy() *EncryptionOptionsParameters { + if in == nil { + return nil + } + out := new(EncryptionOptionsParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstancesObservation) DeepCopyInto(out *InstancesObservation) { + *out = *in + if in.ConsoleURL != nil { + in, out := &in.ConsoleURL, &out.ConsoleURL + *out = new(string) + **out = **in + } + if in.Endpoints != nil { + in, out := &in.Endpoints, &out.Endpoints + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } + if in.IPAddress != nil { + in, out := &in.IPAddress, &out.IPAddress + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstancesObservation. +func (in *InstancesObservation) DeepCopy() *InstancesObservation { + if in == nil { + return nil + } + out := new(InstancesObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstancesParameters) DeepCopyInto(out *InstancesParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstancesParameters. +func (in *InstancesParameters) DeepCopy() *InstancesParameters { + if in == nil { + return nil + } + out := new(InstancesParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LdapServerMetadataObservation) DeepCopyInto(out *LdapServerMetadataObservation) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LdapServerMetadataObservation. +func (in *LdapServerMetadataObservation) DeepCopy() *LdapServerMetadataObservation { + if in == nil { + return nil + } + out := new(LdapServerMetadataObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LdapServerMetadataParameters) DeepCopyInto(out *LdapServerMetadataParameters) { + *out = *in + if in.Hosts != nil { + in, out := &in.Hosts, &out.Hosts + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } + if in.RoleBase != nil { + in, out := &in.RoleBase, &out.RoleBase + *out = new(string) + **out = **in + } + if in.RoleName != nil { + in, out := &in.RoleName, &out.RoleName + *out = new(string) + **out = **in + } + if in.RoleSearchMatching != nil { + in, out := &in.RoleSearchMatching, &out.RoleSearchMatching + *out = new(string) + **out = **in + } + if in.RoleSearchSubtree != nil { + in, out := &in.RoleSearchSubtree, &out.RoleSearchSubtree + *out = new(bool) + **out = **in + } + if in.ServiceAccountPasswordSecretRef != nil { + in, out := &in.ServiceAccountPasswordSecretRef, &out.ServiceAccountPasswordSecretRef + *out = new(v1.SecretKeySelector) + **out = **in + } + if in.ServiceAccountUsername != nil { + in, out := &in.ServiceAccountUsername, &out.ServiceAccountUsername + *out = new(string) + **out = **in + } + if in.UserBase != nil { + in, out := &in.UserBase, &out.UserBase + *out = new(string) + **out = **in + } + if in.UserRoleName != nil { + in, out := &in.UserRoleName, &out.UserRoleName + *out = new(string) + **out = **in + } + if in.UserSearchMatching != nil { + in, out := &in.UserSearchMatching, &out.UserSearchMatching + *out = new(string) + **out = **in + } + if in.UserSearchSubtree != nil { + in, out := &in.UserSearchSubtree, &out.UserSearchSubtree + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LdapServerMetadataParameters. +func (in *LdapServerMetadataParameters) DeepCopy() *LdapServerMetadataParameters { + if in == nil { + return nil + } + out := new(LdapServerMetadataParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LogsObservation) DeepCopyInto(out *LogsObservation) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogsObservation. +func (in *LogsObservation) DeepCopy() *LogsObservation { + if in == nil { + return nil + } + out := new(LogsObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LogsParameters) DeepCopyInto(out *LogsParameters) { + *out = *in + if in.Audit != nil { + in, out := &in.Audit, &out.Audit + *out = new(string) + **out = **in + } + if in.General != nil { + in, out := &in.General, &out.General + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogsParameters. +func (in *LogsParameters) DeepCopy() *LogsParameters { + if in == nil { + return nil + } + out := new(LogsParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MaintenanceWindowStartTimeObservation) DeepCopyInto(out *MaintenanceWindowStartTimeObservation) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MaintenanceWindowStartTimeObservation. +func (in *MaintenanceWindowStartTimeObservation) DeepCopy() *MaintenanceWindowStartTimeObservation { + if in == nil { + return nil + } + out := new(MaintenanceWindowStartTimeObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MaintenanceWindowStartTimeParameters) DeepCopyInto(out *MaintenanceWindowStartTimeParameters) { + *out = *in + if in.DayOfWeek != nil { + in, out := &in.DayOfWeek, &out.DayOfWeek + *out = new(string) + **out = **in + } + if in.TimeOfDay != nil { + in, out := &in.TimeOfDay, &out.TimeOfDay + *out = new(string) + **out = **in + } + if in.TimeZone != nil { + in, out := &in.TimeZone, &out.TimeZone + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MaintenanceWindowStartTimeParameters. +func (in *MaintenanceWindowStartTimeParameters) DeepCopy() *MaintenanceWindowStartTimeParameters { + if in == nil { + return nil + } + out := new(MaintenanceWindowStartTimeParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserObservation) DeepCopyInto(out *UserObservation) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserObservation. +func (in *UserObservation) DeepCopy() *UserObservation { + if in == nil { + return nil + } + out := new(UserObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserParameters) DeepCopyInto(out *UserParameters) { + *out = *in + if in.ConsoleAccess != nil { + in, out := &in.ConsoleAccess, &out.ConsoleAccess + *out = new(bool) + **out = **in + } + if in.Groups != nil { + in, out := &in.Groups, &out.Groups + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } + out.PasswordSecretRef = in.PasswordSecretRef + if in.Username != nil { + in, out := &in.Username, &out.Username + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserParameters. +func (in *UserParameters) DeepCopy() *UserParameters { + if in == nil { + return nil + } + out := new(UserParameters) + in.DeepCopyInto(out) + return out +} diff --git a/apis/mq/v1alpha2/zz_generated.managed.go b/apis/mq/v1alpha2/zz_generated.managed.go new file mode 100644 index 000000000..edc540349 --- /dev/null +++ b/apis/mq/v1alpha2/zz_generated.managed.go @@ -0,0 +1,152 @@ +/* +Copyright 2021 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha2 + +import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + +// GetCondition of this Broker. +func (mg *Broker) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this Broker. +func (mg *Broker) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetProviderConfigReference of this Broker. +func (mg *Broker) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +/* +GetProviderReference of this Broker. +Deprecated: Use GetProviderConfigReference. +*/ +func (mg *Broker) GetProviderReference() *xpv1.Reference { + return mg.Spec.ProviderReference +} + +// GetPublishConnectionDetailsTo of this Broker. +func (mg *Broker) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this Broker. +func (mg *Broker) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this Broker. +func (mg *Broker) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this Broker. +func (mg *Broker) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetProviderConfigReference of this Broker. +func (mg *Broker) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +/* +SetProviderReference of this Broker. +Deprecated: Use SetProviderConfigReference. +*/ +func (mg *Broker) SetProviderReference(r *xpv1.Reference) { + mg.Spec.ProviderReference = r +} + +// SetPublishConnectionDetailsTo of this Broker. +func (mg *Broker) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this Broker. +func (mg *Broker) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + +// GetCondition of this Configuration. +func (mg *Configuration) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this Configuration. +func (mg *Configuration) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetProviderConfigReference of this Configuration. +func (mg *Configuration) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +/* +GetProviderReference of this Configuration. +Deprecated: Use GetProviderConfigReference. +*/ +func (mg *Configuration) GetProviderReference() *xpv1.Reference { + return mg.Spec.ProviderReference +} + +// GetPublishConnectionDetailsTo of this Configuration. +func (mg *Configuration) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this Configuration. +func (mg *Configuration) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this Configuration. +func (mg *Configuration) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this Configuration. +func (mg *Configuration) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetProviderConfigReference of this Configuration. +func (mg *Configuration) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +/* +SetProviderReference of this Configuration. +Deprecated: Use SetProviderConfigReference. +*/ +func (mg *Configuration) SetProviderReference(r *xpv1.Reference) { + mg.Spec.ProviderReference = r +} + +// SetPublishConnectionDetailsTo of this Configuration. +func (mg *Configuration) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this Configuration. +func (mg *Configuration) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} diff --git a/apis/mq/v1alpha2/zz_generated.managedlist.go b/apis/mq/v1alpha2/zz_generated.managedlist.go new file mode 100644 index 000000000..467b79b48 --- /dev/null +++ b/apis/mq/v1alpha2/zz_generated.managedlist.go @@ -0,0 +1,38 @@ +/* +Copyright 2021 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha2 + +import resource "github.com/crossplane/crossplane-runtime/pkg/resource" + +// GetItems of this BrokerList. +func (l *BrokerList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} + +// GetItems of this ConfigurationList. +func (l *ConfigurationList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} diff --git a/apis/mq/v1alpha2/zz_generated.resolvers.go b/apis/mq/v1alpha2/zz_generated.resolvers.go new file mode 100644 index 000000000..8403953a4 --- /dev/null +++ b/apis/mq/v1alpha2/zz_generated.resolvers.go @@ -0,0 +1,52 @@ +/* +Copyright 2021 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha2 + +import ( + "context" + v1alpha2 "github.com/crossplane-contrib/provider-jet-aws/apis/ec2/v1alpha2" + reference "github.com/crossplane/crossplane-runtime/pkg/reference" + errors "github.com/pkg/errors" + client "sigs.k8s.io/controller-runtime/pkg/client" +) + +// ResolveReferences of this Broker. +func (mg *Broker) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var mrsp reference.MultiResolutionResponse + var err error + + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.SubnetIds), + Extract: reference.ExternalName(), + References: mg.Spec.ForProvider.SubnetIdRefs, + Selector: mg.Spec.ForProvider.SubnetIdSelector, + To: reference.To{ + List: &v1alpha2.SubnetList{}, + Managed: &v1alpha2.Subnet{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.SubnetIds") + } + mg.Spec.ForProvider.SubnetIds = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.SubnetIdRefs = mrsp.ResolvedReferences + + return nil +} diff --git a/apis/mq/v1alpha2/zz_generated_terraformed.go b/apis/mq/v1alpha2/zz_generated_terraformed.go new file mode 100755 index 000000000..a195105ae --- /dev/null +++ b/apis/mq/v1alpha2/zz_generated_terraformed.go @@ -0,0 +1,174 @@ +/* +Copyright 2021 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by terrajet. DO NOT EDIT. + +package v1alpha2 + +import ( + "github.com/pkg/errors" + + "github.com/crossplane/terrajet/pkg/resource" + "github.com/crossplane/terrajet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this Broker +func (mg *Broker) GetTerraformResourceType() string { + return "aws_mq_broker" +} + +// GetConnectionDetailsMapping for this Broker +func (tr *Broker) GetConnectionDetailsMapping() map[string]string { + return map[string]string{"ldap_server_metadata[*].service_account_password": "spec.forProvider.ldapServerMetadata[*].serviceAccountPasswordSecretRef", "user[*].password": "spec.forProvider.user[*].passwordSecretRef"} +} + +// GetObservation of this Broker +func (tr *Broker) GetObservation() (map[string]interface{}, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]interface{}{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this Broker +func (tr *Broker) SetObservation(obs map[string]interface{}) error { + p, err := json.TFParser.Marshal(obs) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) +} + +// GetID returns ID of underlying Terraform resource of this Broker +func (tr *Broker) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Broker +func (tr *Broker) GetParameters() (map[string]interface{}, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]interface{}{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this Broker +func (tr *Broker) SetParameters(params map[string]interface{}) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// LateInitialize this Broker using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Broker) LateInitialize(attrs []byte) (bool, error) { + params := &BrokerParameters{} + if err := json.TFParser.Unmarshal(attrs, params); err != nil { + return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") + } + opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *Broker) GetTerraformSchemaVersion() int { + return 0 +} + +// GetTerraformResourceType returns Terraform resource type for this Configuration +func (mg *Configuration) GetTerraformResourceType() string { + return "aws_mq_configuration" +} + +// GetConnectionDetailsMapping for this Configuration +func (tr *Configuration) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this Configuration +func (tr *Configuration) GetObservation() (map[string]interface{}, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]interface{}{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this Configuration +func (tr *Configuration) SetObservation(obs map[string]interface{}) error { + p, err := json.TFParser.Marshal(obs) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) +} + +// GetID returns ID of underlying Terraform resource of this Configuration +func (tr *Configuration) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Configuration +func (tr *Configuration) GetParameters() (map[string]interface{}, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]interface{}{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this Configuration +func (tr *Configuration) SetParameters(params map[string]interface{}) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// LateInitialize this Configuration using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Configuration) LateInitialize(attrs []byte) (bool, error) { + params := &ConfigurationParameters_2{} + if err := json.TFParser.Unmarshal(attrs, params); err != nil { + return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") + } + opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *Configuration) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/mq/v1alpha2/zz_groupversion_info.go b/apis/mq/v1alpha2/zz_groupversion_info.go new file mode 100755 index 000000000..45881e270 --- /dev/null +++ b/apis/mq/v1alpha2/zz_groupversion_info.go @@ -0,0 +1,44 @@ +/* +Copyright 2021 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by terrajet. DO NOT EDIT. + +// +kubebuilder:object:generate=true +// +groupName=mq.aws.jet.crossplane.io +// +versionName=v1alpha2 +package v1alpha2 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +// Package type metadata. +const ( + CRDGroup = "mq.aws.jet.crossplane.io" + CRDVersion = "v1alpha2" +) + +var ( + // CRDGroupVersion is the API Group Version used to register the objects + CRDGroupVersion = schema.GroupVersion{Group: CRDGroup, Version: CRDVersion} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: CRDGroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/apis/zz_register.go b/apis/zz_register.go index bbe88ff96..df8d222db 100755 --- a/apis/zz_register.go +++ b/apis/zz_register.go @@ -32,6 +32,7 @@ import ( v1alpha2elbv2 "github.com/crossplane-contrib/provider-jet-aws/apis/elbv2/v1alpha2" v1alpha2iam "github.com/crossplane-contrib/provider-jet-aws/apis/iam/v1alpha2" v1alpha2kms "github.com/crossplane-contrib/provider-jet-aws/apis/kms/v1alpha2" + v1alpha2mq "github.com/crossplane-contrib/provider-jet-aws/apis/mq/v1alpha2" v1alpha2neptune "github.com/crossplane-contrib/provider-jet-aws/apis/neptune/v1alpha2" v1alpha2rds "github.com/crossplane-contrib/provider-jet-aws/apis/rds/v1alpha2" v1alpha2route53 "github.com/crossplane-contrib/provider-jet-aws/apis/route53/v1alpha2" @@ -53,6 +54,7 @@ func init() { v1alpha2elbv2.SchemeBuilder.AddToScheme, v1alpha2iam.SchemeBuilder.AddToScheme, v1alpha2kms.SchemeBuilder.AddToScheme, + v1alpha2mq.SchemeBuilder.AddToScheme, v1alpha2neptune.SchemeBuilder.AddToScheme, v1alpha2rds.SchemeBuilder.AddToScheme, v1alpha2route53.SchemeBuilder.AddToScheme, diff --git a/config/mq/config.go b/config/mq/config.go new file mode 100644 index 000000000..43037514c --- /dev/null +++ b/config/mq/config.go @@ -0,0 +1,43 @@ +/* +Copyright 2022 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package mq + +import ( + "github.com/crossplane/terrajet/pkg/config" + + "github.com/crossplane-contrib/provider-jet-aws/config/common" +) + +// Configure adds configurations for rds group. +func Configure(p *config.Provider) { + p.AddResourceConfigurator("aws_mq_broker", func(r *config.Resource) { + r.Version = common.VersionV1Alpha2 + // Due to a terrajet limitation, we cannot use "metedata.name" field as the name of the resource + // Therefore, "spec.forProvider.brokerName" field is not omitted + // Details can be found in https://github.com/crossplane/terrajet/issues/280 + r.ExternalName = config.IdentifierFromProvider + r.UseAsync = true + }) + p.AddResourceConfigurator("aws_mq_configuration", func(r *config.Resource) { + r.Version = common.VersionV1Alpha2 + // Due to a terrajet limitation, we cannot use "metedata.name" field as the name of the resource + // Therefore, "spec.forProvider.name" field is not omitted + // Details can be found in https://github.com/crossplane/terrajet/issues/280 + r.ExternalName = config.IdentifierFromProvider + }) + +} diff --git a/config/provider.go b/config/provider.go index 5eec73f91..f73e08859 100644 --- a/config/provider.go +++ b/config/provider.go @@ -20,6 +20,8 @@ import ( // Note(ezgidemirel): we are importing this to embed provider schema document _ "embed" + "github.com/crossplane-contrib/provider-jet-aws/config/mq" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" tjconfig "github.com/crossplane/terrajet/pkg/config" @@ -146,6 +148,10 @@ var IncludedResources = []string{ "aws_neptune_event_subscription", "aws_neptune_parameter_group$", "aws_neptune_subnet_group$", + + // MQ + "aws_mq_broker$", + "aws_mq_configuration$", } var skipList = []string{ @@ -197,6 +203,7 @@ func GetProvider() *tjconfig.Provider { s3.Configure, route53.Configure, neptune.Configure, + mq.Configure, } { configure(pc) } diff --git a/examples/mq/broker.yaml b/examples/mq/broker.yaml new file mode 100644 index 000000000..c624f11ef --- /dev/null +++ b/examples/mq/broker.yaml @@ -0,0 +1,19 @@ +apiVersion: mq.aws.jet.crossplane.io/v1alpha2 +kind: Broker +metadata: + name: example +spec: + forProvider: + # Due to an existing Terrajet limitation, we cannot use "metadata.name" for "brokerName" + # Details can be found in https://github.com/crossplane/terrajet/issues/280 + brokerName: example-broker + region: us-west-1 + engineType: ActiveMQ + engineVersion: 5.15.9 + hostInstanceType: mq.t2.micro + user: + - passwordSecretRef: + key: password + name: mq-secret + namespace: crossplane-system + username: admin \ No newline at end of file diff --git a/examples/mq/configuration.yaml b/examples/mq/configuration.yaml new file mode 100644 index 000000000..55090710d --- /dev/null +++ b/examples/mq/configuration.yaml @@ -0,0 +1,22 @@ +apiVersion: mq.aws.jet.crossplane.io/v1alpha2 +kind: Configuration +metadata: + name: example +spec: + forProvider: + # Due to an existing Terrajet limitation, we cannot use "metadata.name" for "name" + # Details can be found in https://github.com/crossplane/terrajet/issues/280 + name: example-config + region: us-west-1 + data: | + + + + + + + + + description: Example Configuration + engineType: ActiveMQ + engineVersion: 5.15.0 \ No newline at end of file diff --git a/internal/controller/mq/broker/zz_controller.go b/internal/controller/mq/broker/zz_controller.go new file mode 100755 index 000000000..7a54847f8 --- /dev/null +++ b/internal/controller/mq/broker/zz_controller.go @@ -0,0 +1,65 @@ +/* +Copyright 2021 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by terrajet. DO NOT EDIT. + +package broker + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + tjcontroller "github.com/crossplane/terrajet/pkg/controller" + "github.com/crossplane/terrajet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha2 "github.com/crossplane-contrib/provider-jet-aws/apis/mq/v1alpha2" +) + +// Setup adds a controller that reconciles Broker managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha2.Broker_GroupVersionKind.String()) + var initializers managed.InitializerChain + for _, i := range o.Provider.Resources["aws_mq_broker"].InitializerFns { + initializers = append(initializers, i(mgr.GetClient())) + } + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) + } + r := managed.NewReconciler(mgr, + xpresource.ManagedKind(v1alpha2.Broker_GroupVersionKind), + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["aws_mq_broker"], + tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha2.Broker_GroupVersionKind))), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3*time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + ) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + For(&v1alpha2.Broker{}). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/mq/configuration/zz_controller.go b/internal/controller/mq/configuration/zz_controller.go new file mode 100755 index 000000000..38d6f7539 --- /dev/null +++ b/internal/controller/mq/configuration/zz_controller.go @@ -0,0 +1,63 @@ +/* +Copyright 2021 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by terrajet. DO NOT EDIT. + +package configuration + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + tjcontroller "github.com/crossplane/terrajet/pkg/controller" + "github.com/crossplane/terrajet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha2 "github.com/crossplane-contrib/provider-jet-aws/apis/mq/v1alpha2" +) + +// Setup adds a controller that reconciles Configuration managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha2.Configuration_GroupVersionKind.String()) + var initializers managed.InitializerChain + for _, i := range o.Provider.Resources["aws_mq_configuration"].InitializerFns { + initializers = append(initializers, i(mgr.GetClient())) + } + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) + } + r := managed.NewReconciler(mgr, + xpresource.ManagedKind(v1alpha2.Configuration_GroupVersionKind), + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["aws_mq_configuration"])), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3*time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + ) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + For(&v1alpha2.Configuration{}). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index 25a55e985..cbc962b35 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -76,6 +76,8 @@ import ( usergroupmembership "github.com/crossplane-contrib/provider-jet-aws/internal/controller/iam/usergroupmembership" userpolicyattachment "github.com/crossplane-contrib/provider-jet-aws/internal/controller/iam/userpolicyattachment" key "github.com/crossplane-contrib/provider-jet-aws/internal/controller/kms/key" + broker "github.com/crossplane-contrib/provider-jet-aws/internal/controller/mq/broker" + configuration "github.com/crossplane-contrib/provider-jet-aws/internal/controller/mq/configuration" clusterneptune "github.com/crossplane-contrib/provider-jet-aws/internal/controller/neptune/cluster" clusterendpoint "github.com/crossplane-contrib/provider-jet-aws/internal/controller/neptune/clusterendpoint" clusterinstance "github.com/crossplane-contrib/provider-jet-aws/internal/controller/neptune/clusterinstance" @@ -170,6 +172,8 @@ func Setup(mgr ctrl.Manager, o controller.Options) error { usergroupmembership.Setup, userpolicyattachment.Setup, key.Setup, + broker.Setup, + configuration.Setup, clusterneptune.Setup, clusterendpoint.Setup, clusterinstance.Setup, diff --git a/package/crds/mq.aws.jet.crossplane.io_brokers.yaml b/package/crds/mq.aws.jet.crossplane.io_brokers.yaml new file mode 100644 index 000000000..1dc4c28c3 --- /dev/null +++ b/package/crds/mq.aws.jet.crossplane.io_brokers.yaml @@ -0,0 +1,425 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.8.0 + creationTimestamp: null + name: brokers.mq.aws.jet.crossplane.io +spec: + group: mq.aws.jet.crossplane.io + names: + categories: + - crossplane + - managed + - awsjet + kind: Broker + listKind: BrokerList + plural: brokers + singular: broker + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha2 + schema: + openAPIV3Schema: + description: Broker is the Schema for the Brokers API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: BrokerSpec defines the desired state of Broker + properties: + deletionPolicy: + default: Delete + description: DeletionPolicy specifies what will happen to the underlying + external when this managed resource is deleted - either "Delete" + or "Orphan" the external resource. + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + applyImmediately: + type: boolean + authenticationStrategy: + type: string + autoMinorVersionUpgrade: + type: boolean + brokerName: + type: string + configuration: + items: + properties: + id: + type: string + revision: + type: number + type: object + type: array + deploymentMode: + type: string + encryptionOptions: + items: + properties: + kmsKeyId: + type: string + useAwsOwnedKey: + type: boolean + type: object + type: array + engineType: + type: string + engineVersion: + type: string + hostInstanceType: + type: string + ldapServerMetadata: + items: + properties: + hosts: + items: + type: string + type: array + roleBase: + type: string + roleName: + type: string + roleSearchMatching: + type: string + roleSearchSubtree: + type: boolean + serviceAccountPasswordSecretRef: + description: A SecretKeySelector is a reference to a secret + key in an arbitrary namespace. + properties: + key: + description: The key to select. + type: string + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - key + - name + - namespace + type: object + serviceAccountUsername: + type: string + userBase: + type: string + userRoleName: + type: string + userSearchMatching: + type: string + userSearchSubtree: + type: boolean + type: object + type: array + logs: + items: + properties: + audit: + type: string + general: + type: boolean + type: object + type: array + maintenanceWindowStartTime: + items: + properties: + dayOfWeek: + type: string + timeOfDay: + type: string + timeZone: + type: string + required: + - dayOfWeek + - timeOfDay + - timeZone + type: object + type: array + publiclyAccessible: + type: boolean + region: + description: Region is the region you'd like your resource to + be created in. + type: string + securityGroups: + items: + type: string + type: array + storageType: + type: string + subnetIdRefs: + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + required: + - name + type: object + type: array + subnetIdSelector: + description: A Selector selects an object. + properties: + matchControllerRef: + description: MatchControllerRef ensures an object with the + same controller reference as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + type: object + subnetIds: + items: + type: string + type: array + tags: + additionalProperties: + type: string + type: object + user: + items: + properties: + consoleAccess: + type: boolean + groups: + items: + type: string + type: array + passwordSecretRef: + description: A SecretKeySelector is a reference to a secret + key in an arbitrary namespace. + properties: + key: + description: The key to select. + type: string + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - key + - name + - namespace + type: object + username: + type: string + required: + - passwordSecretRef + - username + type: object + type: array + required: + - brokerName + - engineType + - engineVersion + - hostInstanceType + - region + - user + type: object + providerConfigRef: + default: + name: default + description: ProviderConfigReference specifies how the provider that + will be used to create, observe, update, and delete this managed + resource should be configured. + properties: + name: + description: Name of the referenced object. + type: string + required: + - name + type: object + providerRef: + description: 'ProviderReference specifies the provider that will be + used to create, observe, update, and delete this managed resource. + Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + properties: + name: + description: Name of the referenced object. + type: string + required: + - name + type: object + publishConnectionDetailsTo: + description: PublishConnectionDetailsTo specifies the connection secret + config which contains a name, metadata and a reference to secret + store config to which any connection details for this managed resource + should be written. Connection details frequently include the endpoint, + username, and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: SecretStoreConfigRef specifies which secret store + config should be used for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: Annotations are the annotations to be added to + connection secret. - For Kubernetes secrets, this will be + used as "metadata.annotations". - It is up to Secret Store + implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: Labels are the labels/tags to be added to connection + secret. - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store + types. + type: object + type: + description: Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: WriteConnectionSecretToReference specifies the namespace + and name of a Secret to which any connection details for this managed + resource should be written. Connection details frequently include + the endpoint, username, and password required to connect to the + managed resource. This field is planned to be replaced in a future + release in favor of PublishConnectionDetailsTo. Currently, both + could be set independently and connection details would be published + to both without affecting each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + status: + description: BrokerStatus defines the observed state of Broker. + properties: + atProvider: + properties: + arn: + type: string + id: + type: string + instances: + items: + properties: + consoleUrl: + type: string + endpoints: + items: + type: string + type: array + ipAddress: + type: string + type: object + type: array + tagsAll: + additionalProperties: + type: string + type: object + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: LastTransitionTime is the last time this condition + transitioned from one status to another. + format: date-time + type: string + message: + description: A Message containing details about this condition's + last transition from one status to another, if any. + type: string + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: Type of this condition. At most one of each condition + type may apply to a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/package/crds/mq.aws.jet.crossplane.io_configurations.yaml b/package/crds/mq.aws.jet.crossplane.io_configurations.yaml new file mode 100644 index 000000000..e5d296fe6 --- /dev/null +++ b/package/crds/mq.aws.jet.crossplane.io_configurations.yaml @@ -0,0 +1,251 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.8.0 + creationTimestamp: null + name: configurations.mq.aws.jet.crossplane.io +spec: + group: mq.aws.jet.crossplane.io + names: + categories: + - crossplane + - managed + - awsjet + kind: Configuration + listKind: ConfigurationList + plural: configurations + singular: configuration + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha2 + schema: + openAPIV3Schema: + description: Configuration is the Schema for the Configurations API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: ConfigurationSpec defines the desired state of Configuration + properties: + deletionPolicy: + default: Delete + description: DeletionPolicy specifies what will happen to the underlying + external when this managed resource is deleted - either "Delete" + or "Orphan" the external resource. + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + authenticationStrategy: + type: string + data: + type: string + description: + type: string + engineType: + type: string + engineVersion: + type: string + name: + type: string + region: + description: Region is the region you'd like your resource to + be created in. + type: string + tags: + additionalProperties: + type: string + type: object + required: + - data + - engineType + - engineVersion + - name + - region + type: object + providerConfigRef: + default: + name: default + description: ProviderConfigReference specifies how the provider that + will be used to create, observe, update, and delete this managed + resource should be configured. + properties: + name: + description: Name of the referenced object. + type: string + required: + - name + type: object + providerRef: + description: 'ProviderReference specifies the provider that will be + used to create, observe, update, and delete this managed resource. + Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + properties: + name: + description: Name of the referenced object. + type: string + required: + - name + type: object + publishConnectionDetailsTo: + description: PublishConnectionDetailsTo specifies the connection secret + config which contains a name, metadata and a reference to secret + store config to which any connection details for this managed resource + should be written. Connection details frequently include the endpoint, + username, and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: SecretStoreConfigRef specifies which secret store + config should be used for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: Annotations are the annotations to be added to + connection secret. - For Kubernetes secrets, this will be + used as "metadata.annotations". - It is up to Secret Store + implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: Labels are the labels/tags to be added to connection + secret. - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store + types. + type: object + type: + description: Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: WriteConnectionSecretToReference specifies the namespace + and name of a Secret to which any connection details for this managed + resource should be written. Connection details frequently include + the endpoint, username, and password required to connect to the + managed resource. This field is planned to be replaced in a future + release in favor of PublishConnectionDetailsTo. Currently, both + could be set independently and connection details would be published + to both without affecting each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + status: + description: ConfigurationStatus defines the observed state of Configuration. + properties: + atProvider: + properties: + arn: + type: string + id: + type: string + latestRevision: + type: number + tagsAll: + additionalProperties: + type: string + type: object + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: LastTransitionTime is the last time this condition + transitioned from one status to another. + format: date-time + type: string + message: + description: A Message containing details about this condition's + last transition from one status to another, if any. + type: string + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: Type of this condition. At most one of each condition + type may apply to a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: []