diff --git a/apis/cluster/opensearchserverless/v1beta1/zz_collection_types.go b/apis/cluster/opensearchserverless/v1beta1/zz_collection_types.go index 1d891bbfdf..2f5bab30e4 100755 --- a/apis/cluster/opensearchserverless/v1beta1/zz_collection_types.go +++ b/apis/cluster/opensearchserverless/v1beta1/zz_collection_types.go @@ -17,8 +17,18 @@ type CollectionInitParameters struct { // Name of the collection group to associate with this collection. // Name of the collection group to associate with this collection. + // +crossplane:generate:reference:type=github.com/upbound/provider-aws/v2/apis/cluster/opensearchserverless/v1beta1.CollectionGroup + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/v2/pkg/resource.ExtractParamPath("name",false) CollectionGroupName *string `json:"collectionGroupName,omitempty" tf:"collection_group_name,omitempty"` + // Reference to a CollectionGroup in opensearchserverless to populate collectionGroupName. + // +kubebuilder:validation:Optional + CollectionGroupNameRef *v2.Reference `json:"collectionGroupNameRef,omitempty" tf:"-"` + + // Selector for a CollectionGroup in opensearchserverless to populate collectionGroupName. + // +kubebuilder:validation:Optional + CollectionGroupNameSelector *v2.Selector `json:"collectionGroupNameSelector,omitempty" tf:"-"` + // Description of the collection. // Description of the collection. Description *string `json:"description,omitempty" tf:"description,omitempty"` @@ -109,9 +119,19 @@ type CollectionParameters struct { // Name of the collection group to associate with this collection. // Name of the collection group to associate with this collection. + // +crossplane:generate:reference:type=github.com/upbound/provider-aws/v2/apis/cluster/opensearchserverless/v1beta1.CollectionGroup + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/v2/pkg/resource.ExtractParamPath("name",false) // +kubebuilder:validation:Optional CollectionGroupName *string `json:"collectionGroupName,omitempty" tf:"collection_group_name,omitempty"` + // Reference to a CollectionGroup in opensearchserverless to populate collectionGroupName. + // +kubebuilder:validation:Optional + CollectionGroupNameRef *v2.Reference `json:"collectionGroupNameRef,omitempty" tf:"-"` + + // Selector for a CollectionGroup in opensearchserverless to populate collectionGroupName. + // +kubebuilder:validation:Optional + CollectionGroupNameSelector *v2.Selector `json:"collectionGroupNameSelector,omitempty" tf:"-"` + // Description of the collection. // Description of the collection. // +kubebuilder:validation:Optional diff --git a/apis/cluster/opensearchserverless/v1beta1/zz_collectiongroup_terraformed.go b/apis/cluster/opensearchserverless/v1beta1/zz_collectiongroup_terraformed.go new file mode 100755 index 0000000000..519da21f9f --- /dev/null +++ b/apis/cluster/opensearchserverless/v1beta1/zz_collectiongroup_terraformed.go @@ -0,0 +1,131 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1beta1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/v2/pkg/resource" + "github.com/crossplane/upjet/v2/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this CollectionGroup +func (mg *CollectionGroup) GetTerraformResourceType() string { + return "aws_opensearchserverless_collection_group" +} + +// GetConnectionDetailsMapping for this CollectionGroup +func (tr *CollectionGroup) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this CollectionGroup +func (tr *CollectionGroup) GetObservation() (map[string]any, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this CollectionGroup +func (tr *CollectionGroup) SetObservation(obs map[string]any) error { + tr.Status.AtProvider.Tags = nil + tr.Status.AtProvider.TagsAll = nil + 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 CollectionGroup +func (tr *CollectionGroup) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this CollectionGroup +func (tr *CollectionGroup) GetParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this CollectionGroup +func (tr *CollectionGroup) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// GetInitParameters of this CollectionGroup +func (tr *CollectionGroup) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this CollectionGroup +func (tr *CollectionGroup) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource \"%s/%s\"", tr.GetNamespace(), tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource \"%s/%s\"", tr.GetNamespace(), tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource \"%s/%s\"", tr.GetNamespace(), tr.GetName()) + } + + return params, nil +} + +// LateInitialize this CollectionGroup using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *CollectionGroup) LateInitialize(attrs []byte) (bool, error) { + params := &CollectionGroupParameters{} + 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 *CollectionGroup) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/cluster/opensearchserverless/v1beta1/zz_collectiongroup_types.go b/apis/cluster/opensearchserverless/v1beta1/zz_collectiongroup_types.go new file mode 100755 index 0000000000..6f1a38e1df --- /dev/null +++ b/apis/cluster/opensearchserverless/v1beta1/zz_collectiongroup_types.go @@ -0,0 +1,233 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v2 "github.com/crossplane/crossplane/apis/v2/core/v2" +) + +type CapacityLimitsInitParameters struct { + + // Maximum indexing capacity, in OpenSearch Compute Units (OCUs), for the collection group. + MaxIndexingCapacityInOcu *float64 `json:"maxIndexingCapacityInOcu,omitempty" tf:"max_indexing_capacity_in_ocu"` + + // Maximum search capacity, in OpenSearch Compute Units (OCUs), for the collection group. + MaxSearchCapacityInOcu *float64 `json:"maxSearchCapacityInOcu,omitempty" tf:"max_search_capacity_in_ocu"` + + // Minimum indexing capacity, in OpenSearch Compute Units (OCUs), for the collection group. + MinIndexingCapacityInOcu *float64 `json:"minIndexingCapacityInOcu,omitempty" tf:"min_indexing_capacity_in_ocu"` + + // Minimum search capacity, in OpenSearch Compute Units (OCUs), for the collection group. + MinSearchCapacityInOcu *float64 `json:"minSearchCapacityInOcu,omitempty" tf:"min_search_capacity_in_ocu"` +} + +type CapacityLimitsObservation struct { + + // Maximum indexing capacity, in OpenSearch Compute Units (OCUs), for the collection group. + MaxIndexingCapacityInOcu *float64 `json:"maxIndexingCapacityInOcu,omitempty" tf:"max_indexing_capacity_in_ocu,omitempty"` + + // Maximum search capacity, in OpenSearch Compute Units (OCUs), for the collection group. + MaxSearchCapacityInOcu *float64 `json:"maxSearchCapacityInOcu,omitempty" tf:"max_search_capacity_in_ocu,omitempty"` + + // Minimum indexing capacity, in OpenSearch Compute Units (OCUs), for the collection group. + MinIndexingCapacityInOcu *float64 `json:"minIndexingCapacityInOcu,omitempty" tf:"min_indexing_capacity_in_ocu,omitempty"` + + // Minimum search capacity, in OpenSearch Compute Units (OCUs), for the collection group. + MinSearchCapacityInOcu *float64 `json:"minSearchCapacityInOcu,omitempty" tf:"min_search_capacity_in_ocu,omitempty"` +} + +type CapacityLimitsParameters struct { + + // Maximum indexing capacity, in OpenSearch Compute Units (OCUs), for the collection group. + // +kubebuilder:validation:Optional + MaxIndexingCapacityInOcu *float64 `json:"maxIndexingCapacityInOcu,omitempty" tf:"max_indexing_capacity_in_ocu"` + + // Maximum search capacity, in OpenSearch Compute Units (OCUs), for the collection group. + // +kubebuilder:validation:Optional + MaxSearchCapacityInOcu *float64 `json:"maxSearchCapacityInOcu,omitempty" tf:"max_search_capacity_in_ocu"` + + // Minimum indexing capacity, in OpenSearch Compute Units (OCUs), for the collection group. + // +kubebuilder:validation:Optional + MinIndexingCapacityInOcu *float64 `json:"minIndexingCapacityInOcu,omitempty" tf:"min_indexing_capacity_in_ocu"` + + // Minimum search capacity, in OpenSearch Compute Units (OCUs), for the collection group. + // +kubebuilder:validation:Optional + MinSearchCapacityInOcu *float64 `json:"minSearchCapacityInOcu,omitempty" tf:"min_search_capacity_in_ocu"` +} + +type CollectionGroupInitParameters struct { + + // Configuration block for the collection group's indexing and search capacity limits. See capacity_limits below for details. + CapacityLimits *CapacityLimitsInitParameters `json:"capacityLimits,omitempty" tf:"capacity_limits,omitempty"` + + // Description of the collection group. + // Description of the collection group. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // Generation of Amazon OpenSearch Serverless for the collection group. Valid values are CLASSIC and NEXTGEN. Default value is CLASSIC. + // Generation of the collection group. + Generation *string `json:"generation,omitempty" tf:"generation,omitempty"` + + // Name of the collection group. + // Name of the collection group. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // Indicates whether standby replicas should be used for collections in this group. Valid values are ENABLED and DISABLED. If generation is set to NEXTGEN, this argument must be set to ENABLED. + // Indicates whether standby replicas should be used for collections in this group. One of `ENABLED` or `DISABLED`. + StandbyReplicas *string `json:"standbyReplicas,omitempty" tf:"standby_replicas,omitempty"` + + // Key-value map of resource tags. + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` +} + +type CollectionGroupObservation struct { + + // Amazon Resource Name (ARN) of the collection group. + Arn *string `json:"arn,omitempty" tf:"arn,omitempty"` + + // Configuration block for the collection group's indexing and search capacity limits. See capacity_limits below for details. + CapacityLimits *CapacityLimitsObservation `json:"capacityLimits,omitempty" tf:"capacity_limits,omitempty"` + + // Date the collection group was created. + // Date the collection group was created. + CreatedDate *string `json:"createdDate,omitempty" tf:"created_date,omitempty"` + + // Description of the collection group. + // Description of the collection group. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // Generation of Amazon OpenSearch Serverless for the collection group. Valid values are CLASSIC and NEXTGEN. Default value is CLASSIC. + // Generation of the collection group. + Generation *string `json:"generation,omitempty" tf:"generation,omitempty"` + + // Unique identifier for the collection group. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // Name of the collection group. + // Name of the collection group. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // Region where this resource will be managed. Defaults to the Region set in the provider configuration. + // Region is the region you'd like your resource to be created in. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Indicates whether standby replicas should be used for collections in this group. Valid values are ENABLED and DISABLED. If generation is set to NEXTGEN, this argument must be set to ENABLED. + // Indicates whether standby replicas should be used for collections in this group. One of `ENABLED` or `DISABLED`. + StandbyReplicas *string `json:"standbyReplicas,omitempty" tf:"standby_replicas,omitempty"` + + // Key-value map of resource tags. + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block. + // +mapType=granular + TagsAll map[string]*string `json:"tagsAll,omitempty" tf:"tags_all,omitempty"` +} + +type CollectionGroupParameters struct { + + // Configuration block for the collection group's indexing and search capacity limits. See capacity_limits below for details. + // +kubebuilder:validation:Optional + CapacityLimits *CapacityLimitsParameters `json:"capacityLimits,omitempty" tf:"capacity_limits,omitempty"` + + // Description of the collection group. + // Description of the collection group. + // +kubebuilder:validation:Optional + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // Generation of Amazon OpenSearch Serverless for the collection group. Valid values are CLASSIC and NEXTGEN. Default value is CLASSIC. + // Generation of the collection group. + // +kubebuilder:validation:Optional + Generation *string `json:"generation,omitempty" tf:"generation,omitempty"` + + // Name of the collection group. + // Name of the collection group. + // +kubebuilder:validation:Optional + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // Region where this resource will be managed. Defaults to the Region set in the provider configuration. + // Region is the region you'd like your resource to be created in. + // +kubebuilder:validation:Required + Region *string `json:"region" tf:"region,omitempty"` + + // Indicates whether standby replicas should be used for collections in this group. Valid values are ENABLED and DISABLED. If generation is set to NEXTGEN, this argument must be set to ENABLED. + // Indicates whether standby replicas should be used for collections in this group. One of `ENABLED` or `DISABLED`. + // +kubebuilder:validation:Optional + StandbyReplicas *string `json:"standbyReplicas,omitempty" tf:"standby_replicas,omitempty"` + + // Key-value map of resource tags. + // +kubebuilder:validation:Optional + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` +} + +// CollectionGroupSpec defines the desired state of CollectionGroup +type CollectionGroupSpec struct { + v2.ClusterManagedResourceSpec `json:",inline"` + ForProvider CollectionGroupParameters `json:"forProvider"` + // THIS IS A BETA FIELD. It will be honored + // unless the Management Policies feature flag is disabled. + // InitProvider holds the same fields as ForProvider, with the exception + // of Identifier and other resource reference fields. The fields that are + // in InitProvider are merged into ForProvider when the resource is created. + // The same fields are also added to the terraform ignore_changes hook, to + // avoid updating them after creation. This is useful for fields that are + // required on creation, but we do not desire to update them after creation, + // for example because of an external controller is managing them, like an + // autoscaler. + InitProvider CollectionGroupInitParameters `json:"initProvider,omitempty"` +} + +// CollectionGroupStatus defines the observed state of CollectionGroup. +type CollectionGroupStatus struct { + v2.ManagedResourceStatus `json:",inline"` + AtProvider CollectionGroupObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// CollectionGroup is the Schema for the CollectionGroups API. +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].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:resource:scope=Cluster,categories={crossplane,managed,aws} +type CollectionGroup struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.name) || (has(self.initProvider) && has(self.initProvider.name))",message="spec.forProvider.name is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.standbyReplicas) || (has(self.initProvider) && has(self.initProvider.standbyReplicas))",message="spec.forProvider.standbyReplicas is a required parameter" + Spec CollectionGroupSpec `json:"spec"` + Status CollectionGroupStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// CollectionGroupList contains a list of CollectionGroups +type CollectionGroupList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []CollectionGroup `json:"items"` +} + +// Repository type metadata. +var ( + CollectionGroup_Kind = "CollectionGroup" + CollectionGroup_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: CollectionGroup_Kind}.String() + CollectionGroup_KindAPIVersion = CollectionGroup_Kind + "." + CRDGroupVersion.String() + CollectionGroup_GroupVersionKind = CRDGroupVersion.WithKind(CollectionGroup_Kind) +) + +func init() { + SchemeBuilder.Register(&CollectionGroup{}, &CollectionGroupList{}) +} diff --git a/apis/cluster/opensearchserverless/v1beta1/zz_generated.conversion_hubs.go b/apis/cluster/opensearchserverless/v1beta1/zz_generated.conversion_hubs.go index 89e575faa8..bf84121280 100755 --- a/apis/cluster/opensearchserverless/v1beta1/zz_generated.conversion_hubs.go +++ b/apis/cluster/opensearchserverless/v1beta1/zz_generated.conversion_hubs.go @@ -12,6 +12,9 @@ func (tr *AccessPolicy) Hub() {} // Hub marks this type as a conversion hub. func (tr *Collection) Hub() {} +// Hub marks this type as a conversion hub. +func (tr *CollectionGroup) Hub() {} + // Hub marks this type as a conversion hub. func (tr *LifecyclePolicy) Hub() {} diff --git a/apis/cluster/opensearchserverless/v1beta1/zz_generated.deepcopy.go b/apis/cluster/opensearchserverless/v1beta1/zz_generated.deepcopy.go index 683fd7ec04..579acd3161 100644 --- a/apis/cluster/opensearchserverless/v1beta1/zz_generated.deepcopy.go +++ b/apis/cluster/opensearchserverless/v1beta1/zz_generated.deepcopy.go @@ -217,6 +217,111 @@ func (in *AccessPolicyStatus) DeepCopy() *AccessPolicyStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CapacityLimitsInitParameters) DeepCopyInto(out *CapacityLimitsInitParameters) { + *out = *in + if in.MaxIndexingCapacityInOcu != nil { + in, out := &in.MaxIndexingCapacityInOcu, &out.MaxIndexingCapacityInOcu + *out = new(float64) + **out = **in + } + if in.MaxSearchCapacityInOcu != nil { + in, out := &in.MaxSearchCapacityInOcu, &out.MaxSearchCapacityInOcu + *out = new(float64) + **out = **in + } + if in.MinIndexingCapacityInOcu != nil { + in, out := &in.MinIndexingCapacityInOcu, &out.MinIndexingCapacityInOcu + *out = new(float64) + **out = **in + } + if in.MinSearchCapacityInOcu != nil { + in, out := &in.MinSearchCapacityInOcu, &out.MinSearchCapacityInOcu + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CapacityLimitsInitParameters. +func (in *CapacityLimitsInitParameters) DeepCopy() *CapacityLimitsInitParameters { + if in == nil { + return nil + } + out := new(CapacityLimitsInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CapacityLimitsObservation) DeepCopyInto(out *CapacityLimitsObservation) { + *out = *in + if in.MaxIndexingCapacityInOcu != nil { + in, out := &in.MaxIndexingCapacityInOcu, &out.MaxIndexingCapacityInOcu + *out = new(float64) + **out = **in + } + if in.MaxSearchCapacityInOcu != nil { + in, out := &in.MaxSearchCapacityInOcu, &out.MaxSearchCapacityInOcu + *out = new(float64) + **out = **in + } + if in.MinIndexingCapacityInOcu != nil { + in, out := &in.MinIndexingCapacityInOcu, &out.MinIndexingCapacityInOcu + *out = new(float64) + **out = **in + } + if in.MinSearchCapacityInOcu != nil { + in, out := &in.MinSearchCapacityInOcu, &out.MinSearchCapacityInOcu + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CapacityLimitsObservation. +func (in *CapacityLimitsObservation) DeepCopy() *CapacityLimitsObservation { + if in == nil { + return nil + } + out := new(CapacityLimitsObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CapacityLimitsParameters) DeepCopyInto(out *CapacityLimitsParameters) { + *out = *in + if in.MaxIndexingCapacityInOcu != nil { + in, out := &in.MaxIndexingCapacityInOcu, &out.MaxIndexingCapacityInOcu + *out = new(float64) + **out = **in + } + if in.MaxSearchCapacityInOcu != nil { + in, out := &in.MaxSearchCapacityInOcu, &out.MaxSearchCapacityInOcu + *out = new(float64) + **out = **in + } + if in.MinIndexingCapacityInOcu != nil { + in, out := &in.MinIndexingCapacityInOcu, &out.MinIndexingCapacityInOcu + *out = new(float64) + **out = **in + } + if in.MinSearchCapacityInOcu != nil { + in, out := &in.MinSearchCapacityInOcu, &out.MinSearchCapacityInOcu + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CapacityLimitsParameters. +func (in *CapacityLimitsParameters) DeepCopy() *CapacityLimitsParameters { + if in == nil { + return nil + } + out := new(CapacityLimitsParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Collection) DeepCopyInto(out *Collection) { *out = *in @@ -244,6 +349,309 @@ func (in *Collection) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CollectionGroup) DeepCopyInto(out *CollectionGroup) { + *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 CollectionGroup. +func (in *CollectionGroup) DeepCopy() *CollectionGroup { + if in == nil { + return nil + } + out := new(CollectionGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CollectionGroup) 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 *CollectionGroupInitParameters) DeepCopyInto(out *CollectionGroupInitParameters) { + *out = *in + if in.CapacityLimits != nil { + in, out := &in.CapacityLimits, &out.CapacityLimits + *out = new(CapacityLimitsInitParameters) + (*in).DeepCopyInto(*out) + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Generation != nil { + in, out := &in.Generation, &out.Generation + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.StandbyReplicas != nil { + in, out := &in.StandbyReplicas, &out.StandbyReplicas + *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 { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CollectionGroupInitParameters. +func (in *CollectionGroupInitParameters) DeepCopy() *CollectionGroupInitParameters { + if in == nil { + return nil + } + out := new(CollectionGroupInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CollectionGroupList) DeepCopyInto(out *CollectionGroupList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CollectionGroup, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CollectionGroupList. +func (in *CollectionGroupList) DeepCopy() *CollectionGroupList { + if in == nil { + return nil + } + out := new(CollectionGroupList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CollectionGroupList) 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 *CollectionGroupObservation) DeepCopyInto(out *CollectionGroupObservation) { + *out = *in + if in.Arn != nil { + in, out := &in.Arn, &out.Arn + *out = new(string) + **out = **in + } + if in.CapacityLimits != nil { + in, out := &in.CapacityLimits, &out.CapacityLimits + *out = new(CapacityLimitsObservation) + (*in).DeepCopyInto(*out) + } + if in.CreatedDate != nil { + in, out := &in.CreatedDate, &out.CreatedDate + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Generation != nil { + in, out := &in.Generation, &out.Generation + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *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.StandbyReplicas != nil { + in, out := &in.StandbyReplicas, &out.StandbyReplicas + *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 { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + 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 { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CollectionGroupObservation. +func (in *CollectionGroupObservation) DeepCopy() *CollectionGroupObservation { + if in == nil { + return nil + } + out := new(CollectionGroupObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CollectionGroupParameters) DeepCopyInto(out *CollectionGroupParameters) { + *out = *in + if in.CapacityLimits != nil { + in, out := &in.CapacityLimits, &out.CapacityLimits + *out = new(CapacityLimitsParameters) + (*in).DeepCopyInto(*out) + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Generation != nil { + in, out := &in.Generation, &out.Generation + *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.StandbyReplicas != nil { + in, out := &in.StandbyReplicas, &out.StandbyReplicas + *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 { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CollectionGroupParameters. +func (in *CollectionGroupParameters) DeepCopy() *CollectionGroupParameters { + if in == nil { + return nil + } + out := new(CollectionGroupParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CollectionGroupSpec) DeepCopyInto(out *CollectionGroupSpec) { + *out = *in + in.ClusterManagedResourceSpec.DeepCopyInto(&out.ClusterManagedResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) + in.InitProvider.DeepCopyInto(&out.InitProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CollectionGroupSpec. +func (in *CollectionGroupSpec) DeepCopy() *CollectionGroupSpec { + if in == nil { + return nil + } + out := new(CollectionGroupSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CollectionGroupStatus) DeepCopyInto(out *CollectionGroupStatus) { + *out = *in + in.ManagedResourceStatus.DeepCopyInto(&out.ManagedResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CollectionGroupStatus. +func (in *CollectionGroupStatus) DeepCopy() *CollectionGroupStatus { + if in == nil { + return nil + } + out := new(CollectionGroupStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CollectionInitParameters) DeepCopyInto(out *CollectionInitParameters) { *out = *in @@ -252,6 +660,16 @@ func (in *CollectionInitParameters) DeepCopyInto(out *CollectionInitParameters) *out = new(string) **out = **in } + if in.CollectionGroupNameRef != nil { + in, out := &in.CollectionGroupNameRef, &out.CollectionGroupNameRef + *out = new(v2.Reference) + (*in).DeepCopyInto(*out) + } + if in.CollectionGroupNameSelector != nil { + in, out := &in.CollectionGroupNameSelector, &out.CollectionGroupNameSelector + *out = new(v2.Selector) + (*in).DeepCopyInto(*out) + } if in.Description != nil { in, out := &in.Description, &out.Description *out = new(string) @@ -462,6 +880,16 @@ func (in *CollectionParameters) DeepCopyInto(out *CollectionParameters) { *out = new(string) **out = **in } + if in.CollectionGroupNameRef != nil { + in, out := &in.CollectionGroupNameRef, &out.CollectionGroupNameRef + *out = new(v2.Reference) + (*in).DeepCopyInto(*out) + } + if in.CollectionGroupNameSelector != nil { + in, out := &in.CollectionGroupNameSelector, &out.CollectionGroupNameSelector + *out = new(v2.Selector) + (*in).DeepCopyInto(*out) + } if in.Description != nil { in, out := &in.Description, &out.Description *out = new(string) diff --git a/apis/cluster/opensearchserverless/v1beta1/zz_generated.managed.go b/apis/cluster/opensearchserverless/v1beta1/zz_generated.managed.go index a5565d9482..16c51ff00e 100644 --- a/apis/cluster/opensearchserverless/v1beta1/zz_generated.managed.go +++ b/apis/cluster/opensearchserverless/v1beta1/zz_generated.managed.go @@ -107,6 +107,56 @@ func (mg *Collection) SetWriteConnectionSecretToReference(r *xpv2.SecretReferenc mg.Spec.WriteConnectionSecretToReference = r } +// GetCondition of this CollectionGroup. +func (mg *CollectionGroup) GetCondition(ct xpv2.ConditionType) xpv2.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this CollectionGroup. +func (mg *CollectionGroup) GetDeletionPolicy() xpv2.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this CollectionGroup. +func (mg *CollectionGroup) GetManagementPolicies() xpv2.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this CollectionGroup. +func (mg *CollectionGroup) GetProviderConfigReference() *xpv2.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetWriteConnectionSecretToReference of this CollectionGroup. +func (mg *CollectionGroup) GetWriteConnectionSecretToReference() *xpv2.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this CollectionGroup. +func (mg *CollectionGroup) SetConditions(c ...xpv2.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this CollectionGroup. +func (mg *CollectionGroup) SetDeletionPolicy(r xpv2.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this CollectionGroup. +func (mg *CollectionGroup) SetManagementPolicies(r xpv2.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this CollectionGroup. +func (mg *CollectionGroup) SetProviderConfigReference(r *xpv2.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetWriteConnectionSecretToReference of this CollectionGroup. +func (mg *CollectionGroup) SetWriteConnectionSecretToReference(r *xpv2.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + // GetCondition of this LifecyclePolicy. func (mg *LifecyclePolicy) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return mg.Status.GetCondition(ct) diff --git a/apis/cluster/opensearchserverless/v1beta1/zz_generated.managedlist.go b/apis/cluster/opensearchserverless/v1beta1/zz_generated.managedlist.go index 7637d0db9e..a8deb8e165 100644 --- a/apis/cluster/opensearchserverless/v1beta1/zz_generated.managedlist.go +++ b/apis/cluster/opensearchserverless/v1beta1/zz_generated.managedlist.go @@ -16,6 +16,15 @@ func (l *AccessPolicyList) GetItems() []resource.Managed { return items } +// GetItems of this CollectionGroupList. +func (l *CollectionGroupList) 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 CollectionList. func (l *CollectionList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) diff --git a/apis/cluster/opensearchserverless/v1beta1/zz_generated.resolvers.go b/apis/cluster/opensearchserverless/v1beta1/zz_generated.resolvers.go index 0e70b50bae..3208494054 100644 --- a/apis/cluster/opensearchserverless/v1beta1/zz_generated.resolvers.go +++ b/apis/cluster/opensearchserverless/v1beta1/zz_generated.resolvers.go @@ -24,6 +24,26 @@ func (mg *Collection) ResolveReferences( // ResolveReferences of this Collection var rsp reference.ResolutionResponse var err error + { + m, l, err = apisresolver.GetManagedResource("opensearchserverless.aws.upbound.io", "v1beta1", "CollectionGroup", "CollectionGroupList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.CollectionGroupName), + Extract: resource.ExtractParamPath("name", false), + Namespace: mg.GetNamespace(), + Reference: mg.Spec.ForProvider.CollectionGroupNameRef, + Selector: mg.Spec.ForProvider.CollectionGroupNameSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.CollectionGroupName") + } + mg.Spec.ForProvider.CollectionGroupName = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.CollectionGroupNameRef = rsp.ResolvedReference if mg.Spec.ForProvider.EncryptionConfig != nil { { @@ -47,6 +67,26 @@ func (mg *Collection) ResolveReferences( // ResolveReferences of this Collection mg.Spec.ForProvider.EncryptionConfig.KMSKeyArnRef = rsp.ResolvedReference } + { + m, l, err = apisresolver.GetManagedResource("opensearchserverless.aws.upbound.io", "v1beta1", "CollectionGroup", "CollectionGroupList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.CollectionGroupName), + Extract: resource.ExtractParamPath("name", false), + Namespace: mg.GetNamespace(), + Reference: mg.Spec.InitProvider.CollectionGroupNameRef, + Selector: mg.Spec.InitProvider.CollectionGroupNameSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.CollectionGroupName") + } + mg.Spec.InitProvider.CollectionGroupName = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.CollectionGroupNameRef = rsp.ResolvedReference + if mg.Spec.InitProvider.EncryptionConfig != nil { { m, l, err = apisresolver.GetManagedResource("kms.aws.upbound.io", "v1beta1", "Key", "KeyList") diff --git a/apis/namespaced/opensearchserverless/v1beta1/zz_collection_types.go b/apis/namespaced/opensearchserverless/v1beta1/zz_collection_types.go index f7df1a50e8..90afef0401 100755 --- a/apis/namespaced/opensearchserverless/v1beta1/zz_collection_types.go +++ b/apis/namespaced/opensearchserverless/v1beta1/zz_collection_types.go @@ -17,8 +17,18 @@ type CollectionInitParameters struct { // Name of the collection group to associate with this collection. // Name of the collection group to associate with this collection. + // +crossplane:generate:reference:type=github.com/upbound/provider-aws/v2/apis/namespaced/opensearchserverless/v1beta1.CollectionGroup + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/v2/pkg/resource.ExtractParamPath("name",false) CollectionGroupName *string `json:"collectionGroupName,omitempty" tf:"collection_group_name,omitempty"` + // Reference to a CollectionGroup in opensearchserverless to populate collectionGroupName. + // +kubebuilder:validation:Optional + CollectionGroupNameRef *v2.NamespacedReference `json:"collectionGroupNameRef,omitempty" tf:"-"` + + // Selector for a CollectionGroup in opensearchserverless to populate collectionGroupName. + // +kubebuilder:validation:Optional + CollectionGroupNameSelector *v2.NamespacedSelector `json:"collectionGroupNameSelector,omitempty" tf:"-"` + // Description of the collection. // Description of the collection. Description *string `json:"description,omitempty" tf:"description,omitempty"` @@ -109,9 +119,19 @@ type CollectionParameters struct { // Name of the collection group to associate with this collection. // Name of the collection group to associate with this collection. + // +crossplane:generate:reference:type=github.com/upbound/provider-aws/v2/apis/namespaced/opensearchserverless/v1beta1.CollectionGroup + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/v2/pkg/resource.ExtractParamPath("name",false) // +kubebuilder:validation:Optional CollectionGroupName *string `json:"collectionGroupName,omitempty" tf:"collection_group_name,omitempty"` + // Reference to a CollectionGroup in opensearchserverless to populate collectionGroupName. + // +kubebuilder:validation:Optional + CollectionGroupNameRef *v2.NamespacedReference `json:"collectionGroupNameRef,omitempty" tf:"-"` + + // Selector for a CollectionGroup in opensearchserverless to populate collectionGroupName. + // +kubebuilder:validation:Optional + CollectionGroupNameSelector *v2.NamespacedSelector `json:"collectionGroupNameSelector,omitempty" tf:"-"` + // Description of the collection. // Description of the collection. // +kubebuilder:validation:Optional diff --git a/apis/namespaced/opensearchserverless/v1beta1/zz_collectiongroup_terraformed.go b/apis/namespaced/opensearchserverless/v1beta1/zz_collectiongroup_terraformed.go new file mode 100755 index 0000000000..519da21f9f --- /dev/null +++ b/apis/namespaced/opensearchserverless/v1beta1/zz_collectiongroup_terraformed.go @@ -0,0 +1,131 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1beta1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/v2/pkg/resource" + "github.com/crossplane/upjet/v2/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this CollectionGroup +func (mg *CollectionGroup) GetTerraformResourceType() string { + return "aws_opensearchserverless_collection_group" +} + +// GetConnectionDetailsMapping for this CollectionGroup +func (tr *CollectionGroup) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this CollectionGroup +func (tr *CollectionGroup) GetObservation() (map[string]any, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this CollectionGroup +func (tr *CollectionGroup) SetObservation(obs map[string]any) error { + tr.Status.AtProvider.Tags = nil + tr.Status.AtProvider.TagsAll = nil + 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 CollectionGroup +func (tr *CollectionGroup) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this CollectionGroup +func (tr *CollectionGroup) GetParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this CollectionGroup +func (tr *CollectionGroup) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// GetInitParameters of this CollectionGroup +func (tr *CollectionGroup) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this CollectionGroup +func (tr *CollectionGroup) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource \"%s/%s\"", tr.GetNamespace(), tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource \"%s/%s\"", tr.GetNamespace(), tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource \"%s/%s\"", tr.GetNamespace(), tr.GetName()) + } + + return params, nil +} + +// LateInitialize this CollectionGroup using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *CollectionGroup) LateInitialize(attrs []byte) (bool, error) { + params := &CollectionGroupParameters{} + 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 *CollectionGroup) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/namespaced/opensearchserverless/v1beta1/zz_collectiongroup_types.go b/apis/namespaced/opensearchserverless/v1beta1/zz_collectiongroup_types.go new file mode 100755 index 0000000000..6fb5aa4bcf --- /dev/null +++ b/apis/namespaced/opensearchserverless/v1beta1/zz_collectiongroup_types.go @@ -0,0 +1,233 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v2 "github.com/crossplane/crossplane/apis/v2/core/v2" +) + +type CapacityLimitsInitParameters struct { + + // Maximum indexing capacity, in OpenSearch Compute Units (OCUs), for the collection group. + MaxIndexingCapacityInOcu *float64 `json:"maxIndexingCapacityInOcu,omitempty" tf:"max_indexing_capacity_in_ocu"` + + // Maximum search capacity, in OpenSearch Compute Units (OCUs), for the collection group. + MaxSearchCapacityInOcu *float64 `json:"maxSearchCapacityInOcu,omitempty" tf:"max_search_capacity_in_ocu"` + + // Minimum indexing capacity, in OpenSearch Compute Units (OCUs), for the collection group. + MinIndexingCapacityInOcu *float64 `json:"minIndexingCapacityInOcu,omitempty" tf:"min_indexing_capacity_in_ocu"` + + // Minimum search capacity, in OpenSearch Compute Units (OCUs), for the collection group. + MinSearchCapacityInOcu *float64 `json:"minSearchCapacityInOcu,omitempty" tf:"min_search_capacity_in_ocu"` +} + +type CapacityLimitsObservation struct { + + // Maximum indexing capacity, in OpenSearch Compute Units (OCUs), for the collection group. + MaxIndexingCapacityInOcu *float64 `json:"maxIndexingCapacityInOcu,omitempty" tf:"max_indexing_capacity_in_ocu,omitempty"` + + // Maximum search capacity, in OpenSearch Compute Units (OCUs), for the collection group. + MaxSearchCapacityInOcu *float64 `json:"maxSearchCapacityInOcu,omitempty" tf:"max_search_capacity_in_ocu,omitempty"` + + // Minimum indexing capacity, in OpenSearch Compute Units (OCUs), for the collection group. + MinIndexingCapacityInOcu *float64 `json:"minIndexingCapacityInOcu,omitempty" tf:"min_indexing_capacity_in_ocu,omitempty"` + + // Minimum search capacity, in OpenSearch Compute Units (OCUs), for the collection group. + MinSearchCapacityInOcu *float64 `json:"minSearchCapacityInOcu,omitempty" tf:"min_search_capacity_in_ocu,omitempty"` +} + +type CapacityLimitsParameters struct { + + // Maximum indexing capacity, in OpenSearch Compute Units (OCUs), for the collection group. + // +kubebuilder:validation:Optional + MaxIndexingCapacityInOcu *float64 `json:"maxIndexingCapacityInOcu,omitempty" tf:"max_indexing_capacity_in_ocu"` + + // Maximum search capacity, in OpenSearch Compute Units (OCUs), for the collection group. + // +kubebuilder:validation:Optional + MaxSearchCapacityInOcu *float64 `json:"maxSearchCapacityInOcu,omitempty" tf:"max_search_capacity_in_ocu"` + + // Minimum indexing capacity, in OpenSearch Compute Units (OCUs), for the collection group. + // +kubebuilder:validation:Optional + MinIndexingCapacityInOcu *float64 `json:"minIndexingCapacityInOcu,omitempty" tf:"min_indexing_capacity_in_ocu"` + + // Minimum search capacity, in OpenSearch Compute Units (OCUs), for the collection group. + // +kubebuilder:validation:Optional + MinSearchCapacityInOcu *float64 `json:"minSearchCapacityInOcu,omitempty" tf:"min_search_capacity_in_ocu"` +} + +type CollectionGroupInitParameters struct { + + // Configuration block for the collection group's indexing and search capacity limits. See capacity_limits below for details. + CapacityLimits *CapacityLimitsInitParameters `json:"capacityLimits,omitempty" tf:"capacity_limits,omitempty"` + + // Description of the collection group. + // Description of the collection group. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // Generation of Amazon OpenSearch Serverless for the collection group. Valid values are CLASSIC and NEXTGEN. Default value is CLASSIC. + // Generation of the collection group. + Generation *string `json:"generation,omitempty" tf:"generation,omitempty"` + + // Name of the collection group. + // Name of the collection group. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // Indicates whether standby replicas should be used for collections in this group. Valid values are ENABLED and DISABLED. If generation is set to NEXTGEN, this argument must be set to ENABLED. + // Indicates whether standby replicas should be used for collections in this group. One of `ENABLED` or `DISABLED`. + StandbyReplicas *string `json:"standbyReplicas,omitempty" tf:"standby_replicas,omitempty"` + + // Key-value map of resource tags. + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` +} + +type CollectionGroupObservation struct { + + // Amazon Resource Name (ARN) of the collection group. + Arn *string `json:"arn,omitempty" tf:"arn,omitempty"` + + // Configuration block for the collection group's indexing and search capacity limits. See capacity_limits below for details. + CapacityLimits *CapacityLimitsObservation `json:"capacityLimits,omitempty" tf:"capacity_limits,omitempty"` + + // Date the collection group was created. + // Date the collection group was created. + CreatedDate *string `json:"createdDate,omitempty" tf:"created_date,omitempty"` + + // Description of the collection group. + // Description of the collection group. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // Generation of Amazon OpenSearch Serverless for the collection group. Valid values are CLASSIC and NEXTGEN. Default value is CLASSIC. + // Generation of the collection group. + Generation *string `json:"generation,omitempty" tf:"generation,omitempty"` + + // Unique identifier for the collection group. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // Name of the collection group. + // Name of the collection group. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // Region where this resource will be managed. Defaults to the Region set in the provider configuration. + // Region is the region you'd like your resource to be created in. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Indicates whether standby replicas should be used for collections in this group. Valid values are ENABLED and DISABLED. If generation is set to NEXTGEN, this argument must be set to ENABLED. + // Indicates whether standby replicas should be used for collections in this group. One of `ENABLED` or `DISABLED`. + StandbyReplicas *string `json:"standbyReplicas,omitempty" tf:"standby_replicas,omitempty"` + + // Key-value map of resource tags. + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block. + // +mapType=granular + TagsAll map[string]*string `json:"tagsAll,omitempty" tf:"tags_all,omitempty"` +} + +type CollectionGroupParameters struct { + + // Configuration block for the collection group's indexing and search capacity limits. See capacity_limits below for details. + // +kubebuilder:validation:Optional + CapacityLimits *CapacityLimitsParameters `json:"capacityLimits,omitempty" tf:"capacity_limits,omitempty"` + + // Description of the collection group. + // Description of the collection group. + // +kubebuilder:validation:Optional + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // Generation of Amazon OpenSearch Serverless for the collection group. Valid values are CLASSIC and NEXTGEN. Default value is CLASSIC. + // Generation of the collection group. + // +kubebuilder:validation:Optional + Generation *string `json:"generation,omitempty" tf:"generation,omitempty"` + + // Name of the collection group. + // Name of the collection group. + // +kubebuilder:validation:Optional + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // Region where this resource will be managed. Defaults to the Region set in the provider configuration. + // Region is the region you'd like your resource to be created in. + // +kubebuilder:validation:Required + Region *string `json:"region" tf:"region,omitempty"` + + // Indicates whether standby replicas should be used for collections in this group. Valid values are ENABLED and DISABLED. If generation is set to NEXTGEN, this argument must be set to ENABLED. + // Indicates whether standby replicas should be used for collections in this group. One of `ENABLED` or `DISABLED`. + // +kubebuilder:validation:Optional + StandbyReplicas *string `json:"standbyReplicas,omitempty" tf:"standby_replicas,omitempty"` + + // Key-value map of resource tags. + // +kubebuilder:validation:Optional + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` +} + +// CollectionGroupSpec defines the desired state of CollectionGroup +type CollectionGroupSpec struct { + v2.ManagedResourceSpec `json:",inline"` + ForProvider CollectionGroupParameters `json:"forProvider"` + // THIS IS A BETA FIELD. It will be honored + // unless the Management Policies feature flag is disabled. + // InitProvider holds the same fields as ForProvider, with the exception + // of Identifier and other resource reference fields. The fields that are + // in InitProvider are merged into ForProvider when the resource is created. + // The same fields are also added to the terraform ignore_changes hook, to + // avoid updating them after creation. This is useful for fields that are + // required on creation, but we do not desire to update them after creation, + // for example because of an external controller is managing them, like an + // autoscaler. + InitProvider CollectionGroupInitParameters `json:"initProvider,omitempty"` +} + +// CollectionGroupStatus defines the observed state of CollectionGroup. +type CollectionGroupStatus struct { + v2.ManagedResourceStatus `json:",inline"` + AtProvider CollectionGroupObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// CollectionGroup is the Schema for the CollectionGroups API. +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].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:resource:scope=Namespaced,categories={crossplane,managed,aws} +type CollectionGroup struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.name) || (has(self.initProvider) && has(self.initProvider.name))",message="spec.forProvider.name is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.standbyReplicas) || (has(self.initProvider) && has(self.initProvider.standbyReplicas))",message="spec.forProvider.standbyReplicas is a required parameter" + Spec CollectionGroupSpec `json:"spec"` + Status CollectionGroupStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// CollectionGroupList contains a list of CollectionGroups +type CollectionGroupList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []CollectionGroup `json:"items"` +} + +// Repository type metadata. +var ( + CollectionGroup_Kind = "CollectionGroup" + CollectionGroup_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: CollectionGroup_Kind}.String() + CollectionGroup_KindAPIVersion = CollectionGroup_Kind + "." + CRDGroupVersion.String() + CollectionGroup_GroupVersionKind = CRDGroupVersion.WithKind(CollectionGroup_Kind) +) + +func init() { + SchemeBuilder.Register(&CollectionGroup{}, &CollectionGroupList{}) +} diff --git a/apis/namespaced/opensearchserverless/v1beta1/zz_generated.conversion_hubs.go b/apis/namespaced/opensearchserverless/v1beta1/zz_generated.conversion_hubs.go index 89e575faa8..bf84121280 100755 --- a/apis/namespaced/opensearchserverless/v1beta1/zz_generated.conversion_hubs.go +++ b/apis/namespaced/opensearchserverless/v1beta1/zz_generated.conversion_hubs.go @@ -12,6 +12,9 @@ func (tr *AccessPolicy) Hub() {} // Hub marks this type as a conversion hub. func (tr *Collection) Hub() {} +// Hub marks this type as a conversion hub. +func (tr *CollectionGroup) Hub() {} + // Hub marks this type as a conversion hub. func (tr *LifecyclePolicy) Hub() {} diff --git a/apis/namespaced/opensearchserverless/v1beta1/zz_generated.deepcopy.go b/apis/namespaced/opensearchserverless/v1beta1/zz_generated.deepcopy.go index 06cc0c6c26..0606d569c3 100644 --- a/apis/namespaced/opensearchserverless/v1beta1/zz_generated.deepcopy.go +++ b/apis/namespaced/opensearchserverless/v1beta1/zz_generated.deepcopy.go @@ -217,6 +217,111 @@ func (in *AccessPolicyStatus) DeepCopy() *AccessPolicyStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CapacityLimitsInitParameters) DeepCopyInto(out *CapacityLimitsInitParameters) { + *out = *in + if in.MaxIndexingCapacityInOcu != nil { + in, out := &in.MaxIndexingCapacityInOcu, &out.MaxIndexingCapacityInOcu + *out = new(float64) + **out = **in + } + if in.MaxSearchCapacityInOcu != nil { + in, out := &in.MaxSearchCapacityInOcu, &out.MaxSearchCapacityInOcu + *out = new(float64) + **out = **in + } + if in.MinIndexingCapacityInOcu != nil { + in, out := &in.MinIndexingCapacityInOcu, &out.MinIndexingCapacityInOcu + *out = new(float64) + **out = **in + } + if in.MinSearchCapacityInOcu != nil { + in, out := &in.MinSearchCapacityInOcu, &out.MinSearchCapacityInOcu + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CapacityLimitsInitParameters. +func (in *CapacityLimitsInitParameters) DeepCopy() *CapacityLimitsInitParameters { + if in == nil { + return nil + } + out := new(CapacityLimitsInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CapacityLimitsObservation) DeepCopyInto(out *CapacityLimitsObservation) { + *out = *in + if in.MaxIndexingCapacityInOcu != nil { + in, out := &in.MaxIndexingCapacityInOcu, &out.MaxIndexingCapacityInOcu + *out = new(float64) + **out = **in + } + if in.MaxSearchCapacityInOcu != nil { + in, out := &in.MaxSearchCapacityInOcu, &out.MaxSearchCapacityInOcu + *out = new(float64) + **out = **in + } + if in.MinIndexingCapacityInOcu != nil { + in, out := &in.MinIndexingCapacityInOcu, &out.MinIndexingCapacityInOcu + *out = new(float64) + **out = **in + } + if in.MinSearchCapacityInOcu != nil { + in, out := &in.MinSearchCapacityInOcu, &out.MinSearchCapacityInOcu + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CapacityLimitsObservation. +func (in *CapacityLimitsObservation) DeepCopy() *CapacityLimitsObservation { + if in == nil { + return nil + } + out := new(CapacityLimitsObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CapacityLimitsParameters) DeepCopyInto(out *CapacityLimitsParameters) { + *out = *in + if in.MaxIndexingCapacityInOcu != nil { + in, out := &in.MaxIndexingCapacityInOcu, &out.MaxIndexingCapacityInOcu + *out = new(float64) + **out = **in + } + if in.MaxSearchCapacityInOcu != nil { + in, out := &in.MaxSearchCapacityInOcu, &out.MaxSearchCapacityInOcu + *out = new(float64) + **out = **in + } + if in.MinIndexingCapacityInOcu != nil { + in, out := &in.MinIndexingCapacityInOcu, &out.MinIndexingCapacityInOcu + *out = new(float64) + **out = **in + } + if in.MinSearchCapacityInOcu != nil { + in, out := &in.MinSearchCapacityInOcu, &out.MinSearchCapacityInOcu + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CapacityLimitsParameters. +func (in *CapacityLimitsParameters) DeepCopy() *CapacityLimitsParameters { + if in == nil { + return nil + } + out := new(CapacityLimitsParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Collection) DeepCopyInto(out *Collection) { *out = *in @@ -244,6 +349,309 @@ func (in *Collection) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CollectionGroup) DeepCopyInto(out *CollectionGroup) { + *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 CollectionGroup. +func (in *CollectionGroup) DeepCopy() *CollectionGroup { + if in == nil { + return nil + } + out := new(CollectionGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CollectionGroup) 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 *CollectionGroupInitParameters) DeepCopyInto(out *CollectionGroupInitParameters) { + *out = *in + if in.CapacityLimits != nil { + in, out := &in.CapacityLimits, &out.CapacityLimits + *out = new(CapacityLimitsInitParameters) + (*in).DeepCopyInto(*out) + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Generation != nil { + in, out := &in.Generation, &out.Generation + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.StandbyReplicas != nil { + in, out := &in.StandbyReplicas, &out.StandbyReplicas + *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 { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CollectionGroupInitParameters. +func (in *CollectionGroupInitParameters) DeepCopy() *CollectionGroupInitParameters { + if in == nil { + return nil + } + out := new(CollectionGroupInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CollectionGroupList) DeepCopyInto(out *CollectionGroupList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CollectionGroup, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CollectionGroupList. +func (in *CollectionGroupList) DeepCopy() *CollectionGroupList { + if in == nil { + return nil + } + out := new(CollectionGroupList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CollectionGroupList) 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 *CollectionGroupObservation) DeepCopyInto(out *CollectionGroupObservation) { + *out = *in + if in.Arn != nil { + in, out := &in.Arn, &out.Arn + *out = new(string) + **out = **in + } + if in.CapacityLimits != nil { + in, out := &in.CapacityLimits, &out.CapacityLimits + *out = new(CapacityLimitsObservation) + (*in).DeepCopyInto(*out) + } + if in.CreatedDate != nil { + in, out := &in.CreatedDate, &out.CreatedDate + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Generation != nil { + in, out := &in.Generation, &out.Generation + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *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.StandbyReplicas != nil { + in, out := &in.StandbyReplicas, &out.StandbyReplicas + *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 { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + 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 { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CollectionGroupObservation. +func (in *CollectionGroupObservation) DeepCopy() *CollectionGroupObservation { + if in == nil { + return nil + } + out := new(CollectionGroupObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CollectionGroupParameters) DeepCopyInto(out *CollectionGroupParameters) { + *out = *in + if in.CapacityLimits != nil { + in, out := &in.CapacityLimits, &out.CapacityLimits + *out = new(CapacityLimitsParameters) + (*in).DeepCopyInto(*out) + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Generation != nil { + in, out := &in.Generation, &out.Generation + *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.StandbyReplicas != nil { + in, out := &in.StandbyReplicas, &out.StandbyReplicas + *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 { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CollectionGroupParameters. +func (in *CollectionGroupParameters) DeepCopy() *CollectionGroupParameters { + if in == nil { + return nil + } + out := new(CollectionGroupParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CollectionGroupSpec) DeepCopyInto(out *CollectionGroupSpec) { + *out = *in + in.ManagedResourceSpec.DeepCopyInto(&out.ManagedResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) + in.InitProvider.DeepCopyInto(&out.InitProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CollectionGroupSpec. +func (in *CollectionGroupSpec) DeepCopy() *CollectionGroupSpec { + if in == nil { + return nil + } + out := new(CollectionGroupSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CollectionGroupStatus) DeepCopyInto(out *CollectionGroupStatus) { + *out = *in + in.ManagedResourceStatus.DeepCopyInto(&out.ManagedResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CollectionGroupStatus. +func (in *CollectionGroupStatus) DeepCopy() *CollectionGroupStatus { + if in == nil { + return nil + } + out := new(CollectionGroupStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CollectionInitParameters) DeepCopyInto(out *CollectionInitParameters) { *out = *in @@ -252,6 +660,16 @@ func (in *CollectionInitParameters) DeepCopyInto(out *CollectionInitParameters) *out = new(string) **out = **in } + if in.CollectionGroupNameRef != nil { + in, out := &in.CollectionGroupNameRef, &out.CollectionGroupNameRef + *out = new(v2.NamespacedReference) + (*in).DeepCopyInto(*out) + } + if in.CollectionGroupNameSelector != nil { + in, out := &in.CollectionGroupNameSelector, &out.CollectionGroupNameSelector + *out = new(v2.NamespacedSelector) + (*in).DeepCopyInto(*out) + } if in.Description != nil { in, out := &in.Description, &out.Description *out = new(string) @@ -462,6 +880,16 @@ func (in *CollectionParameters) DeepCopyInto(out *CollectionParameters) { *out = new(string) **out = **in } + if in.CollectionGroupNameRef != nil { + in, out := &in.CollectionGroupNameRef, &out.CollectionGroupNameRef + *out = new(v2.NamespacedReference) + (*in).DeepCopyInto(*out) + } + if in.CollectionGroupNameSelector != nil { + in, out := &in.CollectionGroupNameSelector, &out.CollectionGroupNameSelector + *out = new(v2.NamespacedSelector) + (*in).DeepCopyInto(*out) + } if in.Description != nil { in, out := &in.Description, &out.Description *out = new(string) diff --git a/apis/namespaced/opensearchserverless/v1beta1/zz_generated.managed.go b/apis/namespaced/opensearchserverless/v1beta1/zz_generated.managed.go index e94dd5ca4d..6be1059aba 100644 --- a/apis/namespaced/opensearchserverless/v1beta1/zz_generated.managed.go +++ b/apis/namespaced/opensearchserverless/v1beta1/zz_generated.managed.go @@ -87,6 +87,46 @@ func (mg *Collection) SetWriteConnectionSecretToReference(r *xpv2.LocalSecretRef mg.Spec.WriteConnectionSecretToReference = r } +// GetCondition of this CollectionGroup. +func (mg *CollectionGroup) GetCondition(ct xpv2.ConditionType) xpv2.Condition { + return mg.Status.GetCondition(ct) +} + +// GetManagementPolicies of this CollectionGroup. +func (mg *CollectionGroup) GetManagementPolicies() xpv2.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this CollectionGroup. +func (mg *CollectionGroup) GetProviderConfigReference() *xpv2.ProviderConfigReference { + return mg.Spec.ProviderConfigReference +} + +// GetWriteConnectionSecretToReference of this CollectionGroup. +func (mg *CollectionGroup) GetWriteConnectionSecretToReference() *xpv2.LocalSecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this CollectionGroup. +func (mg *CollectionGroup) SetConditions(c ...xpv2.Condition) { + mg.Status.SetConditions(c...) +} + +// SetManagementPolicies of this CollectionGroup. +func (mg *CollectionGroup) SetManagementPolicies(r xpv2.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this CollectionGroup. +func (mg *CollectionGroup) SetProviderConfigReference(r *xpv2.ProviderConfigReference) { + mg.Spec.ProviderConfigReference = r +} + +// SetWriteConnectionSecretToReference of this CollectionGroup. +func (mg *CollectionGroup) SetWriteConnectionSecretToReference(r *xpv2.LocalSecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + // GetCondition of this LifecyclePolicy. func (mg *LifecyclePolicy) GetCondition(ct xpv2.ConditionType) xpv2.Condition { return mg.Status.GetCondition(ct) diff --git a/apis/namespaced/opensearchserverless/v1beta1/zz_generated.managedlist.go b/apis/namespaced/opensearchserverless/v1beta1/zz_generated.managedlist.go index 7637d0db9e..a8deb8e165 100644 --- a/apis/namespaced/opensearchserverless/v1beta1/zz_generated.managedlist.go +++ b/apis/namespaced/opensearchserverless/v1beta1/zz_generated.managedlist.go @@ -16,6 +16,15 @@ func (l *AccessPolicyList) GetItems() []resource.Managed { return items } +// GetItems of this CollectionGroupList. +func (l *CollectionGroupList) 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 CollectionList. func (l *CollectionList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) diff --git a/apis/namespaced/opensearchserverless/v1beta1/zz_generated.resolvers.go b/apis/namespaced/opensearchserverless/v1beta1/zz_generated.resolvers.go index 973db6f6ea..8d4870b85c 100644 --- a/apis/namespaced/opensearchserverless/v1beta1/zz_generated.resolvers.go +++ b/apis/namespaced/opensearchserverless/v1beta1/zz_generated.resolvers.go @@ -24,6 +24,26 @@ func (mg *Collection) ResolveReferences( // ResolveReferences of this Collection var rsp reference.NamespacedResolutionResponse var err error + { + m, l, err = apisresolver.GetManagedResource("opensearchserverless.aws.m.upbound.io", "v1beta1", "CollectionGroup", "CollectionGroupList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + rsp, err = r.Resolve(ctx, reference.NamespacedResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.CollectionGroupName), + Extract: resource.ExtractParamPath("name", false), + Namespace: mg.GetNamespace(), + Reference: mg.Spec.ForProvider.CollectionGroupNameRef, + Selector: mg.Spec.ForProvider.CollectionGroupNameSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.CollectionGroupName") + } + mg.Spec.ForProvider.CollectionGroupName = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.CollectionGroupNameRef = rsp.ResolvedReference if mg.Spec.ForProvider.EncryptionConfig != nil { { @@ -47,6 +67,26 @@ func (mg *Collection) ResolveReferences( // ResolveReferences of this Collection mg.Spec.ForProvider.EncryptionConfig.KMSKeyArnRef = rsp.ResolvedReference } + { + m, l, err = apisresolver.GetManagedResource("opensearchserverless.aws.m.upbound.io", "v1beta1", "CollectionGroup", "CollectionGroupList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + rsp, err = r.Resolve(ctx, reference.NamespacedResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.CollectionGroupName), + Extract: resource.ExtractParamPath("name", false), + Namespace: mg.GetNamespace(), + Reference: mg.Spec.InitProvider.CollectionGroupNameRef, + Selector: mg.Spec.InitProvider.CollectionGroupNameSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.CollectionGroupName") + } + mg.Spec.InitProvider.CollectionGroupName = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.CollectionGroupNameRef = rsp.ResolvedReference + if mg.Spec.InitProvider.EncryptionConfig != nil { { m, l, err = apisresolver.GetManagedResource("kms.aws.m.upbound.io", "v1beta1", "Key", "KeyList") diff --git a/config/cluster/opensearchserverless/config.go b/config/cluster/opensearchserverless/config.go index beb4cb4080..68dc0d6193 100644 --- a/config/cluster/opensearchserverless/config.go +++ b/config/cluster/opensearchserverless/config.go @@ -34,4 +34,11 @@ func Configure(p *config.Provider) { //nolint:gocyclo r.AddSingletonListConversion("encryption_config", "encryptionConfig") r.AddSingletonListConversion("vector_options", "vectorOptions") }) + p.AddResourceConfigurator("aws_opensearchserverless_collection_group", func(r *config.Resource) { + // capacity_limits is a Plugin Framework list-of-objects attribute with a + // size-1 validator. Framework attribute validators do not surface as + // max_items in the provider schema, so upjet cannot infer the singleton + // list on its own; enforce the embedded-object conversion explicitly. + r.AddSingletonListConversion("capacity_limits", "capacityLimits") + }) } diff --git a/config/externalname.go b/config/externalname.go index 7e6813b341..b9ad304f8d 100644 --- a/config/externalname.go +++ b/config/externalname.go @@ -170,6 +170,8 @@ var TerraformPluginFrameworkExternalNameConfigs = map[string]config.ExternalName "aws_opensearchserverless_access_policy": config.NameAsIdentifier, // Collection can be imported using the AWS-assigned collection ID. i.e. ch9rq91uv4yd8rff1f39 "aws_opensearchserverless_collection": opensearchserverlessCollection(), + // CollectionGroup can be imported using the AWS-assigned collection group ID + "aws_opensearchserverless_collection_group": opensearchserverlessCollectionGroup(), // LifecyclePolicy can be imported using the policy name "aws_opensearchserverless_lifecycle_policy": config.NameAsIdentifier, // SecurityConfig can be imported using the AWS-assigned security config ID @@ -3217,6 +3219,18 @@ func opensearchserverlessCollection() config.ExternalName { return e } +func opensearchserverlessCollectionGroup() config.ExternalName { + e := config.IdentifierFromProvider + e.GetIDFn = func(ctx context.Context, externalName string, _ map[string]any, _ map[string]any) (string, error) { + // [a-z0-9]{3,40} + if len(externalName) == 0 { + return "stubcollectiongroup99", nil + } + return externalName, nil + } + return e +} + // PermissionSetIdAsExternalName uses the id of the permission set (ps-80383020jr9302rk) as the external name, with // the comma-separated pair permission_set_arn,instance_arn as the terraform id, when both arns are parameters and known // ahead of time. diff --git a/config/generated.lst b/config/generated.lst index e6f0507288..7a9f5f9155 100644 --- a/config/generated.lst +++ b/config/generated.lst @@ -686,6 +686,7 @@ "aws_opensearch_domain_saml_options", "aws_opensearchserverless_access_policy", "aws_opensearchserverless_collection", +"aws_opensearchserverless_collection_group", "aws_opensearchserverless_lifecycle_policy", "aws_opensearchserverless_security_config", "aws_opensearchserverless_security_policy", diff --git a/config/namespaced/opensearchserverless/config.go b/config/namespaced/opensearchserverless/config.go index beb4cb4080..68dc0d6193 100644 --- a/config/namespaced/opensearchserverless/config.go +++ b/config/namespaced/opensearchserverless/config.go @@ -34,4 +34,11 @@ func Configure(p *config.Provider) { //nolint:gocyclo r.AddSingletonListConversion("encryption_config", "encryptionConfig") r.AddSingletonListConversion("vector_options", "vectorOptions") }) + p.AddResourceConfigurator("aws_opensearchserverless_collection_group", func(r *config.Resource) { + // capacity_limits is a Plugin Framework list-of-objects attribute with a + // size-1 validator. Framework attribute validators do not surface as + // max_items in the provider schema, so upjet cannot infer the singleton + // list on its own; enforce the embedded-object conversion explicitly. + r.AddSingletonListConversion("capacity_limits", "capacityLimits") + }) } diff --git a/examples-generated/cluster/opensearchserverless/v1beta1/collectiongroup.yaml b/examples-generated/cluster/opensearchserverless/v1beta1/collectiongroup.yaml new file mode 100644 index 0000000000..fdad20d409 --- /dev/null +++ b/examples-generated/cluster/opensearchserverless/v1beta1/collectiongroup.yaml @@ -0,0 +1,24 @@ +# SPDX-FileCopyrightText: 2025 The Crossplane Authors +# +# SPDX-License-Identifier: CC0-1.0 + + +apiVersion: opensearchserverless.aws.upbound.io/v1beta1 +kind: CollectionGroup +metadata: + annotations: + meta.upbound.io/example-id: opensearchserverless/v1beta1/collectiongroup + labels: + testing.upbound.io/example-name: example + name: example +spec: + forProvider: + capacityLimits: + maxIndexingCapacityInOcu: 16 + maxSearchCapacityInOcu: 16 + minIndexingCapacityInOcu: 2 + minSearchCapacityInOcu: 2 + description: Shared compute for production collections + name: example-group + region: us-west-1 + standbyReplicas: ENABLED diff --git a/examples-generated/namespaced/opensearchserverless/v1beta1/collectiongroup.yaml b/examples-generated/namespaced/opensearchserverless/v1beta1/collectiongroup.yaml new file mode 100644 index 0000000000..b6c41f3777 --- /dev/null +++ b/examples-generated/namespaced/opensearchserverless/v1beta1/collectiongroup.yaml @@ -0,0 +1,25 @@ +# SPDX-FileCopyrightText: 2025 The Crossplane Authors +# +# SPDX-License-Identifier: CC0-1.0 + + +apiVersion: opensearchserverless.aws.m.upbound.io/v1beta1 +kind: CollectionGroup +metadata: + annotations: + meta.upbound.io/example-id: opensearchserverless/v1beta1/collectiongroup + labels: + testing.upbound.io/example-name: example + name: example + namespace: upbound-system +spec: + forProvider: + capacityLimits: + maxIndexingCapacityInOcu: 16 + maxSearchCapacityInOcu: 16 + minIndexingCapacityInOcu: 2 + minSearchCapacityInOcu: 2 + description: Shared compute for production collections + name: example-group + region: us-west-1 + standbyReplicas: ENABLED diff --git a/examples/opensearchserverless/cluster/v1beta1/collectiongroup.yaml b/examples/opensearchserverless/cluster/v1beta1/collectiongroup.yaml new file mode 100644 index 0000000000..ed6e46ecb7 --- /dev/null +++ b/examples/opensearchserverless/cluster/v1beta1/collectiongroup.yaml @@ -0,0 +1,24 @@ +# SPDX-FileCopyrightText: 2025 The Crossplane Authors +# +# SPDX-License-Identifier: CC0-1.0 + +apiVersion: opensearchserverless.aws.upbound.io/v1beta1 +kind: CollectionGroup +metadata: + annotations: + meta.upbound.io/example-id: opensearchserverless/v1beta1/collectiongroup + labels: + testing.upbound.io/example-name: example + name: example +spec: + forProvider: + capacityLimits: + maxIndexingCapacityInOcu: 16 + maxSearchCapacityInOcu: 16 + minIndexingCapacityInOcu: 0 + minSearchCapacityInOcu: 0 + description: Scale-to-zero collection group + generation: NEXTGEN + name: example-group + region: us-west-1 + standbyReplicas: ENABLED diff --git a/examples/opensearchserverless/namespaced/v1beta1/collectiongroup.yaml b/examples/opensearchserverless/namespaced/v1beta1/collectiongroup.yaml new file mode 100644 index 0000000000..9424b766df --- /dev/null +++ b/examples/opensearchserverless/namespaced/v1beta1/collectiongroup.yaml @@ -0,0 +1,25 @@ +# SPDX-FileCopyrightText: 2025 The Crossplane Authors +# +# SPDX-License-Identifier: CC0-1.0 + +apiVersion: opensearchserverless.aws.m.upbound.io/v1beta1 +kind: CollectionGroup +metadata: + annotations: + meta.upbound.io/example-id: opensearchserverless/v1beta1/collectiongroup + labels: + testing.upbound.io/example-name: example + name: example + namespace: upbound-system +spec: + forProvider: + capacityLimits: + maxIndexingCapacityInOcu: 16 + maxSearchCapacityInOcu: 16 + minIndexingCapacityInOcu: 0 + minSearchCapacityInOcu: 0 + description: Scale-to-zero collection group + generation: NEXTGEN + name: example-group + region: us-west-1 + standbyReplicas: ENABLED diff --git a/internal/controller/cluster/opensearchserverless/collectiongroup/zz_controller.go b/internal/controller/cluster/opensearchserverless/collectiongroup/zz_controller.go new file mode 100755 index 0000000000..d4240ef2aa --- /dev/null +++ b/internal/controller/cluster/opensearchserverless/collectiongroup/zz_controller.go @@ -0,0 +1,122 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package collectiongroup + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/v2/pkg/errors" + "github.com/crossplane/crossplane-runtime/v2/pkg/event" + xpfeature "github.com/crossplane/crossplane-runtime/v2/pkg/feature" + "github.com/crossplane/crossplane-runtime/v2/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + "github.com/crossplane/crossplane-runtime/v2/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/v2/pkg/controller" + "github.com/crossplane/upjet/v2/pkg/controller/handler" + "github.com/crossplane/upjet/v2/pkg/metrics" + "github.com/crossplane/upjet/v2/pkg/reconciler/reconciliationpolicy" + ctrl "sigs.k8s.io/controller-runtime" + + v1beta1 "github.com/upbound/provider-aws/v2/apis/cluster/opensearchserverless/v1beta1" + "github.com/upbound/provider-aws/v2/internal/clients" + features "github.com/upbound/provider-aws/v2/internal/features" +) + +// SetupWebhookWithManager registers the conversion webhook for CollectionGroup. +func SetupWebhookWithManager(mgr ctrl.Manager) error { + if err := ctrl.NewWebhookManagedBy(mgr, &v1beta1.CollectionGroup{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.CollectionGroup") + } + return nil +} + +// SetupGated adds a controller that reconciles CollectionGroup managed resources. +func SetupGated(mgr ctrl.Manager, o tjcontroller.Options) error { + o.Options.Gate.Register(func() { + if err := Setup(mgr, o); err != nil { + mgr.GetLogger().Error(err, "unable to setup reconciler", "gvk", v1beta1.CollectionGroup_GroupVersionKind.String()) + } + }, v1beta1.CollectionGroup_GroupVersionKind) + return nil +} + +// Setup adds a controller that reconciles CollectionGroup managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1beta1.CollectionGroup_GroupVersionKind.String()) + var initializers managed.InitializerChain + for _, i := range o.Provider.Resources["aws_opensearchserverless_collection_group"].InitializerFns { + initializers = append(initializers, i(mgr.GetClient())) + } + rl := reconciliationpolicy.NewExponentialFailureRateLimiter(time.Second, 60*time.Second) + eventHandler := handler.NewEventHandler(handler.WithDefaultRateLimiter(rl), handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.CollectionGroup_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CollectionGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginFrameworkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["aws_opensearchserverless_collection_group"], + tjcontroller.WithTerraformPluginFrameworkAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginFrameworkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginFrameworkAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginFrameworkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.CollectionGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginFrameworkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)), + ), + ), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer( + reconciliationpolicy.NewFinalizer( + tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName)), + reconciliationpolicy.WithFinalizerRateLimiter(rl), + ), + ), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithPollInterval(o.PollInterval), + } + + if o.PollJitter != 0 { + opts = append(opts, managed.WithPollJitterHook(o.PollJitter)) + } + if o.Features.Enabled(features.EnableBetaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + if o.Features.Enabled(xpfeature.EnableAlphaChangeLogs) { + opts = append(opts, managed.WithChangeLogger(o.ChangeLogOptions.ChangeLogger)) + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.CollectionGroupList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.CollectionGroupList") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.CollectionGroup_GroupVersionKind), opts...) + co := o.ForControllerRuntime() + co.RateLimiter = rl + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(co). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1beta1.CollectionGroup{}, eventHandler). + Complete( + reconciliationpolicy.NewReconciler( + ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter), + mgr, + v1beta1.CollectionGroup_GroupVersionKind, + reconciliationpolicy.WithRateLimiter(rl), + reconciliationpolicy.WithSource(clients.ReconciliationPolicy), + ), + ) +} diff --git a/internal/controller/cluster/zz_monolith_setup.go b/internal/controller/cluster/zz_monolith_setup.go index 1bc990b8ed..ddb775246e 100755 --- a/internal/controller/cluster/zz_monolith_setup.go +++ b/internal/controller/cluster/zz_monolith_setup.go @@ -728,6 +728,7 @@ import ( domainsamloptionsopensearch "github.com/upbound/provider-aws/v2/internal/controller/cluster/opensearch/domainsamloptions" accesspolicy "github.com/upbound/provider-aws/v2/internal/controller/cluster/opensearchserverless/accesspolicy" collection "github.com/upbound/provider-aws/v2/internal/controller/cluster/opensearchserverless/collection" + collectiongroup "github.com/upbound/provider-aws/v2/internal/controller/cluster/opensearchserverless/collectiongroup" lifecyclepolicyopensearchserverless "github.com/upbound/provider-aws/v2/internal/controller/cluster/opensearchserverless/lifecyclepolicy" securityconfig "github.com/upbound/provider-aws/v2/internal/controller/cluster/opensearchserverless/securityconfig" securitypolicy "github.com/upbound/provider-aws/v2/internal/controller/cluster/opensearchserverless/securitypolicy" @@ -1763,6 +1764,7 @@ func Setup_monolith(mgr ctrl.Manager, o controller.Options) error { domainsamloptionsopensearch.Setup, accesspolicy.Setup, collection.Setup, + collectiongroup.Setup, lifecyclepolicyopensearchserverless.Setup, securityconfig.Setup, securitypolicy.Setup, @@ -2804,6 +2806,7 @@ func SetupGated_monolith(mgr ctrl.Manager, o controller.Options) error { domainsamloptionsopensearch.SetupGated, accesspolicy.SetupGated, collection.SetupGated, + collectiongroup.SetupGated, lifecyclepolicyopensearchserverless.SetupGated, securityconfig.SetupGated, securitypolicy.SetupGated, @@ -3844,6 +3847,7 @@ func SetupWebhookWithManager_monolith(mgr ctrl.Manager) error { domainsamloptionsopensearch.SetupWebhookWithManager, accesspolicy.SetupWebhookWithManager, collection.SetupWebhookWithManager, + collectiongroup.SetupWebhookWithManager, lifecyclepolicyopensearchserverless.SetupWebhookWithManager, securityconfig.SetupWebhookWithManager, securitypolicy.SetupWebhookWithManager, diff --git a/internal/controller/cluster/zz_opensearchserverless_setup.go b/internal/controller/cluster/zz_opensearchserverless_setup.go index f97d80f528..764f703626 100755 --- a/internal/controller/cluster/zz_opensearchserverless_setup.go +++ b/internal/controller/cluster/zz_opensearchserverless_setup.go @@ -11,6 +11,7 @@ import ( accesspolicy "github.com/upbound/provider-aws/v2/internal/controller/cluster/opensearchserverless/accesspolicy" collection "github.com/upbound/provider-aws/v2/internal/controller/cluster/opensearchserverless/collection" + collectiongroup "github.com/upbound/provider-aws/v2/internal/controller/cluster/opensearchserverless/collectiongroup" lifecyclepolicy "github.com/upbound/provider-aws/v2/internal/controller/cluster/opensearchserverless/lifecyclepolicy" securityconfig "github.com/upbound/provider-aws/v2/internal/controller/cluster/opensearchserverless/securityconfig" securitypolicy "github.com/upbound/provider-aws/v2/internal/controller/cluster/opensearchserverless/securitypolicy" @@ -23,6 +24,7 @@ func Setup_opensearchserverless(mgr ctrl.Manager, o controller.Options) error { for _, setup := range []func(ctrl.Manager, controller.Options) error{ accesspolicy.Setup, collection.Setup, + collectiongroup.Setup, lifecyclepolicy.Setup, securityconfig.Setup, securitypolicy.Setup, @@ -41,6 +43,7 @@ func SetupGated_opensearchserverless(mgr ctrl.Manager, o controller.Options) err for _, setup := range []func(ctrl.Manager, controller.Options) error{ accesspolicy.SetupGated, collection.SetupGated, + collectiongroup.SetupGated, lifecyclepolicy.SetupGated, securityconfig.SetupGated, securitypolicy.SetupGated, @@ -58,6 +61,7 @@ func SetupWebhookWithManager_opensearchserverless(mgr ctrl.Manager) error { for _, setup := range []func(ctrl.Manager) error{ accesspolicy.SetupWebhookWithManager, collection.SetupWebhookWithManager, + collectiongroup.SetupWebhookWithManager, lifecyclepolicy.SetupWebhookWithManager, securityconfig.SetupWebhookWithManager, securitypolicy.SetupWebhookWithManager, diff --git a/internal/controller/namespaced/opensearchserverless/collectiongroup/zz_controller.go b/internal/controller/namespaced/opensearchserverless/collectiongroup/zz_controller.go new file mode 100755 index 0000000000..305f3636ca --- /dev/null +++ b/internal/controller/namespaced/opensearchserverless/collectiongroup/zz_controller.go @@ -0,0 +1,122 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package collectiongroup + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/v2/pkg/errors" + "github.com/crossplane/crossplane-runtime/v2/pkg/event" + xpfeature "github.com/crossplane/crossplane-runtime/v2/pkg/feature" + "github.com/crossplane/crossplane-runtime/v2/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + "github.com/crossplane/crossplane-runtime/v2/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/v2/pkg/controller" + "github.com/crossplane/upjet/v2/pkg/controller/handler" + "github.com/crossplane/upjet/v2/pkg/metrics" + "github.com/crossplane/upjet/v2/pkg/reconciler/reconciliationpolicy" + ctrl "sigs.k8s.io/controller-runtime" + + v1beta1 "github.com/upbound/provider-aws/v2/apis/namespaced/opensearchserverless/v1beta1" + "github.com/upbound/provider-aws/v2/internal/clients" + features "github.com/upbound/provider-aws/v2/internal/features" +) + +// SetupWebhookWithManager registers the conversion webhook for CollectionGroup. +func SetupWebhookWithManager(mgr ctrl.Manager) error { + if err := ctrl.NewWebhookManagedBy(mgr, &v1beta1.CollectionGroup{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.CollectionGroup") + } + return nil +} + +// SetupGated adds a controller that reconciles CollectionGroup managed resources. +func SetupGated(mgr ctrl.Manager, o tjcontroller.Options) error { + o.Options.Gate.Register(func() { + if err := Setup(mgr, o); err != nil { + mgr.GetLogger().Error(err, "unable to setup reconciler", "gvk", v1beta1.CollectionGroup_GroupVersionKind.String()) + } + }, v1beta1.CollectionGroup_GroupVersionKind) + return nil +} + +// Setup adds a controller that reconciles CollectionGroup managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1beta1.CollectionGroup_GroupVersionKind.String()) + var initializers managed.InitializerChain + for _, i := range o.Provider.Resources["aws_opensearchserverless_collection_group"].InitializerFns { + initializers = append(initializers, i(mgr.GetClient())) + } + rl := reconciliationpolicy.NewExponentialFailureRateLimiter(time.Second, 60*time.Second) + eventHandler := handler.NewEventHandler(handler.WithDefaultRateLimiter(rl), handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.CollectionGroup_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CollectionGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginFrameworkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["aws_opensearchserverless_collection_group"], + tjcontroller.WithTerraformPluginFrameworkAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginFrameworkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginFrameworkAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginFrameworkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.CollectionGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginFrameworkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)), + ), + ), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer( + reconciliationpolicy.NewFinalizer( + tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName)), + reconciliationpolicy.WithFinalizerRateLimiter(rl), + ), + ), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithPollInterval(o.PollInterval), + } + + if o.PollJitter != 0 { + opts = append(opts, managed.WithPollJitterHook(o.PollJitter)) + } + if o.Features.Enabled(features.EnableBetaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + if o.Features.Enabled(xpfeature.EnableAlphaChangeLogs) { + opts = append(opts, managed.WithChangeLogger(o.ChangeLogOptions.ChangeLogger)) + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.CollectionGroupList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.CollectionGroupList") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.CollectionGroup_GroupVersionKind), opts...) + co := o.ForControllerRuntime() + co.RateLimiter = rl + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(co). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1beta1.CollectionGroup{}, eventHandler). + Complete( + reconciliationpolicy.NewReconciler( + ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter), + mgr, + v1beta1.CollectionGroup_GroupVersionKind, + reconciliationpolicy.WithRateLimiter(rl), + reconciliationpolicy.WithSource(clients.ReconciliationPolicy), + ), + ) +} diff --git a/internal/controller/namespaced/zz_monolith_setup.go b/internal/controller/namespaced/zz_monolith_setup.go index 876a8061d0..9dc4eb631d 100755 --- a/internal/controller/namespaced/zz_monolith_setup.go +++ b/internal/controller/namespaced/zz_monolith_setup.go @@ -728,6 +728,7 @@ import ( domainsamloptionsopensearch "github.com/upbound/provider-aws/v2/internal/controller/namespaced/opensearch/domainsamloptions" accesspolicy "github.com/upbound/provider-aws/v2/internal/controller/namespaced/opensearchserverless/accesspolicy" collection "github.com/upbound/provider-aws/v2/internal/controller/namespaced/opensearchserverless/collection" + collectiongroup "github.com/upbound/provider-aws/v2/internal/controller/namespaced/opensearchserverless/collectiongroup" lifecyclepolicyopensearchserverless "github.com/upbound/provider-aws/v2/internal/controller/namespaced/opensearchserverless/lifecyclepolicy" securityconfig "github.com/upbound/provider-aws/v2/internal/controller/namespaced/opensearchserverless/securityconfig" securitypolicy "github.com/upbound/provider-aws/v2/internal/controller/namespaced/opensearchserverless/securitypolicy" @@ -1763,6 +1764,7 @@ func Setup_monolith(mgr ctrl.Manager, o controller.Options) error { domainsamloptionsopensearch.Setup, accesspolicy.Setup, collection.Setup, + collectiongroup.Setup, lifecyclepolicyopensearchserverless.Setup, securityconfig.Setup, securitypolicy.Setup, @@ -2804,6 +2806,7 @@ func SetupGated_monolith(mgr ctrl.Manager, o controller.Options) error { domainsamloptionsopensearch.SetupGated, accesspolicy.SetupGated, collection.SetupGated, + collectiongroup.SetupGated, lifecyclepolicyopensearchserverless.SetupGated, securityconfig.SetupGated, securitypolicy.SetupGated, @@ -3844,6 +3847,7 @@ func SetupWebhookWithManager_monolith(mgr ctrl.Manager) error { domainsamloptionsopensearch.SetupWebhookWithManager, accesspolicy.SetupWebhookWithManager, collection.SetupWebhookWithManager, + collectiongroup.SetupWebhookWithManager, lifecyclepolicyopensearchserverless.SetupWebhookWithManager, securityconfig.SetupWebhookWithManager, securitypolicy.SetupWebhookWithManager, diff --git a/internal/controller/namespaced/zz_opensearchserverless_setup.go b/internal/controller/namespaced/zz_opensearchserverless_setup.go index 07a8f5e893..524669c7f2 100755 --- a/internal/controller/namespaced/zz_opensearchserverless_setup.go +++ b/internal/controller/namespaced/zz_opensearchserverless_setup.go @@ -11,6 +11,7 @@ import ( accesspolicy "github.com/upbound/provider-aws/v2/internal/controller/namespaced/opensearchserverless/accesspolicy" collection "github.com/upbound/provider-aws/v2/internal/controller/namespaced/opensearchserverless/collection" + collectiongroup "github.com/upbound/provider-aws/v2/internal/controller/namespaced/opensearchserverless/collectiongroup" lifecyclepolicy "github.com/upbound/provider-aws/v2/internal/controller/namespaced/opensearchserverless/lifecyclepolicy" securityconfig "github.com/upbound/provider-aws/v2/internal/controller/namespaced/opensearchserverless/securityconfig" securitypolicy "github.com/upbound/provider-aws/v2/internal/controller/namespaced/opensearchserverless/securitypolicy" @@ -23,6 +24,7 @@ func Setup_opensearchserverless(mgr ctrl.Manager, o controller.Options) error { for _, setup := range []func(ctrl.Manager, controller.Options) error{ accesspolicy.Setup, collection.Setup, + collectiongroup.Setup, lifecyclepolicy.Setup, securityconfig.Setup, securitypolicy.Setup, @@ -41,6 +43,7 @@ func SetupGated_opensearchserverless(mgr ctrl.Manager, o controller.Options) err for _, setup := range []func(ctrl.Manager, controller.Options) error{ accesspolicy.SetupGated, collection.SetupGated, + collectiongroup.SetupGated, lifecyclepolicy.SetupGated, securityconfig.SetupGated, securitypolicy.SetupGated, @@ -58,6 +61,7 @@ func SetupWebhookWithManager_opensearchserverless(mgr ctrl.Manager) error { for _, setup := range []func(ctrl.Manager) error{ accesspolicy.SetupWebhookWithManager, collection.SetupWebhookWithManager, + collectiongroup.SetupWebhookWithManager, lifecyclepolicy.SetupWebhookWithManager, securityconfig.SetupWebhookWithManager, securitypolicy.SetupWebhookWithManager, diff --git a/package/crds/opensearchserverless.aws.m.upbound.io_collectiongroups.yaml b/package/crds/opensearchserverless.aws.m.upbound.io_collectiongroups.yaml new file mode 100644 index 0000000000..415acbf74e --- /dev/null +++ b/package/crds/opensearchserverless.aws.m.upbound.io_collectiongroups.yaml @@ -0,0 +1,388 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.20.1 + name: collectiongroups.opensearchserverless.aws.m.upbound.io +spec: + group: opensearchserverless.aws.m.upbound.io + names: + categories: + - crossplane + - managed + - aws + kind: CollectionGroup + listKind: CollectionGroupList + plural: collectiongroups + singular: collectiongroup + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1beta1 + schema: + openAPIV3Schema: + description: CollectionGroup is the Schema for the CollectionGroups 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: CollectionGroupSpec defines the desired state of CollectionGroup + properties: + forProvider: + properties: + capacityLimits: + description: Configuration block for the collection group's indexing + and search capacity limits. See capacity_limits below for details. + properties: + maxIndexingCapacityInOcu: + description: Maximum indexing capacity, in OpenSearch Compute + Units (OCUs), for the collection group. + type: number + maxSearchCapacityInOcu: + description: Maximum search capacity, in OpenSearch Compute + Units (OCUs), for the collection group. + type: number + minIndexingCapacityInOcu: + description: Minimum indexing capacity, in OpenSearch Compute + Units (OCUs), for the collection group. + type: number + minSearchCapacityInOcu: + description: Minimum search capacity, in OpenSearch Compute + Units (OCUs), for the collection group. + type: number + type: object + description: + description: |- + Description of the collection group. + Description of the collection group. + type: string + generation: + description: |- + Generation of Amazon OpenSearch Serverless for the collection group. Valid values are CLASSIC and NEXTGEN. Default value is CLASSIC. + Generation of the collection group. + type: string + name: + description: |- + Name of the collection group. + Name of the collection group. + type: string + region: + description: |- + Region where this resource will be managed. Defaults to the Region set in the provider configuration. + Region is the region you'd like your resource to be created in. + type: string + standbyReplicas: + description: |- + Indicates whether standby replicas should be used for collections in this group. Valid values are ENABLED and DISABLED. If generation is set to NEXTGEN, this argument must be set to ENABLED. + Indicates whether standby replicas should be used for collections in this group. One of `ENABLED` or `DISABLED`. + type: string + tags: + additionalProperties: + type: string + description: Key-value map of resource tags. + type: object + x-kubernetes-map-type: granular + required: + - region + type: object + initProvider: + description: |- + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + properties: + capacityLimits: + description: Configuration block for the collection group's indexing + and search capacity limits. See capacity_limits below for details. + properties: + maxIndexingCapacityInOcu: + description: Maximum indexing capacity, in OpenSearch Compute + Units (OCUs), for the collection group. + type: number + maxSearchCapacityInOcu: + description: Maximum search capacity, in OpenSearch Compute + Units (OCUs), for the collection group. + type: number + minIndexingCapacityInOcu: + description: Minimum indexing capacity, in OpenSearch Compute + Units (OCUs), for the collection group. + type: number + minSearchCapacityInOcu: + description: Minimum search capacity, in OpenSearch Compute + Units (OCUs), for the collection group. + type: number + type: object + description: + description: |- + Description of the collection group. + Description of the collection group. + type: string + generation: + description: |- + Generation of Amazon OpenSearch Serverless for the collection group. Valid values are CLASSIC and NEXTGEN. Default value is CLASSIC. + Generation of the collection group. + type: string + name: + description: |- + Name of the collection group. + Name of the collection group. + type: string + standbyReplicas: + description: |- + Indicates whether standby replicas should be used for collections in this group. Valid values are ENABLED and DISABLED. If generation is set to NEXTGEN, this argument must be set to ENABLED. + Indicates whether standby replicas should be used for collections in this group. One of `ENABLED` or `DISABLED`. + type: string + tags: + additionalProperties: + type: string + description: Key-value map of resource tags. + type: object + x-kubernetes-map-type: granular + type: object + managementPolicies: + default: + - '*' + description: |- + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + items: + description: |- + A ManagementAction represents an action that the Crossplane controllers + can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + providerConfigRef: + default: + kind: ClusterProviderConfig + 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: + kind: + description: Kind of the referenced object. + type: string + name: + description: Name of the referenced object. + type: string + required: + - kind + - 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. + properties: + name: + description: Name of the secret. + type: string + required: + - name + type: object + required: + - forProvider + type: object + x-kubernetes-validations: + - message: spec.forProvider.name is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.name) + || (has(self.initProvider) && has(self.initProvider.name))' + - message: spec.forProvider.standbyReplicas is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.standbyReplicas) + || (has(self.initProvider) && has(self.initProvider.standbyReplicas))' + status: + description: CollectionGroupStatus defines the observed state of CollectionGroup. + properties: + atProvider: + properties: + arn: + description: Amazon Resource Name (ARN) of the collection group. + type: string + capacityLimits: + description: Configuration block for the collection group's indexing + and search capacity limits. See capacity_limits below for details. + properties: + maxIndexingCapacityInOcu: + description: Maximum indexing capacity, in OpenSearch Compute + Units (OCUs), for the collection group. + type: number + maxSearchCapacityInOcu: + description: Maximum search capacity, in OpenSearch Compute + Units (OCUs), for the collection group. + type: number + minIndexingCapacityInOcu: + description: Minimum indexing capacity, in OpenSearch Compute + Units (OCUs), for the collection group. + type: number + minSearchCapacityInOcu: + description: Minimum search capacity, in OpenSearch Compute + Units (OCUs), for the collection group. + type: number + type: object + createdDate: + description: |- + Date the collection group was created. + Date the collection group was created. + type: string + description: + description: |- + Description of the collection group. + Description of the collection group. + type: string + generation: + description: |- + Generation of Amazon OpenSearch Serverless for the collection group. Valid values are CLASSIC and NEXTGEN. Default value is CLASSIC. + Generation of the collection group. + type: string + id: + description: Unique identifier for the collection group. + type: string + name: + description: |- + Name of the collection group. + Name of the collection group. + type: string + region: + description: |- + Region where this resource will be managed. Defaults to the Region set in the provider configuration. + Region is the region you'd like your resource to be created in. + type: string + standbyReplicas: + description: |- + Indicates whether standby replicas should be used for collections in this group. Valid values are ENABLED and DISABLED. If generation is set to NEXTGEN, this argument must be set to ENABLED. + Indicates whether standby replicas should be used for collections in this group. One of `ENABLED` or `DISABLED`. + type: string + tags: + additionalProperties: + type: string + description: Key-value map of resource tags. + type: object + x-kubernetes-map-type: granular + tagsAll: + additionalProperties: + type: string + description: A map of tags assigned to the resource, including + those inherited from the provider default_tags configuration + block. + type: object + x-kubernetes-map-type: granular + 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 + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + 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 + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + lastHandledReconcileAt: + description: |- + LastHandledReconcileAt holds the value of the most recent + reconcile-requested-at annotation token that the controller has + processed. Users can compare this to the annotation to determine + whether a reconcile request has been handled. + type: string + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/opensearchserverless.aws.m.upbound.io_collections.yaml b/package/crds/opensearchserverless.aws.m.upbound.io_collections.yaml index f8dc87ab68..947251d11c 100644 --- a/package/crds/opensearchserverless.aws.m.upbound.io_collections.yaml +++ b/package/crds/opensearchserverless.aws.m.upbound.io_collections.yaml @@ -64,6 +64,88 @@ spec: Name of the collection group to associate with this collection. Name of the collection group to associate with this collection. type: string + collectionGroupNameRef: + description: Reference to a CollectionGroup in opensearchserverless + to populate collectionGroupName. + properties: + name: + description: Name of the referenced object. + type: string + namespace: + description: Namespace of the referenced object + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + collectionGroupNameSelector: + description: Selector for a CollectionGroup in opensearchserverless + to populate collectionGroupName. + 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 + namespace: + description: Namespace for the selector + type: string + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object description: description: |- Description of the collection. @@ -219,6 +301,88 @@ spec: Name of the collection group to associate with this collection. Name of the collection group to associate with this collection. type: string + collectionGroupNameRef: + description: Reference to a CollectionGroup in opensearchserverless + to populate collectionGroupName. + properties: + name: + description: Name of the referenced object. + type: string + namespace: + description: Namespace of the referenced object + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + collectionGroupNameSelector: + description: Selector for a CollectionGroup in opensearchserverless + to populate collectionGroupName. + 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 + namespace: + description: Namespace for the selector + type: string + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object description: description: |- Description of the collection. diff --git a/package/crds/opensearchserverless.aws.upbound.io_collectiongroups.yaml b/package/crds/opensearchserverless.aws.upbound.io_collectiongroups.yaml new file mode 100644 index 0000000000..4eddd2a281 --- /dev/null +++ b/package/crds/opensearchserverless.aws.upbound.io_collectiongroups.yaml @@ -0,0 +1,430 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.20.1 + name: collectiongroups.opensearchserverless.aws.upbound.io +spec: + group: opensearchserverless.aws.upbound.io + names: + categories: + - crossplane + - managed + - aws + kind: CollectionGroup + listKind: CollectionGroupList + plural: collectiongroups + singular: collectiongroup + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1beta1 + schema: + openAPIV3Schema: + description: CollectionGroup is the Schema for the CollectionGroups 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: CollectionGroupSpec defines the desired state of CollectionGroup + 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. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + capacityLimits: + description: Configuration block for the collection group's indexing + and search capacity limits. See capacity_limits below for details. + properties: + maxIndexingCapacityInOcu: + description: Maximum indexing capacity, in OpenSearch Compute + Units (OCUs), for the collection group. + type: number + maxSearchCapacityInOcu: + description: Maximum search capacity, in OpenSearch Compute + Units (OCUs), for the collection group. + type: number + minIndexingCapacityInOcu: + description: Minimum indexing capacity, in OpenSearch Compute + Units (OCUs), for the collection group. + type: number + minSearchCapacityInOcu: + description: Minimum search capacity, in OpenSearch Compute + Units (OCUs), for the collection group. + type: number + type: object + description: + description: |- + Description of the collection group. + Description of the collection group. + type: string + generation: + description: |- + Generation of Amazon OpenSearch Serverless for the collection group. Valid values are CLASSIC and NEXTGEN. Default value is CLASSIC. + Generation of the collection group. + type: string + name: + description: |- + Name of the collection group. + Name of the collection group. + type: string + region: + description: |- + Region where this resource will be managed. Defaults to the Region set in the provider configuration. + Region is the region you'd like your resource to be created in. + type: string + standbyReplicas: + description: |- + Indicates whether standby replicas should be used for collections in this group. Valid values are ENABLED and DISABLED. If generation is set to NEXTGEN, this argument must be set to ENABLED. + Indicates whether standby replicas should be used for collections in this group. One of `ENABLED` or `DISABLED`. + type: string + tags: + additionalProperties: + type: string + description: Key-value map of resource tags. + type: object + x-kubernetes-map-type: granular + required: + - region + type: object + initProvider: + description: |- + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + properties: + capacityLimits: + description: Configuration block for the collection group's indexing + and search capacity limits. See capacity_limits below for details. + properties: + maxIndexingCapacityInOcu: + description: Maximum indexing capacity, in OpenSearch Compute + Units (OCUs), for the collection group. + type: number + maxSearchCapacityInOcu: + description: Maximum search capacity, in OpenSearch Compute + Units (OCUs), for the collection group. + type: number + minIndexingCapacityInOcu: + description: Minimum indexing capacity, in OpenSearch Compute + Units (OCUs), for the collection group. + type: number + minSearchCapacityInOcu: + description: Minimum search capacity, in OpenSearch Compute + Units (OCUs), for the collection group. + type: number + type: object + description: + description: |- + Description of the collection group. + Description of the collection group. + type: string + generation: + description: |- + Generation of Amazon OpenSearch Serverless for the collection group. Valid values are CLASSIC and NEXTGEN. Default value is CLASSIC. + Generation of the collection group. + type: string + name: + description: |- + Name of the collection group. + Name of the collection group. + type: string + standbyReplicas: + description: |- + Indicates whether standby replicas should be used for collections in this group. Valid values are ENABLED and DISABLED. If generation is set to NEXTGEN, this argument must be set to ENABLED. + Indicates whether standby replicas should be used for collections in this group. One of `ENABLED` or `DISABLED`. + type: string + tags: + additionalProperties: + type: string + description: Key-value map of resource tags. + type: object + x-kubernetes-map-type: granular + type: object + managementPolicies: + default: + - '*' + description: |- + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + items: + description: |- + A ManagementAction represents an action that the Crossplane controllers + can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + 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 + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + 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. + 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 + x-kubernetes-validations: + - message: spec.forProvider.name is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.name) + || (has(self.initProvider) && has(self.initProvider.name))' + - message: spec.forProvider.standbyReplicas is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.standbyReplicas) + || (has(self.initProvider) && has(self.initProvider.standbyReplicas))' + status: + description: CollectionGroupStatus defines the observed state of CollectionGroup. + properties: + atProvider: + properties: + arn: + description: Amazon Resource Name (ARN) of the collection group. + type: string + capacityLimits: + description: Configuration block for the collection group's indexing + and search capacity limits. See capacity_limits below for details. + properties: + maxIndexingCapacityInOcu: + description: Maximum indexing capacity, in OpenSearch Compute + Units (OCUs), for the collection group. + type: number + maxSearchCapacityInOcu: + description: Maximum search capacity, in OpenSearch Compute + Units (OCUs), for the collection group. + type: number + minIndexingCapacityInOcu: + description: Minimum indexing capacity, in OpenSearch Compute + Units (OCUs), for the collection group. + type: number + minSearchCapacityInOcu: + description: Minimum search capacity, in OpenSearch Compute + Units (OCUs), for the collection group. + type: number + type: object + createdDate: + description: |- + Date the collection group was created. + Date the collection group was created. + type: string + description: + description: |- + Description of the collection group. + Description of the collection group. + type: string + generation: + description: |- + Generation of Amazon OpenSearch Serverless for the collection group. Valid values are CLASSIC and NEXTGEN. Default value is CLASSIC. + Generation of the collection group. + type: string + id: + description: Unique identifier for the collection group. + type: string + name: + description: |- + Name of the collection group. + Name of the collection group. + type: string + region: + description: |- + Region where this resource will be managed. Defaults to the Region set in the provider configuration. + Region is the region you'd like your resource to be created in. + type: string + standbyReplicas: + description: |- + Indicates whether standby replicas should be used for collections in this group. Valid values are ENABLED and DISABLED. If generation is set to NEXTGEN, this argument must be set to ENABLED. + Indicates whether standby replicas should be used for collections in this group. One of `ENABLED` or `DISABLED`. + type: string + tags: + additionalProperties: + type: string + description: Key-value map of resource tags. + type: object + x-kubernetes-map-type: granular + tagsAll: + additionalProperties: + type: string + description: A map of tags assigned to the resource, including + those inherited from the provider default_tags configuration + block. + type: object + x-kubernetes-map-type: granular + 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 + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + 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 + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + lastHandledReconcileAt: + description: |- + LastHandledReconcileAt holds the value of the most recent + reconcile-requested-at annotation token that the controller has + processed. Users can compare this to the annotation to determine + whether a reconcile request has been handled. + type: string + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/opensearchserverless.aws.upbound.io_collections.yaml b/package/crds/opensearchserverless.aws.upbound.io_collections.yaml index 4c0e2959dd..a03588d9ff 100644 --- a/package/crds/opensearchserverless.aws.upbound.io_collections.yaml +++ b/package/crds/opensearchserverless.aws.upbound.io_collections.yaml @@ -78,6 +78,82 @@ spec: Name of the collection group to associate with this collection. Name of the collection group to associate with this collection. type: string + collectionGroupNameRef: + description: Reference to a CollectionGroup in opensearchserverless + to populate collectionGroupName. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + collectionGroupNameSelector: + description: Selector for a CollectionGroup in opensearchserverless + to populate collectionGroupName. + 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 + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object description: description: |- Description of the collection. @@ -227,6 +303,82 @@ spec: Name of the collection group to associate with this collection. Name of the collection group to associate with this collection. type: string + collectionGroupNameRef: + description: Reference to a CollectionGroup in opensearchserverless + to populate collectionGroupName. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + collectionGroupNameSelector: + description: Selector for a CollectionGroup in opensearchserverless + to populate collectionGroupName. + 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 + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object description: description: |- Description of the collection.