diff --git a/apis/appconfig/v1alpha1/zz_environment_types.go b/apis/appconfig/v1alpha1/zz_environment_types.go deleted file mode 100755 index a4d916a..0000000 --- a/apis/appconfig/v1alpha1/zz_environment_types.go +++ /dev/null @@ -1,186 +0,0 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by upjet. DO NOT EDIT. - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - - v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" -) - -type EnvironmentInitParameters struct { - - // AppConfig application ID. Must be between 4 and 7 characters in length. - ApplicationID *string `json:"applicationId,omitempty" tf:"application_id,omitempty"` - - // Description of the environment. Can be at most 1024 characters. - Description *string `json:"description,omitempty" tf:"description,omitempty"` - - // Set of Amazon CloudWatch alarms to monitor during the deployment process. Maximum of 5. See Monitor below for more details. - Monitor []MonitorInitParameters `json:"monitor,omitempty" tf:"monitor,omitempty"` - - // Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` - - // Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block. - TagsAll map[string]*string `json:"tagsAll,omitempty" tf:"tags_all,omitempty"` -} - -type EnvironmentObservation struct { - - // AppConfig application ID. Must be between 4 and 7 characters in length. - ApplicationID *string `json:"applicationId,omitempty" tf:"application_id,omitempty"` - - // ARN of the AppConfig Environment. - Arn *string `json:"arn,omitempty" tf:"arn,omitempty"` - - // Description of the environment. Can be at most 1024 characters. - Description *string `json:"description,omitempty" tf:"description,omitempty"` - - // AppConfig environment ID. - EnvironmentID *string `json:"environmentId,omitempty" tf:"environment_id,omitempty"` - - // AppConfig environment ID and application ID separated by a colon (:). - ID *string `json:"id,omitempty" tf:"id,omitempty"` - - // Set of Amazon CloudWatch alarms to monitor during the deployment process. Maximum of 5. See Monitor below for more details. - Monitor []MonitorObservation `json:"monitor,omitempty" tf:"monitor,omitempty"` - - // State of the environment. Possible values are READY_FOR_DEPLOYMENT, DEPLOYING, ROLLING_BACK - // or ROLLED_BACK. - State *string `json:"state,omitempty" tf:"state,omitempty"` - - // Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` - - // Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block. - TagsAll map[string]*string `json:"tagsAll,omitempty" tf:"tags_all,omitempty"` -} - -type EnvironmentParameters struct { - - // AppConfig application ID. Must be between 4 and 7 characters in length. - // +kubebuilder:validation:Optional - ApplicationID *string `json:"applicationId,omitempty" tf:"application_id,omitempty"` - - // Description of the environment. Can be at most 1024 characters. - // +kubebuilder:validation:Optional - Description *string `json:"description,omitempty" tf:"description,omitempty"` - - // Set of Amazon CloudWatch alarms to monitor during the deployment process. Maximum of 5. See Monitor below for more details. - // +kubebuilder:validation:Optional - Monitor []MonitorParameters `json:"monitor,omitempty" tf:"monitor,omitempty"` - - // Region is the region you'd like your resource to be created in. - // +upjet:crd:field:TFTag=- - // +kubebuilder:validation:Optional - Region *string `json:"region,omitempty" tf:"-"` - - // Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level. - // +kubebuilder:validation:Optional - Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` - - // Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block. - // +kubebuilder:validation:Optional - TagsAll map[string]*string `json:"tagsAll,omitempty" tf:"tags_all,omitempty"` -} - -type MonitorInitParameters struct { - - // ARN of the Amazon CloudWatch alarm. - AlarmArn *string `json:"alarmArn,omitempty" tf:"alarm_arn,omitempty"` - - // ARN of an IAM role for AWS AppConfig to monitor alarm_arn. - AlarmRoleArn *string `json:"alarmRoleArn,omitempty" tf:"alarm_role_arn,omitempty"` -} - -type MonitorObservation struct { - - // ARN of the Amazon CloudWatch alarm. - AlarmArn *string `json:"alarmArn,omitempty" tf:"alarm_arn,omitempty"` - - // ARN of an IAM role for AWS AppConfig to monitor alarm_arn. - AlarmRoleArn *string `json:"alarmRoleArn,omitempty" tf:"alarm_role_arn,omitempty"` -} - -type MonitorParameters struct { - - // ARN of the Amazon CloudWatch alarm. - // +kubebuilder:validation:Optional - AlarmArn *string `json:"alarmArn" tf:"alarm_arn,omitempty"` - - // ARN of an IAM role for AWS AppConfig to monitor alarm_arn. - // +kubebuilder:validation:Optional - AlarmRoleArn *string `json:"alarmRoleArn,omitempty" tf:"alarm_role_arn,omitempty"` -} - -// EnvironmentSpec defines the desired state of Environment -type EnvironmentSpec struct { - v1.ResourceSpec `json:",inline"` - ForProvider EnvironmentParameters `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 EnvironmentInitParameters `json:"initProvider,omitempty"` -} - -// EnvironmentStatus defines the observed state of Environment. -type EnvironmentStatus struct { - v1.ResourceStatus `json:",inline"` - AtProvider EnvironmentObservation `json:"atProvider,omitempty"` -} - -// +kubebuilder:object:root=true - -// Environment is the Schema for the Environments API. Provides an AppConfig Environment resource. -// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" -// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" -// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" -// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" -// +kubebuilder:subresource:status -// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,aws} -type Environment 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.applicationId) || (has(self.initProvider) && has(self.initProvider.applicationId))",message="spec.forProvider.applicationId is a required parameter" - // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.region)",message="spec.forProvider.region is a required parameter" - Spec EnvironmentSpec `json:"spec"` - Status EnvironmentStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// EnvironmentList contains a list of Environments -type EnvironmentList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Environment `json:"items"` -} - -// Repository type metadata. -var ( - Environment_Kind = "Environment" - Environment_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: Environment_Kind}.String() - Environment_KindAPIVersion = Environment_Kind + "." + CRDGroupVersion.String() - Environment_GroupVersionKind = CRDGroupVersion.WithKind(Environment_Kind) -) - -func init() { - SchemeBuilder.Register(&Environment{}, &EnvironmentList{}) -} diff --git a/apis/appconfig/v1alpha1/zz_generated.deepcopy.go b/apis/appconfig/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index 4f044e9..0000000 --- a/apis/appconfig/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,399 +0,0 @@ -//go:build !ignore_autogenerated - -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Environment) DeepCopyInto(out *Environment) { - *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 Environment. -func (in *Environment) DeepCopy() *Environment { - if in == nil { - return nil - } - out := new(Environment) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Environment) 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 *EnvironmentInitParameters) DeepCopyInto(out *EnvironmentInitParameters) { - *out = *in - if in.ApplicationID != nil { - in, out := &in.ApplicationID, &out.ApplicationID - *out = new(string) - **out = **in - } - if in.Description != nil { - in, out := &in.Description, &out.Description - *out = new(string) - **out = **in - } - if in.Monitor != nil { - in, out := &in.Monitor, &out.Monitor - *out = make([]MonitorInitParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - 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 EnvironmentInitParameters. -func (in *EnvironmentInitParameters) DeepCopy() *EnvironmentInitParameters { - if in == nil { - return nil - } - out := new(EnvironmentInitParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *EnvironmentList) DeepCopyInto(out *EnvironmentList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Environment, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvironmentList. -func (in *EnvironmentList) DeepCopy() *EnvironmentList { - if in == nil { - return nil - } - out := new(EnvironmentList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *EnvironmentList) 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 *EnvironmentObservation) DeepCopyInto(out *EnvironmentObservation) { - *out = *in - if in.ApplicationID != nil { - in, out := &in.ApplicationID, &out.ApplicationID - *out = new(string) - **out = **in - } - if in.Arn != nil { - in, out := &in.Arn, &out.Arn - *out = new(string) - **out = **in - } - if in.Description != nil { - in, out := &in.Description, &out.Description - *out = new(string) - **out = **in - } - if in.EnvironmentID != nil { - in, out := &in.EnvironmentID, &out.EnvironmentID - *out = new(string) - **out = **in - } - if in.ID != nil { - in, out := &in.ID, &out.ID - *out = new(string) - **out = **in - } - if in.Monitor != nil { - in, out := &in.Monitor, &out.Monitor - *out = make([]MonitorObservation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.State != nil { - in, out := &in.State, &out.State - *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 EnvironmentObservation. -func (in *EnvironmentObservation) DeepCopy() *EnvironmentObservation { - if in == nil { - return nil - } - out := new(EnvironmentObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *EnvironmentParameters) DeepCopyInto(out *EnvironmentParameters) { - *out = *in - if in.ApplicationID != nil { - in, out := &in.ApplicationID, &out.ApplicationID - *out = new(string) - **out = **in - } - if in.Description != nil { - in, out := &in.Description, &out.Description - *out = new(string) - **out = **in - } - if in.Monitor != nil { - in, out := &in.Monitor, &out.Monitor - *out = make([]MonitorParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Region != nil { - in, out := &in.Region, &out.Region - *out = new(string) - **out = **in - } - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make(map[string]*string, len(*in)) - for key, val := range *in { - var outVal *string - if val == nil { - (*out)[key] = nil - } else { - 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 EnvironmentParameters. -func (in *EnvironmentParameters) DeepCopy() *EnvironmentParameters { - if in == nil { - return nil - } - out := new(EnvironmentParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *EnvironmentSpec) DeepCopyInto(out *EnvironmentSpec) { - *out = *in - in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) - in.ForProvider.DeepCopyInto(&out.ForProvider) - in.InitProvider.DeepCopyInto(&out.InitProvider) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvironmentSpec. -func (in *EnvironmentSpec) DeepCopy() *EnvironmentSpec { - if in == nil { - return nil - } - out := new(EnvironmentSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *EnvironmentStatus) DeepCopyInto(out *EnvironmentStatus) { - *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) - in.AtProvider.DeepCopyInto(&out.AtProvider) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvironmentStatus. -func (in *EnvironmentStatus) DeepCopy() *EnvironmentStatus { - if in == nil { - return nil - } - out := new(EnvironmentStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MonitorInitParameters) DeepCopyInto(out *MonitorInitParameters) { - *out = *in - if in.AlarmArn != nil { - in, out := &in.AlarmArn, &out.AlarmArn - *out = new(string) - **out = **in - } - if in.AlarmRoleArn != nil { - in, out := &in.AlarmRoleArn, &out.AlarmRoleArn - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MonitorInitParameters. -func (in *MonitorInitParameters) DeepCopy() *MonitorInitParameters { - if in == nil { - return nil - } - out := new(MonitorInitParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MonitorObservation) DeepCopyInto(out *MonitorObservation) { - *out = *in - if in.AlarmArn != nil { - in, out := &in.AlarmArn, &out.AlarmArn - *out = new(string) - **out = **in - } - if in.AlarmRoleArn != nil { - in, out := &in.AlarmRoleArn, &out.AlarmRoleArn - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MonitorObservation. -func (in *MonitorObservation) DeepCopy() *MonitorObservation { - if in == nil { - return nil - } - out := new(MonitorObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MonitorParameters) DeepCopyInto(out *MonitorParameters) { - *out = *in - if in.AlarmArn != nil { - in, out := &in.AlarmArn, &out.AlarmArn - *out = new(string) - **out = **in - } - if in.AlarmRoleArn != nil { - in, out := &in.AlarmRoleArn, &out.AlarmRoleArn - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MonitorParameters. -func (in *MonitorParameters) DeepCopy() *MonitorParameters { - if in == nil { - return nil - } - out := new(MonitorParameters) - in.DeepCopyInto(out) - return out -} diff --git a/apis/appconfig/v1alpha1/zz_generated.managed.go b/apis/appconfig/v1alpha1/zz_generated.managed.go deleted file mode 100644 index 5d6d643..0000000 --- a/apis/appconfig/v1alpha1/zz_generated.managed.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright 2022 Upbound Inc. -*/ -// Code generated by angryjet. DO NOT EDIT. - -package v1alpha1 - -import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - -// GetCondition of this Environment. -func (mg *Environment) GetCondition(ct xpv1.ConditionType) xpv1.Condition { - return mg.Status.GetCondition(ct) -} - -// GetDeletionPolicy of this Environment. -func (mg *Environment) GetDeletionPolicy() xpv1.DeletionPolicy { - return mg.Spec.DeletionPolicy -} - -// GetManagementPolicies of this Environment. -func (mg *Environment) GetManagementPolicies() xpv1.ManagementPolicies { - return mg.Spec.ManagementPolicies -} - -// GetProviderConfigReference of this Environment. -func (mg *Environment) GetProviderConfigReference() *xpv1.Reference { - return mg.Spec.ProviderConfigReference -} - -// GetPublishConnectionDetailsTo of this Environment. -func (mg *Environment) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { - return mg.Spec.PublishConnectionDetailsTo -} - -// GetWriteConnectionSecretToReference of this Environment. -func (mg *Environment) GetWriteConnectionSecretToReference() *xpv1.SecretReference { - return mg.Spec.WriteConnectionSecretToReference -} - -// SetConditions of this Environment. -func (mg *Environment) SetConditions(c ...xpv1.Condition) { - mg.Status.SetConditions(c...) -} - -// SetDeletionPolicy of this Environment. -func (mg *Environment) SetDeletionPolicy(r xpv1.DeletionPolicy) { - mg.Spec.DeletionPolicy = r -} - -// SetManagementPolicies of this Environment. -func (mg *Environment) SetManagementPolicies(r xpv1.ManagementPolicies) { - mg.Spec.ManagementPolicies = r -} - -// SetProviderConfigReference of this Environment. -func (mg *Environment) SetProviderConfigReference(r *xpv1.Reference) { - mg.Spec.ProviderConfigReference = r -} - -// SetPublishConnectionDetailsTo of this Environment. -func (mg *Environment) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { - mg.Spec.PublishConnectionDetailsTo = r -} - -// SetWriteConnectionSecretToReference of this Environment. -func (mg *Environment) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { - mg.Spec.WriteConnectionSecretToReference = r -} diff --git a/apis/appconfig/v1alpha1/zz_generated.managedlist.go b/apis/appconfig/v1alpha1/zz_generated.managedlist.go deleted file mode 100644 index 8ba540b..0000000 --- a/apis/appconfig/v1alpha1/zz_generated.managedlist.go +++ /dev/null @@ -1,17 +0,0 @@ -/* -Copyright 2022 Upbound Inc. -*/ -// Code generated by angryjet. DO NOT EDIT. - -package v1alpha1 - -import resource "github.com/crossplane/crossplane-runtime/pkg/resource" - -// GetItems of this EnvironmentList. -func (l *EnvironmentList) GetItems() []resource.Managed { - items := make([]resource.Managed, len(l.Items)) - for i := range l.Items { - items[i] = &l.Items[i] - } - return items -} diff --git a/apis/appconfig/v1alpha1/zz_generated_terraformed.go b/apis/appconfig/v1alpha1/zz_generated_terraformed.go deleted file mode 100755 index 80af668..0000000 --- a/apis/appconfig/v1alpha1/zz_generated_terraformed.go +++ /dev/null @@ -1,133 +0,0 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by upjet. DO NOT EDIT. - -package v1alpha1 - -import ( - "dario.cat/mergo" - "github.com/pkg/errors" - - "github.com/crossplane/upjet/pkg/resource" - "github.com/crossplane/upjet/pkg/resource/json" -) - -// GetTerraformResourceType returns Terraform resource type for this Environment -func (mg *Environment) GetTerraformResourceType() string { - return "aws_appconfig_environment" -} - -// GetConnectionDetailsMapping for this Environment -func (tr *Environment) GetConnectionDetailsMapping() map[string]string { - return nil -} - -// GetObservation of this Environment -func (tr *Environment) 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 Environment -func (tr *Environment) SetObservation(obs map[string]any) error { - p, err := json.TFParser.Marshal(obs) - if err != nil { - return err - } - return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) -} - -// GetID returns ID of underlying Terraform resource of this Environment -func (tr *Environment) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" - } - return *tr.Status.AtProvider.ID -} - -// GetParameters of this Environment -func (tr *Environment) 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 Environment -func (tr *Environment) 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 Environment -func (tr *Environment) 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 Environment -func (tr *Environment) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { - params, err := tr.GetParameters() - if err != nil { - return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", 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 '%q'", 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 '%q'", tr.GetName()) - } - - return params, nil -} - -// LateInitialize this Environment using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *Environment) LateInitialize(attrs []byte) (bool, error) { - params := &EnvironmentParameters{} - 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 *Environment) GetTerraformSchemaVersion() int { - return 0 -} diff --git a/apis/appconfig/v1alpha1/zz_groupversion_info.go b/apis/appconfig/v1alpha1/zz_groupversion_info.go deleted file mode 100755 index b756427..0000000 --- a/apis/appconfig/v1alpha1/zz_groupversion_info.go +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by upjet. DO NOT EDIT. - -// +kubebuilder:object:generate=true -// +groupName=appconfig.aws.kubedb.com -// +versionName=v1alpha1 -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -// Package type metadata. -const ( - CRDGroup = "appconfig.aws.kubedb.com" - CRDVersion = "v1alpha1" -) - -var ( - // CRDGroupVersion is the API Group Version used to register the objects - CRDGroupVersion = schema.GroupVersion{Group: CRDGroup, Version: CRDVersion} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: CRDGroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme -) diff --git a/apis/cognito/v1alpha1/zz_generated.deepcopy.go b/apis/cognito/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index 8fba954..0000000 --- a/apis/cognito/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,843 +0,0 @@ -//go:build !ignore_autogenerated - -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AnalyticsConfigurationInitParameters) DeepCopyInto(out *AnalyticsConfigurationInitParameters) { - *out = *in - if in.ApplicationArn != nil { - in, out := &in.ApplicationArn, &out.ApplicationArn - *out = new(string) - **out = **in - } - if in.ApplicationID != nil { - in, out := &in.ApplicationID, &out.ApplicationID - *out = new(string) - **out = **in - } - if in.ExternalID != nil { - in, out := &in.ExternalID, &out.ExternalID - *out = new(string) - **out = **in - } - if in.RoleArn != nil { - in, out := &in.RoleArn, &out.RoleArn - *out = new(string) - **out = **in - } - if in.UserDataShared != nil { - in, out := &in.UserDataShared, &out.UserDataShared - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AnalyticsConfigurationInitParameters. -func (in *AnalyticsConfigurationInitParameters) DeepCopy() *AnalyticsConfigurationInitParameters { - if in == nil { - return nil - } - out := new(AnalyticsConfigurationInitParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AnalyticsConfigurationObservation) DeepCopyInto(out *AnalyticsConfigurationObservation) { - *out = *in - if in.ApplicationArn != nil { - in, out := &in.ApplicationArn, &out.ApplicationArn - *out = new(string) - **out = **in - } - if in.ApplicationID != nil { - in, out := &in.ApplicationID, &out.ApplicationID - *out = new(string) - **out = **in - } - if in.ExternalID != nil { - in, out := &in.ExternalID, &out.ExternalID - *out = new(string) - **out = **in - } - if in.RoleArn != nil { - in, out := &in.RoleArn, &out.RoleArn - *out = new(string) - **out = **in - } - if in.UserDataShared != nil { - in, out := &in.UserDataShared, &out.UserDataShared - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AnalyticsConfigurationObservation. -func (in *AnalyticsConfigurationObservation) DeepCopy() *AnalyticsConfigurationObservation { - if in == nil { - return nil - } - out := new(AnalyticsConfigurationObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AnalyticsConfigurationParameters) DeepCopyInto(out *AnalyticsConfigurationParameters) { - *out = *in - if in.ApplicationArn != nil { - in, out := &in.ApplicationArn, &out.ApplicationArn - *out = new(string) - **out = **in - } - if in.ApplicationID != nil { - in, out := &in.ApplicationID, &out.ApplicationID - *out = new(string) - **out = **in - } - if in.ExternalID != nil { - in, out := &in.ExternalID, &out.ExternalID - *out = new(string) - **out = **in - } - if in.RoleArn != nil { - in, out := &in.RoleArn, &out.RoleArn - *out = new(string) - **out = **in - } - if in.UserDataShared != nil { - in, out := &in.UserDataShared, &out.UserDataShared - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AnalyticsConfigurationParameters. -func (in *AnalyticsConfigurationParameters) DeepCopy() *AnalyticsConfigurationParameters { - if in == nil { - return nil - } - out := new(AnalyticsConfigurationParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TokenValidityUnitsInitParameters) DeepCopyInto(out *TokenValidityUnitsInitParameters) { - *out = *in - if in.AccessToken != nil { - in, out := &in.AccessToken, &out.AccessToken - *out = new(string) - **out = **in - } - if in.IDToken != nil { - in, out := &in.IDToken, &out.IDToken - *out = new(string) - **out = **in - } - if in.RefreshToken != nil { - in, out := &in.RefreshToken, &out.RefreshToken - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TokenValidityUnitsInitParameters. -func (in *TokenValidityUnitsInitParameters) DeepCopy() *TokenValidityUnitsInitParameters { - if in == nil { - return nil - } - out := new(TokenValidityUnitsInitParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TokenValidityUnitsObservation) DeepCopyInto(out *TokenValidityUnitsObservation) { - *out = *in - if in.AccessToken != nil { - in, out := &in.AccessToken, &out.AccessToken - *out = new(string) - **out = **in - } - if in.IDToken != nil { - in, out := &in.IDToken, &out.IDToken - *out = new(string) - **out = **in - } - if in.RefreshToken != nil { - in, out := &in.RefreshToken, &out.RefreshToken - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TokenValidityUnitsObservation. -func (in *TokenValidityUnitsObservation) DeepCopy() *TokenValidityUnitsObservation { - if in == nil { - return nil - } - out := new(TokenValidityUnitsObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TokenValidityUnitsParameters) DeepCopyInto(out *TokenValidityUnitsParameters) { - *out = *in - if in.AccessToken != nil { - in, out := &in.AccessToken, &out.AccessToken - *out = new(string) - **out = **in - } - if in.IDToken != nil { - in, out := &in.IDToken, &out.IDToken - *out = new(string) - **out = **in - } - if in.RefreshToken != nil { - in, out := &in.RefreshToken, &out.RefreshToken - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TokenValidityUnitsParameters. -func (in *TokenValidityUnitsParameters) DeepCopy() *TokenValidityUnitsParameters { - if in == nil { - return nil - } - out := new(TokenValidityUnitsParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UserPoolClient) DeepCopyInto(out *UserPoolClient) { - *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 UserPoolClient. -func (in *UserPoolClient) DeepCopy() *UserPoolClient { - if in == nil { - return nil - } - out := new(UserPoolClient) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *UserPoolClient) 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 *UserPoolClientInitParameters) DeepCopyInto(out *UserPoolClientInitParameters) { - *out = *in - if in.AccessTokenValidity != nil { - in, out := &in.AccessTokenValidity, &out.AccessTokenValidity - *out = new(float64) - **out = **in - } - if in.AllowedOauthFlows != nil { - in, out := &in.AllowedOauthFlows, &out.AllowedOauthFlows - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } - if in.AllowedOauthFlowsUserPoolClient != nil { - in, out := &in.AllowedOauthFlowsUserPoolClient, &out.AllowedOauthFlowsUserPoolClient - *out = new(bool) - **out = **in - } - if in.AllowedOauthScopes != nil { - in, out := &in.AllowedOauthScopes, &out.AllowedOauthScopes - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } - if in.AnalyticsConfiguration != nil { - in, out := &in.AnalyticsConfiguration, &out.AnalyticsConfiguration - *out = make([]AnalyticsConfigurationInitParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.AuthSessionValidity != nil { - in, out := &in.AuthSessionValidity, &out.AuthSessionValidity - *out = new(float64) - **out = **in - } - if in.CallbackUrls != nil { - in, out := &in.CallbackUrls, &out.CallbackUrls - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } - if in.DefaultRedirectURI != nil { - in, out := &in.DefaultRedirectURI, &out.DefaultRedirectURI - *out = new(string) - **out = **in - } - if in.EnablePropagateAdditionalUserContextData != nil { - in, out := &in.EnablePropagateAdditionalUserContextData, &out.EnablePropagateAdditionalUserContextData - *out = new(bool) - **out = **in - } - if in.EnableTokenRevocation != nil { - in, out := &in.EnableTokenRevocation, &out.EnableTokenRevocation - *out = new(bool) - **out = **in - } - if in.ExplicitAuthFlows != nil { - in, out := &in.ExplicitAuthFlows, &out.ExplicitAuthFlows - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } - if in.GenerateSecret != nil { - in, out := &in.GenerateSecret, &out.GenerateSecret - *out = new(bool) - **out = **in - } - if in.IDTokenValidity != nil { - in, out := &in.IDTokenValidity, &out.IDTokenValidity - *out = new(float64) - **out = **in - } - if in.LogoutUrls != nil { - in, out := &in.LogoutUrls, &out.LogoutUrls - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } - if in.PreventUserExistenceErrors != nil { - in, out := &in.PreventUserExistenceErrors, &out.PreventUserExistenceErrors - *out = new(string) - **out = **in - } - if in.ReadAttributes != nil { - in, out := &in.ReadAttributes, &out.ReadAttributes - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } - if in.RefreshTokenValidity != nil { - in, out := &in.RefreshTokenValidity, &out.RefreshTokenValidity - *out = new(float64) - **out = **in - } - if in.SupportedIdentityProviders != nil { - in, out := &in.SupportedIdentityProviders, &out.SupportedIdentityProviders - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } - if in.TokenValidityUnits != nil { - in, out := &in.TokenValidityUnits, &out.TokenValidityUnits - *out = make([]TokenValidityUnitsInitParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.UserPoolID != nil { - in, out := &in.UserPoolID, &out.UserPoolID - *out = new(string) - **out = **in - } - if in.WriteAttributes != nil { - in, out := &in.WriteAttributes, &out.WriteAttributes - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserPoolClientInitParameters. -func (in *UserPoolClientInitParameters) DeepCopy() *UserPoolClientInitParameters { - if in == nil { - return nil - } - out := new(UserPoolClientInitParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UserPoolClientList) DeepCopyInto(out *UserPoolClientList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]UserPoolClient, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserPoolClientList. -func (in *UserPoolClientList) DeepCopy() *UserPoolClientList { - if in == nil { - return nil - } - out := new(UserPoolClientList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *UserPoolClientList) 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 *UserPoolClientObservation) DeepCopyInto(out *UserPoolClientObservation) { - *out = *in - if in.AccessTokenValidity != nil { - in, out := &in.AccessTokenValidity, &out.AccessTokenValidity - *out = new(float64) - **out = **in - } - if in.AllowedOauthFlows != nil { - in, out := &in.AllowedOauthFlows, &out.AllowedOauthFlows - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } - if in.AllowedOauthFlowsUserPoolClient != nil { - in, out := &in.AllowedOauthFlowsUserPoolClient, &out.AllowedOauthFlowsUserPoolClient - *out = new(bool) - **out = **in - } - if in.AllowedOauthScopes != nil { - in, out := &in.AllowedOauthScopes, &out.AllowedOauthScopes - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } - if in.AnalyticsConfiguration != nil { - in, out := &in.AnalyticsConfiguration, &out.AnalyticsConfiguration - *out = make([]AnalyticsConfigurationObservation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.AuthSessionValidity != nil { - in, out := &in.AuthSessionValidity, &out.AuthSessionValidity - *out = new(float64) - **out = **in - } - if in.CallbackUrls != nil { - in, out := &in.CallbackUrls, &out.CallbackUrls - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } - if in.DefaultRedirectURI != nil { - in, out := &in.DefaultRedirectURI, &out.DefaultRedirectURI - *out = new(string) - **out = **in - } - if in.EnablePropagateAdditionalUserContextData != nil { - in, out := &in.EnablePropagateAdditionalUserContextData, &out.EnablePropagateAdditionalUserContextData - *out = new(bool) - **out = **in - } - if in.EnableTokenRevocation != nil { - in, out := &in.EnableTokenRevocation, &out.EnableTokenRevocation - *out = new(bool) - **out = **in - } - if in.ExplicitAuthFlows != nil { - in, out := &in.ExplicitAuthFlows, &out.ExplicitAuthFlows - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } - if in.GenerateSecret != nil { - in, out := &in.GenerateSecret, &out.GenerateSecret - *out = new(bool) - **out = **in - } - if in.ID != nil { - in, out := &in.ID, &out.ID - *out = new(string) - **out = **in - } - if in.IDTokenValidity != nil { - in, out := &in.IDTokenValidity, &out.IDTokenValidity - *out = new(float64) - **out = **in - } - if in.LogoutUrls != nil { - in, out := &in.LogoutUrls, &out.LogoutUrls - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } - if in.PreventUserExistenceErrors != nil { - in, out := &in.PreventUserExistenceErrors, &out.PreventUserExistenceErrors - *out = new(string) - **out = **in - } - if in.ReadAttributes != nil { - in, out := &in.ReadAttributes, &out.ReadAttributes - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } - if in.RefreshTokenValidity != nil { - in, out := &in.RefreshTokenValidity, &out.RefreshTokenValidity - *out = new(float64) - **out = **in - } - if in.SupportedIdentityProviders != nil { - in, out := &in.SupportedIdentityProviders, &out.SupportedIdentityProviders - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } - if in.TokenValidityUnits != nil { - in, out := &in.TokenValidityUnits, &out.TokenValidityUnits - *out = make([]TokenValidityUnitsObservation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.UserPoolID != nil { - in, out := &in.UserPoolID, &out.UserPoolID - *out = new(string) - **out = **in - } - if in.WriteAttributes != nil { - in, out := &in.WriteAttributes, &out.WriteAttributes - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserPoolClientObservation. -func (in *UserPoolClientObservation) DeepCopy() *UserPoolClientObservation { - if in == nil { - return nil - } - out := new(UserPoolClientObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UserPoolClientParameters) DeepCopyInto(out *UserPoolClientParameters) { - *out = *in - if in.AccessTokenValidity != nil { - in, out := &in.AccessTokenValidity, &out.AccessTokenValidity - *out = new(float64) - **out = **in - } - if in.AllowedOauthFlows != nil { - in, out := &in.AllowedOauthFlows, &out.AllowedOauthFlows - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } - if in.AllowedOauthFlowsUserPoolClient != nil { - in, out := &in.AllowedOauthFlowsUserPoolClient, &out.AllowedOauthFlowsUserPoolClient - *out = new(bool) - **out = **in - } - if in.AllowedOauthScopes != nil { - in, out := &in.AllowedOauthScopes, &out.AllowedOauthScopes - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } - if in.AnalyticsConfiguration != nil { - in, out := &in.AnalyticsConfiguration, &out.AnalyticsConfiguration - *out = make([]AnalyticsConfigurationParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.AuthSessionValidity != nil { - in, out := &in.AuthSessionValidity, &out.AuthSessionValidity - *out = new(float64) - **out = **in - } - if in.CallbackUrls != nil { - in, out := &in.CallbackUrls, &out.CallbackUrls - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } - if in.DefaultRedirectURI != nil { - in, out := &in.DefaultRedirectURI, &out.DefaultRedirectURI - *out = new(string) - **out = **in - } - if in.EnablePropagateAdditionalUserContextData != nil { - in, out := &in.EnablePropagateAdditionalUserContextData, &out.EnablePropagateAdditionalUserContextData - *out = new(bool) - **out = **in - } - if in.EnableTokenRevocation != nil { - in, out := &in.EnableTokenRevocation, &out.EnableTokenRevocation - *out = new(bool) - **out = **in - } - if in.ExplicitAuthFlows != nil { - in, out := &in.ExplicitAuthFlows, &out.ExplicitAuthFlows - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } - if in.GenerateSecret != nil { - in, out := &in.GenerateSecret, &out.GenerateSecret - *out = new(bool) - **out = **in - } - if in.IDTokenValidity != nil { - in, out := &in.IDTokenValidity, &out.IDTokenValidity - *out = new(float64) - **out = **in - } - if in.LogoutUrls != nil { - in, out := &in.LogoutUrls, &out.LogoutUrls - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } - if in.PreventUserExistenceErrors != nil { - in, out := &in.PreventUserExistenceErrors, &out.PreventUserExistenceErrors - *out = new(string) - **out = **in - } - if in.ReadAttributes != nil { - in, out := &in.ReadAttributes, &out.ReadAttributes - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } - if in.RefreshTokenValidity != nil { - in, out := &in.RefreshTokenValidity, &out.RefreshTokenValidity - *out = new(float64) - **out = **in - } - if in.Region != nil { - in, out := &in.Region, &out.Region - *out = new(string) - **out = **in - } - if in.SupportedIdentityProviders != nil { - in, out := &in.SupportedIdentityProviders, &out.SupportedIdentityProviders - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } - if in.TokenValidityUnits != nil { - in, out := &in.TokenValidityUnits, &out.TokenValidityUnits - *out = make([]TokenValidityUnitsParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.UserPoolID != nil { - in, out := &in.UserPoolID, &out.UserPoolID - *out = new(string) - **out = **in - } - if in.WriteAttributes != nil { - in, out := &in.WriteAttributes, &out.WriteAttributes - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserPoolClientParameters. -func (in *UserPoolClientParameters) DeepCopy() *UserPoolClientParameters { - if in == nil { - return nil - } - out := new(UserPoolClientParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UserPoolClientSpec) DeepCopyInto(out *UserPoolClientSpec) { - *out = *in - in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) - in.ForProvider.DeepCopyInto(&out.ForProvider) - in.InitProvider.DeepCopyInto(&out.InitProvider) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserPoolClientSpec. -func (in *UserPoolClientSpec) DeepCopy() *UserPoolClientSpec { - if in == nil { - return nil - } - out := new(UserPoolClientSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UserPoolClientStatus) DeepCopyInto(out *UserPoolClientStatus) { - *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) - in.AtProvider.DeepCopyInto(&out.AtProvider) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserPoolClientStatus. -func (in *UserPoolClientStatus) DeepCopy() *UserPoolClientStatus { - if in == nil { - return nil - } - out := new(UserPoolClientStatus) - in.DeepCopyInto(out) - return out -} diff --git a/apis/cognito/v1alpha1/zz_generated.managed.go b/apis/cognito/v1alpha1/zz_generated.managed.go deleted file mode 100644 index 71ce98a..0000000 --- a/apis/cognito/v1alpha1/zz_generated.managed.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright 2022 Upbound Inc. -*/ -// Code generated by angryjet. DO NOT EDIT. - -package v1alpha1 - -import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - -// GetCondition of this UserPoolClient. -func (mg *UserPoolClient) GetCondition(ct xpv1.ConditionType) xpv1.Condition { - return mg.Status.GetCondition(ct) -} - -// GetDeletionPolicy of this UserPoolClient. -func (mg *UserPoolClient) GetDeletionPolicy() xpv1.DeletionPolicy { - return mg.Spec.DeletionPolicy -} - -// GetManagementPolicies of this UserPoolClient. -func (mg *UserPoolClient) GetManagementPolicies() xpv1.ManagementPolicies { - return mg.Spec.ManagementPolicies -} - -// GetProviderConfigReference of this UserPoolClient. -func (mg *UserPoolClient) GetProviderConfigReference() *xpv1.Reference { - return mg.Spec.ProviderConfigReference -} - -// GetPublishConnectionDetailsTo of this UserPoolClient. -func (mg *UserPoolClient) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { - return mg.Spec.PublishConnectionDetailsTo -} - -// GetWriteConnectionSecretToReference of this UserPoolClient. -func (mg *UserPoolClient) GetWriteConnectionSecretToReference() *xpv1.SecretReference { - return mg.Spec.WriteConnectionSecretToReference -} - -// SetConditions of this UserPoolClient. -func (mg *UserPoolClient) SetConditions(c ...xpv1.Condition) { - mg.Status.SetConditions(c...) -} - -// SetDeletionPolicy of this UserPoolClient. -func (mg *UserPoolClient) SetDeletionPolicy(r xpv1.DeletionPolicy) { - mg.Spec.DeletionPolicy = r -} - -// SetManagementPolicies of this UserPoolClient. -func (mg *UserPoolClient) SetManagementPolicies(r xpv1.ManagementPolicies) { - mg.Spec.ManagementPolicies = r -} - -// SetProviderConfigReference of this UserPoolClient. -func (mg *UserPoolClient) SetProviderConfigReference(r *xpv1.Reference) { - mg.Spec.ProviderConfigReference = r -} - -// SetPublishConnectionDetailsTo of this UserPoolClient. -func (mg *UserPoolClient) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { - mg.Spec.PublishConnectionDetailsTo = r -} - -// SetWriteConnectionSecretToReference of this UserPoolClient. -func (mg *UserPoolClient) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { - mg.Spec.WriteConnectionSecretToReference = r -} diff --git a/apis/cognito/v1alpha1/zz_generated.managedlist.go b/apis/cognito/v1alpha1/zz_generated.managedlist.go deleted file mode 100644 index e2bc941..0000000 --- a/apis/cognito/v1alpha1/zz_generated.managedlist.go +++ /dev/null @@ -1,17 +0,0 @@ -/* -Copyright 2022 Upbound Inc. -*/ -// Code generated by angryjet. DO NOT EDIT. - -package v1alpha1 - -import resource "github.com/crossplane/crossplane-runtime/pkg/resource" - -// GetItems of this UserPoolClientList. -func (l *UserPoolClientList) GetItems() []resource.Managed { - items := make([]resource.Managed, len(l.Items)) - for i := range l.Items { - items[i] = &l.Items[i] - } - return items -} diff --git a/apis/cognito/v1alpha1/zz_generated_terraformed.go b/apis/cognito/v1alpha1/zz_generated_terraformed.go deleted file mode 100755 index 0305d31..0000000 --- a/apis/cognito/v1alpha1/zz_generated_terraformed.go +++ /dev/null @@ -1,133 +0,0 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by upjet. DO NOT EDIT. - -package v1alpha1 - -import ( - "dario.cat/mergo" - "github.com/pkg/errors" - - "github.com/crossplane/upjet/pkg/resource" - "github.com/crossplane/upjet/pkg/resource/json" -) - -// GetTerraformResourceType returns Terraform resource type for this UserPoolClient -func (mg *UserPoolClient) GetTerraformResourceType() string { - return "aws_cognito_user_pool_client" -} - -// GetConnectionDetailsMapping for this UserPoolClient -func (tr *UserPoolClient) GetConnectionDetailsMapping() map[string]string { - return map[string]string{"client_secret": "status.atProvider.clientSecret"} -} - -// GetObservation of this UserPoolClient -func (tr *UserPoolClient) 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 UserPoolClient -func (tr *UserPoolClient) SetObservation(obs map[string]any) error { - p, err := json.TFParser.Marshal(obs) - if err != nil { - return err - } - return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) -} - -// GetID returns ID of underlying Terraform resource of this UserPoolClient -func (tr *UserPoolClient) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" - } - return *tr.Status.AtProvider.ID -} - -// GetParameters of this UserPoolClient -func (tr *UserPoolClient) 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 UserPoolClient -func (tr *UserPoolClient) 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 UserPoolClient -func (tr *UserPoolClient) 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 UserPoolClient -func (tr *UserPoolClient) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { - params, err := tr.GetParameters() - if err != nil { - return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", 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 '%q'", 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 '%q'", tr.GetName()) - } - - return params, nil -} - -// LateInitialize this UserPoolClient using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *UserPoolClient) LateInitialize(attrs []byte) (bool, error) { - params := &UserPoolClientParameters{} - 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 *UserPoolClient) GetTerraformSchemaVersion() int { - return 0 -} diff --git a/apis/cognito/v1alpha1/zz_groupversion_info.go b/apis/cognito/v1alpha1/zz_groupversion_info.go deleted file mode 100755 index fb199a0..0000000 --- a/apis/cognito/v1alpha1/zz_groupversion_info.go +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by upjet. DO NOT EDIT. - -// +kubebuilder:object:generate=true -// +groupName=cognito.aws.kubedb.com -// +versionName=v1alpha1 -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -// Package type metadata. -const ( - CRDGroup = "cognito.aws.kubedb.com" - CRDVersion = "v1alpha1" -) - -var ( - // CRDGroupVersion is the API Group Version used to register the objects - CRDGroupVersion = schema.GroupVersion{Group: CRDGroup, Version: CRDVersion} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: CRDGroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme -) diff --git a/apis/cognito/v1alpha1/zz_userpoolclient_types.go b/apis/cognito/v1alpha1/zz_userpoolclient_types.go deleted file mode 100755 index 373152a..0000000 --- a/apis/cognito/v1alpha1/zz_userpoolclient_types.go +++ /dev/null @@ -1,423 +0,0 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by upjet. DO NOT EDIT. - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - - v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" -) - -type AnalyticsConfigurationInitParameters struct { - - // Application ARN for an Amazon Pinpoint application. Conflicts with external_id and role_arn. - ApplicationArn *string `json:"applicationArn,omitempty" tf:"application_arn,omitempty"` - - // Application ID for an Amazon Pinpoint application. - ApplicationID *string `json:"applicationId,omitempty" tf:"application_id,omitempty"` - - // ID for the Analytics Configuration. Conflicts with application_arn. - ExternalID *string `json:"externalId,omitempty" tf:"external_id,omitempty"` - - // ARN of an IAM role that authorizes Amazon Cognito to publish events to Amazon Pinpoint analytics. Conflicts with application_arn. - RoleArn *string `json:"roleArn,omitempty" tf:"role_arn,omitempty"` - - // If set to true, Amazon Cognito will include user data in the events it publishes to Amazon Pinpoint analytics. - UserDataShared *bool `json:"userDataShared,omitempty" tf:"user_data_shared,omitempty"` -} - -type AnalyticsConfigurationObservation struct { - - // Application ARN for an Amazon Pinpoint application. Conflicts with external_id and role_arn. - ApplicationArn *string `json:"applicationArn,omitempty" tf:"application_arn,omitempty"` - - // Application ID for an Amazon Pinpoint application. - ApplicationID *string `json:"applicationId,omitempty" tf:"application_id,omitempty"` - - // ID for the Analytics Configuration. Conflicts with application_arn. - ExternalID *string `json:"externalId,omitempty" tf:"external_id,omitempty"` - - // ARN of an IAM role that authorizes Amazon Cognito to publish events to Amazon Pinpoint analytics. Conflicts with application_arn. - RoleArn *string `json:"roleArn,omitempty" tf:"role_arn,omitempty"` - - // If set to true, Amazon Cognito will include user data in the events it publishes to Amazon Pinpoint analytics. - UserDataShared *bool `json:"userDataShared,omitempty" tf:"user_data_shared,omitempty"` -} - -type AnalyticsConfigurationParameters struct { - - // Application ARN for an Amazon Pinpoint application. Conflicts with external_id and role_arn. - // +kubebuilder:validation:Optional - ApplicationArn *string `json:"applicationArn,omitempty" tf:"application_arn,omitempty"` - - // Application ID for an Amazon Pinpoint application. - // +kubebuilder:validation:Optional - ApplicationID *string `json:"applicationId,omitempty" tf:"application_id,omitempty"` - - // ID for the Analytics Configuration. Conflicts with application_arn. - // +kubebuilder:validation:Optional - ExternalID *string `json:"externalId,omitempty" tf:"external_id,omitempty"` - - // ARN of an IAM role that authorizes Amazon Cognito to publish events to Amazon Pinpoint analytics. Conflicts with application_arn. - // +kubebuilder:validation:Optional - RoleArn *string `json:"roleArn,omitempty" tf:"role_arn,omitempty"` - - // If set to true, Amazon Cognito will include user data in the events it publishes to Amazon Pinpoint analytics. - // +kubebuilder:validation:Optional - UserDataShared *bool `json:"userDataShared,omitempty" tf:"user_data_shared,omitempty"` -} - -type TokenValidityUnitsInitParameters struct { - - // Time unit in for the value in access_token_validity, defaults to hours. - AccessToken *string `json:"accessToken,omitempty" tf:"access_token,omitempty"` - - // Time unit in for the value in id_token_validity, defaults to hours. - IDToken *string `json:"idToken,omitempty" tf:"id_token,omitempty"` - - // Time unit in for the value in refresh_token_validity, defaults to days. - RefreshToken *string `json:"refreshToken,omitempty" tf:"refresh_token,omitempty"` -} - -type TokenValidityUnitsObservation struct { - - // Time unit in for the value in access_token_validity, defaults to hours. - AccessToken *string `json:"accessToken,omitempty" tf:"access_token,omitempty"` - - // Time unit in for the value in id_token_validity, defaults to hours. - IDToken *string `json:"idToken,omitempty" tf:"id_token,omitempty"` - - // Time unit in for the value in refresh_token_validity, defaults to days. - RefreshToken *string `json:"refreshToken,omitempty" tf:"refresh_token,omitempty"` -} - -type TokenValidityUnitsParameters struct { - - // Time unit in for the value in access_token_validity, defaults to hours. - // +kubebuilder:validation:Optional - AccessToken *string `json:"accessToken,omitempty" tf:"access_token,omitempty"` - - // Time unit in for the value in id_token_validity, defaults to hours. - // +kubebuilder:validation:Optional - IDToken *string `json:"idToken,omitempty" tf:"id_token,omitempty"` - - // Time unit in for the value in refresh_token_validity, defaults to days. - // +kubebuilder:validation:Optional - RefreshToken *string `json:"refreshToken,omitempty" tf:"refresh_token,omitempty"` -} - -type UserPoolClientInitParameters struct { - - // Time limit, between 5 minutes and 1 day, after which the access token is no longer valid and cannot be used. - // By default, the unit is hours. - // The unit can be overridden by a value in token_validity_units.access_token. - AccessTokenValidity *float64 `json:"accessTokenValidity,omitempty" tf:"access_token_validity,omitempty"` - - // List of allowed OAuth flows (code, implicit, client_credentials). - AllowedOauthFlows []*string `json:"allowedOauthFlows,omitempty" tf:"allowed_oauth_flows,omitempty"` - - // Whether the client is allowed to follow the OAuth protocol when interacting with Cognito user pools. - AllowedOauthFlowsUserPoolClient *bool `json:"allowedOauthFlowsUserPoolClient,omitempty" tf:"allowed_oauth_flows_user_pool_client,omitempty"` - - // List of allowed OAuth scopes (phone, email, openid, profile, and aws.cognito.signin.user.admin). - AllowedOauthScopes []*string `json:"allowedOauthScopes,omitempty" tf:"allowed_oauth_scopes,omitempty"` - - // Configuration block for Amazon Pinpoint analytics for collecting metrics for this user pool. Detailed below. - AnalyticsConfiguration []AnalyticsConfigurationInitParameters `json:"analyticsConfiguration,omitempty" tf:"analytics_configuration,omitempty"` - - // Amazon Cognito creates a session token for each API request in an authentication flow. AuthSessionValidity is the duration, in minutes, of that session token. Your user pool native user must respond to each authentication challenge before the session expires. Valid values between 3 and 15. Default value is 3. - AuthSessionValidity *float64 `json:"authSessionValidity,omitempty" tf:"auth_session_validity,omitempty"` - - // List of allowed callback URLs for the identity providers. - CallbackUrls []*string `json:"callbackUrls,omitempty" tf:"callback_urls,omitempty"` - - // Default redirect URI. Must be in the list of callback URLs. - DefaultRedirectURI *string `json:"defaultRedirectUri,omitempty" tf:"default_redirect_uri,omitempty"` - - // Activates the propagation of additional user context data. - EnablePropagateAdditionalUserContextData *bool `json:"enablePropagateAdditionalUserContextData,omitempty" tf:"enable_propagate_additional_user_context_data,omitempty"` - - // Enables or disables token revocation. - EnableTokenRevocation *bool `json:"enableTokenRevocation,omitempty" tf:"enable_token_revocation,omitempty"` - - // List of authentication flows (ADMIN_NO_SRP_AUTH, CUSTOM_AUTH_FLOW_ONLY, USER_PASSWORD_AUTH, ALLOW_ADMIN_USER_PASSWORD_AUTH, ALLOW_CUSTOM_AUTH, ALLOW_USER_PASSWORD_AUTH, ALLOW_USER_SRP_AUTH, ALLOW_REFRESH_TOKEN_AUTH). - ExplicitAuthFlows []*string `json:"explicitAuthFlows,omitempty" tf:"explicit_auth_flows,omitempty"` - - // Should an application secret be generated. - GenerateSecret *bool `json:"generateSecret,omitempty" tf:"generate_secret,omitempty"` - - // Time limit, between 5 minutes and 1 day, after which the ID token is no longer valid and cannot be used. - // By default, the unit is hours. - // The unit can be overridden by a value in token_validity_units.id_token. - IDTokenValidity *float64 `json:"idTokenValidity,omitempty" tf:"id_token_validity,omitempty"` - - // List of allowed logout URLs for the identity providers. - LogoutUrls []*string `json:"logoutUrls,omitempty" tf:"logout_urls,omitempty"` - - // Choose which errors and responses are returned by Cognito APIs during authentication, account confirmation, and password recovery when the user does not exist in the user pool. When set to ENABLED and the user does not exist, authentication returns an error indicating either the username or password was incorrect, and account confirmation and password recovery return a response indicating a code was sent to a simulated destination. When set to LEGACY, those APIs will return a UserNotFoundException exception if the user does not exist in the user pool. - PreventUserExistenceErrors *string `json:"preventUserExistenceErrors,omitempty" tf:"prevent_user_existence_errors,omitempty"` - - // List of user pool attributes the application client can read from. - ReadAttributes []*string `json:"readAttributes,omitempty" tf:"read_attributes,omitempty"` - - // Time limit, between 60 minutes and 10 years, after which the refresh token is no longer valid and cannot be used. - // By default, the unit is days. - // The unit can be overridden by a value in token_validity_units.refresh_token. - RefreshTokenValidity *float64 `json:"refreshTokenValidity,omitempty" tf:"refresh_token_validity,omitempty"` - - // List of provider names for the identity providers that are supported on this client. Uses the provider_name attribute of aws_cognito_identity_provider resource(s), or the equivalent string(s). - SupportedIdentityProviders []*string `json:"supportedIdentityProviders,omitempty" tf:"supported_identity_providers,omitempty"` - - // Configuration block for units in which the validity times are represented in. Detailed below. - TokenValidityUnits []TokenValidityUnitsInitParameters `json:"tokenValidityUnits,omitempty" tf:"token_validity_units,omitempty"` - - // User pool the client belongs to. - UserPoolID *string `json:"userPoolId,omitempty" tf:"user_pool_id,omitempty"` - - // List of user pool attributes the application client can write to. - WriteAttributes []*string `json:"writeAttributes,omitempty" tf:"write_attributes,omitempty"` -} - -type UserPoolClientObservation struct { - - // Time limit, between 5 minutes and 1 day, after which the access token is no longer valid and cannot be used. - // By default, the unit is hours. - // The unit can be overridden by a value in token_validity_units.access_token. - AccessTokenValidity *float64 `json:"accessTokenValidity,omitempty" tf:"access_token_validity,omitempty"` - - // List of allowed OAuth flows (code, implicit, client_credentials). - AllowedOauthFlows []*string `json:"allowedOauthFlows,omitempty" tf:"allowed_oauth_flows,omitempty"` - - // Whether the client is allowed to follow the OAuth protocol when interacting with Cognito user pools. - AllowedOauthFlowsUserPoolClient *bool `json:"allowedOauthFlowsUserPoolClient,omitempty" tf:"allowed_oauth_flows_user_pool_client,omitempty"` - - // List of allowed OAuth scopes (phone, email, openid, profile, and aws.cognito.signin.user.admin). - AllowedOauthScopes []*string `json:"allowedOauthScopes,omitempty" tf:"allowed_oauth_scopes,omitempty"` - - // Configuration block for Amazon Pinpoint analytics for collecting metrics for this user pool. Detailed below. - AnalyticsConfiguration []AnalyticsConfigurationObservation `json:"analyticsConfiguration,omitempty" tf:"analytics_configuration,omitempty"` - - // Amazon Cognito creates a session token for each API request in an authentication flow. AuthSessionValidity is the duration, in minutes, of that session token. Your user pool native user must respond to each authentication challenge before the session expires. Valid values between 3 and 15. Default value is 3. - AuthSessionValidity *float64 `json:"authSessionValidity,omitempty" tf:"auth_session_validity,omitempty"` - - // List of allowed callback URLs for the identity providers. - CallbackUrls []*string `json:"callbackUrls,omitempty" tf:"callback_urls,omitempty"` - - // Default redirect URI. Must be in the list of callback URLs. - DefaultRedirectURI *string `json:"defaultRedirectUri,omitempty" tf:"default_redirect_uri,omitempty"` - - // Activates the propagation of additional user context data. - EnablePropagateAdditionalUserContextData *bool `json:"enablePropagateAdditionalUserContextData,omitempty" tf:"enable_propagate_additional_user_context_data,omitempty"` - - // Enables or disables token revocation. - EnableTokenRevocation *bool `json:"enableTokenRevocation,omitempty" tf:"enable_token_revocation,omitempty"` - - // List of authentication flows (ADMIN_NO_SRP_AUTH, CUSTOM_AUTH_FLOW_ONLY, USER_PASSWORD_AUTH, ALLOW_ADMIN_USER_PASSWORD_AUTH, ALLOW_CUSTOM_AUTH, ALLOW_USER_PASSWORD_AUTH, ALLOW_USER_SRP_AUTH, ALLOW_REFRESH_TOKEN_AUTH). - ExplicitAuthFlows []*string `json:"explicitAuthFlows,omitempty" tf:"explicit_auth_flows,omitempty"` - - // Should an application secret be generated. - GenerateSecret *bool `json:"generateSecret,omitempty" tf:"generate_secret,omitempty"` - - // ID of the user pool client. - ID *string `json:"id,omitempty" tf:"id,omitempty"` - - // Time limit, between 5 minutes and 1 day, after which the ID token is no longer valid and cannot be used. - // By default, the unit is hours. - // The unit can be overridden by a value in token_validity_units.id_token. - IDTokenValidity *float64 `json:"idTokenValidity,omitempty" tf:"id_token_validity,omitempty"` - - // List of allowed logout URLs for the identity providers. - LogoutUrls []*string `json:"logoutUrls,omitempty" tf:"logout_urls,omitempty"` - - // Choose which errors and responses are returned by Cognito APIs during authentication, account confirmation, and password recovery when the user does not exist in the user pool. When set to ENABLED and the user does not exist, authentication returns an error indicating either the username or password was incorrect, and account confirmation and password recovery return a response indicating a code was sent to a simulated destination. When set to LEGACY, those APIs will return a UserNotFoundException exception if the user does not exist in the user pool. - PreventUserExistenceErrors *string `json:"preventUserExistenceErrors,omitempty" tf:"prevent_user_existence_errors,omitempty"` - - // List of user pool attributes the application client can read from. - ReadAttributes []*string `json:"readAttributes,omitempty" tf:"read_attributes,omitempty"` - - // Time limit, between 60 minutes and 10 years, after which the refresh token is no longer valid and cannot be used. - // By default, the unit is days. - // The unit can be overridden by a value in token_validity_units.refresh_token. - RefreshTokenValidity *float64 `json:"refreshTokenValidity,omitempty" tf:"refresh_token_validity,omitempty"` - - // List of provider names for the identity providers that are supported on this client. Uses the provider_name attribute of aws_cognito_identity_provider resource(s), or the equivalent string(s). - SupportedIdentityProviders []*string `json:"supportedIdentityProviders,omitempty" tf:"supported_identity_providers,omitempty"` - - // Configuration block for units in which the validity times are represented in. Detailed below. - TokenValidityUnits []TokenValidityUnitsObservation `json:"tokenValidityUnits,omitempty" tf:"token_validity_units,omitempty"` - - // User pool the client belongs to. - UserPoolID *string `json:"userPoolId,omitempty" tf:"user_pool_id,omitempty"` - - // List of user pool attributes the application client can write to. - WriteAttributes []*string `json:"writeAttributes,omitempty" tf:"write_attributes,omitempty"` -} - -type UserPoolClientParameters struct { - - // Time limit, between 5 minutes and 1 day, after which the access token is no longer valid and cannot be used. - // By default, the unit is hours. - // The unit can be overridden by a value in token_validity_units.access_token. - // +kubebuilder:validation:Optional - AccessTokenValidity *float64 `json:"accessTokenValidity,omitempty" tf:"access_token_validity,omitempty"` - - // List of allowed OAuth flows (code, implicit, client_credentials). - // +kubebuilder:validation:Optional - AllowedOauthFlows []*string `json:"allowedOauthFlows,omitempty" tf:"allowed_oauth_flows,omitempty"` - - // Whether the client is allowed to follow the OAuth protocol when interacting with Cognito user pools. - // +kubebuilder:validation:Optional - AllowedOauthFlowsUserPoolClient *bool `json:"allowedOauthFlowsUserPoolClient,omitempty" tf:"allowed_oauth_flows_user_pool_client,omitempty"` - - // List of allowed OAuth scopes (phone, email, openid, profile, and aws.cognito.signin.user.admin). - // +kubebuilder:validation:Optional - AllowedOauthScopes []*string `json:"allowedOauthScopes,omitempty" tf:"allowed_oauth_scopes,omitempty"` - - // Configuration block for Amazon Pinpoint analytics for collecting metrics for this user pool. Detailed below. - // +kubebuilder:validation:Optional - AnalyticsConfiguration []AnalyticsConfigurationParameters `json:"analyticsConfiguration,omitempty" tf:"analytics_configuration,omitempty"` - - // Amazon Cognito creates a session token for each API request in an authentication flow. AuthSessionValidity is the duration, in minutes, of that session token. Your user pool native user must respond to each authentication challenge before the session expires. Valid values between 3 and 15. Default value is 3. - // +kubebuilder:validation:Optional - AuthSessionValidity *float64 `json:"authSessionValidity,omitempty" tf:"auth_session_validity,omitempty"` - - // List of allowed callback URLs for the identity providers. - // +kubebuilder:validation:Optional - CallbackUrls []*string `json:"callbackUrls,omitempty" tf:"callback_urls,omitempty"` - - // Default redirect URI. Must be in the list of callback URLs. - // +kubebuilder:validation:Optional - DefaultRedirectURI *string `json:"defaultRedirectUri,omitempty" tf:"default_redirect_uri,omitempty"` - - // Activates the propagation of additional user context data. - // +kubebuilder:validation:Optional - EnablePropagateAdditionalUserContextData *bool `json:"enablePropagateAdditionalUserContextData,omitempty" tf:"enable_propagate_additional_user_context_data,omitempty"` - - // Enables or disables token revocation. - // +kubebuilder:validation:Optional - EnableTokenRevocation *bool `json:"enableTokenRevocation,omitempty" tf:"enable_token_revocation,omitempty"` - - // List of authentication flows (ADMIN_NO_SRP_AUTH, CUSTOM_AUTH_FLOW_ONLY, USER_PASSWORD_AUTH, ALLOW_ADMIN_USER_PASSWORD_AUTH, ALLOW_CUSTOM_AUTH, ALLOW_USER_PASSWORD_AUTH, ALLOW_USER_SRP_AUTH, ALLOW_REFRESH_TOKEN_AUTH). - // +kubebuilder:validation:Optional - ExplicitAuthFlows []*string `json:"explicitAuthFlows,omitempty" tf:"explicit_auth_flows,omitempty"` - - // Should an application secret be generated. - // +kubebuilder:validation:Optional - GenerateSecret *bool `json:"generateSecret,omitempty" tf:"generate_secret,omitempty"` - - // Time limit, between 5 minutes and 1 day, after which the ID token is no longer valid and cannot be used. - // By default, the unit is hours. - // The unit can be overridden by a value in token_validity_units.id_token. - // +kubebuilder:validation:Optional - IDTokenValidity *float64 `json:"idTokenValidity,omitempty" tf:"id_token_validity,omitempty"` - - // List of allowed logout URLs for the identity providers. - // +kubebuilder:validation:Optional - LogoutUrls []*string `json:"logoutUrls,omitempty" tf:"logout_urls,omitempty"` - - // Choose which errors and responses are returned by Cognito APIs during authentication, account confirmation, and password recovery when the user does not exist in the user pool. When set to ENABLED and the user does not exist, authentication returns an error indicating either the username or password was incorrect, and account confirmation and password recovery return a response indicating a code was sent to a simulated destination. When set to LEGACY, those APIs will return a UserNotFoundException exception if the user does not exist in the user pool. - // +kubebuilder:validation:Optional - PreventUserExistenceErrors *string `json:"preventUserExistenceErrors,omitempty" tf:"prevent_user_existence_errors,omitempty"` - - // List of user pool attributes the application client can read from. - // +kubebuilder:validation:Optional - ReadAttributes []*string `json:"readAttributes,omitempty" tf:"read_attributes,omitempty"` - - // Time limit, between 60 minutes and 10 years, after which the refresh token is no longer valid and cannot be used. - // By default, the unit is days. - // The unit can be overridden by a value in token_validity_units.refresh_token. - // +kubebuilder:validation:Optional - RefreshTokenValidity *float64 `json:"refreshTokenValidity,omitempty" tf:"refresh_token_validity,omitempty"` - - // Region is the region you'd like your resource to be created in. - // +upjet:crd:field:TFTag=- - // +kubebuilder:validation:Optional - Region *string `json:"region,omitempty" tf:"-"` - - // List of provider names for the identity providers that are supported on this client. Uses the provider_name attribute of aws_cognito_identity_provider resource(s), or the equivalent string(s). - // +kubebuilder:validation:Optional - SupportedIdentityProviders []*string `json:"supportedIdentityProviders,omitempty" tf:"supported_identity_providers,omitempty"` - - // Configuration block for units in which the validity times are represented in. Detailed below. - // +kubebuilder:validation:Optional - TokenValidityUnits []TokenValidityUnitsParameters `json:"tokenValidityUnits,omitempty" tf:"token_validity_units,omitempty"` - - // User pool the client belongs to. - // +kubebuilder:validation:Optional - UserPoolID *string `json:"userPoolId,omitempty" tf:"user_pool_id,omitempty"` - - // List of user pool attributes the application client can write to. - // +kubebuilder:validation:Optional - WriteAttributes []*string `json:"writeAttributes,omitempty" tf:"write_attributes,omitempty"` -} - -// UserPoolClientSpec defines the desired state of UserPoolClient -type UserPoolClientSpec struct { - v1.ResourceSpec `json:",inline"` - ForProvider UserPoolClientParameters `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 UserPoolClientInitParameters `json:"initProvider,omitempty"` -} - -// UserPoolClientStatus defines the observed state of UserPoolClient. -type UserPoolClientStatus struct { - v1.ResourceStatus `json:",inline"` - AtProvider UserPoolClientObservation `json:"atProvider,omitempty"` -} - -// +kubebuilder:object:root=true - -// UserPoolClient is the Schema for the UserPoolClients API. Provides a Cognito User Pool Client resource. -// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" -// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" -// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" -// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" -// +kubebuilder:subresource:status -// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,aws} -type UserPoolClient 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.region)",message="spec.forProvider.region is a required parameter" - // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.userPoolId) || (has(self.initProvider) && has(self.initProvider.userPoolId))",message="spec.forProvider.userPoolId is a required parameter" - Spec UserPoolClientSpec `json:"spec"` - Status UserPoolClientStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// UserPoolClientList contains a list of UserPoolClients -type UserPoolClientList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []UserPoolClient `json:"items"` -} - -// Repository type metadata. -var ( - UserPoolClient_Kind = "UserPoolClient" - UserPoolClient_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: UserPoolClient_Kind}.String() - UserPoolClient_KindAPIVersion = UserPoolClient_Kind + "." + CRDGroupVersion.String() - UserPoolClient_GroupVersionKind = CRDGroupVersion.WithKind(UserPoolClient_Kind) -) - -func init() { - SchemeBuilder.Register(&UserPoolClient{}, &UserPoolClientList{}) -} diff --git a/apis/simpledb/v1alpha1/zz_domain_types.go b/apis/simpledb/v1alpha1/zz_domain_types.go deleted file mode 100755 index 6b55678..0000000 --- a/apis/simpledb/v1alpha1/zz_domain_types.go +++ /dev/null @@ -1,96 +0,0 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by upjet. DO NOT EDIT. - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - - v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" -) - -type DomainInitParameters struct { -} - -type DomainObservation struct { - - // The name of the SimpleDB domain - ID *string `json:"id,omitempty" tf:"id,omitempty"` -} - -type DomainParameters struct { - - // Region is the region you'd like your resource to be created in. - // +upjet:crd:field:TFTag=- - // +kubebuilder:validation:Optional - Region *string `json:"region,omitempty" tf:"-"` -} - -// DomainSpec defines the desired state of Domain -type DomainSpec struct { - v1.ResourceSpec `json:",inline"` - ForProvider DomainParameters `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 DomainInitParameters `json:"initProvider,omitempty"` -} - -// DomainStatus defines the observed state of Domain. -type DomainStatus struct { - v1.ResourceStatus `json:",inline"` - AtProvider DomainObservation `json:"atProvider,omitempty"` -} - -// +kubebuilder:object:root=true - -// Domain is the Schema for the Domains API. Provides a SimpleDB domain resource. -// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" -// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" -// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" -// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" -// +kubebuilder:subresource:status -// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,aws} -type Domain 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.region)",message="spec.forProvider.region is a required parameter" - Spec DomainSpec `json:"spec"` - Status DomainStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// DomainList contains a list of Domains -type DomainList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Domain `json:"items"` -} - -// Repository type metadata. -var ( - Domain_Kind = "Domain" - Domain_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: Domain_Kind}.String() - Domain_KindAPIVersion = Domain_Kind + "." + CRDGroupVersion.String() - Domain_GroupVersionKind = CRDGroupVersion.WithKind(Domain_Kind) -) - -func init() { - SchemeBuilder.Register(&Domain{}, &DomainList{}) -} diff --git a/apis/simpledb/v1alpha1/zz_generated.deepcopy.go b/apis/simpledb/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index 3224f81..0000000 --- a/apis/simpledb/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,162 +0,0 @@ -//go:build !ignore_autogenerated - -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Domain) DeepCopyInto(out *Domain) { - *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 Domain. -func (in *Domain) DeepCopy() *Domain { - if in == nil { - return nil - } - out := new(Domain) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Domain) 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 *DomainInitParameters) DeepCopyInto(out *DomainInitParameters) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainInitParameters. -func (in *DomainInitParameters) DeepCopy() *DomainInitParameters { - if in == nil { - return nil - } - out := new(DomainInitParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DomainList) DeepCopyInto(out *DomainList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Domain, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainList. -func (in *DomainList) DeepCopy() *DomainList { - if in == nil { - return nil - } - out := new(DomainList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DomainList) 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 *DomainObservation) DeepCopyInto(out *DomainObservation) { - *out = *in - if in.ID != nil { - in, out := &in.ID, &out.ID - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainObservation. -func (in *DomainObservation) DeepCopy() *DomainObservation { - if in == nil { - return nil - } - out := new(DomainObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DomainParameters) DeepCopyInto(out *DomainParameters) { - *out = *in - if in.Region != nil { - in, out := &in.Region, &out.Region - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainParameters. -func (in *DomainParameters) DeepCopy() *DomainParameters { - if in == nil { - return nil - } - out := new(DomainParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DomainSpec) DeepCopyInto(out *DomainSpec) { - *out = *in - in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) - in.ForProvider.DeepCopyInto(&out.ForProvider) - out.InitProvider = in.InitProvider -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainSpec. -func (in *DomainSpec) DeepCopy() *DomainSpec { - if in == nil { - return nil - } - out := new(DomainSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DomainStatus) DeepCopyInto(out *DomainStatus) { - *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) - in.AtProvider.DeepCopyInto(&out.AtProvider) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainStatus. -func (in *DomainStatus) DeepCopy() *DomainStatus { - if in == nil { - return nil - } - out := new(DomainStatus) - in.DeepCopyInto(out) - return out -} diff --git a/apis/simpledb/v1alpha1/zz_generated.managed.go b/apis/simpledb/v1alpha1/zz_generated.managed.go deleted file mode 100644 index b4998ac..0000000 --- a/apis/simpledb/v1alpha1/zz_generated.managed.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright 2022 Upbound Inc. -*/ -// Code generated by angryjet. DO NOT EDIT. - -package v1alpha1 - -import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - -// GetCondition of this Domain. -func (mg *Domain) GetCondition(ct xpv1.ConditionType) xpv1.Condition { - return mg.Status.GetCondition(ct) -} - -// GetDeletionPolicy of this Domain. -func (mg *Domain) GetDeletionPolicy() xpv1.DeletionPolicy { - return mg.Spec.DeletionPolicy -} - -// GetManagementPolicies of this Domain. -func (mg *Domain) GetManagementPolicies() xpv1.ManagementPolicies { - return mg.Spec.ManagementPolicies -} - -// GetProviderConfigReference of this Domain. -func (mg *Domain) GetProviderConfigReference() *xpv1.Reference { - return mg.Spec.ProviderConfigReference -} - -// GetPublishConnectionDetailsTo of this Domain. -func (mg *Domain) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { - return mg.Spec.PublishConnectionDetailsTo -} - -// GetWriteConnectionSecretToReference of this Domain. -func (mg *Domain) GetWriteConnectionSecretToReference() *xpv1.SecretReference { - return mg.Spec.WriteConnectionSecretToReference -} - -// SetConditions of this Domain. -func (mg *Domain) SetConditions(c ...xpv1.Condition) { - mg.Status.SetConditions(c...) -} - -// SetDeletionPolicy of this Domain. -func (mg *Domain) SetDeletionPolicy(r xpv1.DeletionPolicy) { - mg.Spec.DeletionPolicy = r -} - -// SetManagementPolicies of this Domain. -func (mg *Domain) SetManagementPolicies(r xpv1.ManagementPolicies) { - mg.Spec.ManagementPolicies = r -} - -// SetProviderConfigReference of this Domain. -func (mg *Domain) SetProviderConfigReference(r *xpv1.Reference) { - mg.Spec.ProviderConfigReference = r -} - -// SetPublishConnectionDetailsTo of this Domain. -func (mg *Domain) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { - mg.Spec.PublishConnectionDetailsTo = r -} - -// SetWriteConnectionSecretToReference of this Domain. -func (mg *Domain) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { - mg.Spec.WriteConnectionSecretToReference = r -} diff --git a/apis/simpledb/v1alpha1/zz_generated.managedlist.go b/apis/simpledb/v1alpha1/zz_generated.managedlist.go deleted file mode 100644 index c9e6569..0000000 --- a/apis/simpledb/v1alpha1/zz_generated.managedlist.go +++ /dev/null @@ -1,17 +0,0 @@ -/* -Copyright 2022 Upbound Inc. -*/ -// Code generated by angryjet. DO NOT EDIT. - -package v1alpha1 - -import resource "github.com/crossplane/crossplane-runtime/pkg/resource" - -// GetItems of this DomainList. -func (l *DomainList) GetItems() []resource.Managed { - items := make([]resource.Managed, len(l.Items)) - for i := range l.Items { - items[i] = &l.Items[i] - } - return items -} diff --git a/apis/simpledb/v1alpha1/zz_generated_terraformed.go b/apis/simpledb/v1alpha1/zz_generated_terraformed.go deleted file mode 100755 index 71c9a69..0000000 --- a/apis/simpledb/v1alpha1/zz_generated_terraformed.go +++ /dev/null @@ -1,133 +0,0 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by upjet. DO NOT EDIT. - -package v1alpha1 - -import ( - "dario.cat/mergo" - "github.com/pkg/errors" - - "github.com/crossplane/upjet/pkg/resource" - "github.com/crossplane/upjet/pkg/resource/json" -) - -// GetTerraformResourceType returns Terraform resource type for this Domain -func (mg *Domain) GetTerraformResourceType() string { - return "aws_simpledb_domain" -} - -// GetConnectionDetailsMapping for this Domain -func (tr *Domain) GetConnectionDetailsMapping() map[string]string { - return nil -} - -// GetObservation of this Domain -func (tr *Domain) 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 Domain -func (tr *Domain) SetObservation(obs map[string]any) error { - p, err := json.TFParser.Marshal(obs) - if err != nil { - return err - } - return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) -} - -// GetID returns ID of underlying Terraform resource of this Domain -func (tr *Domain) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" - } - return *tr.Status.AtProvider.ID -} - -// GetParameters of this Domain -func (tr *Domain) 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 Domain -func (tr *Domain) 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 Domain -func (tr *Domain) 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 Domain -func (tr *Domain) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { - params, err := tr.GetParameters() - if err != nil { - return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", 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 '%q'", 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 '%q'", tr.GetName()) - } - - return params, nil -} - -// LateInitialize this Domain using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *Domain) LateInitialize(attrs []byte) (bool, error) { - params := &DomainParameters{} - 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 *Domain) GetTerraformSchemaVersion() int { - return 0 -} diff --git a/apis/simpledb/v1alpha1/zz_groupversion_info.go b/apis/simpledb/v1alpha1/zz_groupversion_info.go deleted file mode 100755 index 498a9c1..0000000 --- a/apis/simpledb/v1alpha1/zz_groupversion_info.go +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by upjet. DO NOT EDIT. - -// +kubebuilder:object:generate=true -// +groupName=simpledb.aws.kubedb.com -// +versionName=v1alpha1 -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -// Package type metadata. -const ( - CRDGroup = "simpledb.aws.kubedb.com" - CRDVersion = "v1alpha1" -) - -var ( - // CRDGroupVersion is the API Group Version used to register the objects - CRDGroupVersion = schema.GroupVersion{Group: CRDGroup, Version: CRDVersion} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: CRDGroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme -) diff --git a/apis/v1beta1/types.go b/apis/v1beta1/types.go index 712bafc..b15ee22 100644 --- a/apis/v1beta1/types.go +++ b/apis/v1beta1/types.go @@ -14,6 +14,148 @@ import ( type ProviderConfigSpec struct { // Credentials required to authenticate to this provider. Credentials ProviderCredentials `json:"credentials"` + + // AssumeRoleChain defines the options for assuming an IAM role + AssumeRoleChain []AssumeRoleOptions `json:"assumeRoleChain,omitempty"` + + Endpoint *EndpointConfig `json:"endpoint,omitempty"` +} + +// EndpointConfig is used to configure the AWS client for a custom endpoint. +type EndpointConfig struct { + // URL lets you configure the endpoint URL to be used in SDK calls. + URL URLConfig `json:"url"` + // Specifies the list of services you want endpoint to be used for + Services []string `json:"services,omitempty"` + + // Specifies if the endpoint's hostname can be modified by the SDK's API + // client. + // + // If the hostname is mutable the SDK API clients may modify any part of + // the hostname based on the requirements of the API, (e.g. adding, or + // removing content in the hostname). Such as, Amazon S3 API client + // prefixing "bucketname" to the hostname, or changing the + // hostname service name component from "s3." to "s3-accesspoint.dualstack." + // for the dualstack endpoint of an S3 Accesspoint resource. + // + // Care should be taken when providing a custom endpoint for an API. If the + // endpoint hostname is mutable, and the client cannot modify the endpoint + // correctly, the operation call will most likely fail, or have undefined + // behavior. + // + // If hostname is immutable, the SDK API clients will not modify the + // hostname of the URL. This may cause the API client not to function + // correctly if the API requires the operation specific hostname values + // to be used by the client. + // + // This flag does not modify the API client's behavior if this endpoint + // will be used instead of Endpoint Discovery, or if the endpoint will be + // used to perform Endpoint Discovery. That behavior is configured via the + // API Client's Options. + // Note that this is effective only for resources that use AWS SDK v2. + // +optional + HostnameImmutable *bool `json:"hostnameImmutable,omitempty"` + + // The AWS partition the endpoint belongs to. + // +optional + PartitionID *string `json:"partitionId,omitempty"` + + // The service name that should be used for signing the requests to the + // endpoint. + // +optional + SigningName *string `json:"signingName,omitempty"` + + // The region that should be used for signing the request to the endpoint. + // For IAM, which doesn't have any region, us-east-1 is used to sign the + // requests, which is the only signing region of IAM. + // +optional + SigningRegion *string `json:"signingRegion,omitempty"` + + // The signing method that should be used for signing the requests to the + // endpoint. + // +optional + SigningMethod *string `json:"signingMethod,omitempty"` + + // The source of the Endpoint. By default, this will be ServiceMetadata. + // When providing a custom endpoint, you should set the source as Custom. + // If source is not provided when providing a custom endpoint, the SDK may not + // perform required host mutations correctly. Source should be used along with + // HostnameImmutable property as per the usage requirement. + // Note that this is effective only for resources that use AWS SDK v2. + // +optional + // +kubebuilder:validation:Enum=ServiceMetadata;Custom + Source *string `json:"source,omitempty"` +} + +// URLConfig lets users configure the URL of the AWS SDK calls. +type URLConfig struct { + // You can provide a static URL that will be used regardless of the service + // and region by choosing Static type. Alternatively, you can provide + // configuration for dynamically resolving the URL with the config you provide + // once you set the type as Dynamic. + // +kubebuilder:validation:Enum=Static;Dynamic + Type string `json:"type"` + + // Static is the full URL you'd like the AWS SDK to use. + // Recommended for using tools like localstack where a single host is exposed + // for all services and regions. + // +optional + Static *string `json:"static,omitempty"` + + // Dynamic lets you configure the behavior of endpoint URL resolver. + // +optional + Dynamic *DynamicURLConfig `json:"dynamic,omitempty"` +} + +// DynamicURLConfig lets users configure endpoint resolving functionality. +type DynamicURLConfig struct { + // Protocol is the HTTP protocol that will be used in the URL. Currently, + // only http and https are supported. + // +kubebuilder:validation:Enum=http;https + Protocol string `json:"protocol"` + + // Host is the address of the main host that the resolver will use to + // prepend protocol, service and region configurations. + // For example, the final URL for EC2 in us-east-1 looks like https://ec2.us-east-1.amazonaws.com + // You would need to use "amazonaws.com" as Host and "https" as protocol + // to have the resolver construct it. + Host string `json:"host"` +} + +// AssumeRoleOptions define the options for assuming an IAM Role +// Fields are similar to the STS AssumeRoleOptions in the AWS SDK +type AssumeRoleOptions struct { + // AssumeRoleARN to assume with provider credentials + RoleARN *string `json:"roleARN,omitempty"` + + // ExternalID is the external ID used when assuming role. + // +optional + ExternalID *string `json:"externalID,omitempty"` + + // Tags is list of session tags that you want to pass. Each session tag consists of a key + // name and an associated value. For more information about session tags, see + // Tagging STS Sessions + // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html). + // +optional + Tags []Tag `json:"tags,omitempty"` + + // TransitiveTagKeys is a list of keys for session tags that you want to set as transitive. If you set a + // tag key as transitive, the corresponding key and value passes to subsequent + // sessions in a role chain. For more information, see Chaining Roles with Session Tags + // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining). + // +optional + TransitiveTagKeys []string `json:"transitiveTagKeys,omitempty"` +} + +// Tag is session tag that can be used to assume an IAM Role +type Tag struct { + // Name of the tag. + // Key is a required field + Key *string `json:"key"` + + // Value of the tag. + // Value is a required field + Value *string `json:"value"` } // ProviderCredentials required to authenticate. @@ -32,7 +174,7 @@ type ProviderConfigStatus struct { // +kubebuilder:object:root=true -// A ProviderConfig configures a AWS provider. +// A ProviderConfig configures a Aws provider. // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" // +kubebuilder:printcolumn:name="SECRET-NAME",type="string",JSONPath=".spec.credentials.secretRef.name",priority=1 diff --git a/apis/vpc/v1alpha1/zz_generated.deepcopy.go b/apis/vpc/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index 14064f3..0000000 --- a/apis/vpc/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,740 +0,0 @@ -//go:build !ignore_autogenerated - -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "github.com/crossplane/crossplane-runtime/apis/common/v1" - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SecurityGroupEgressRule) DeepCopyInto(out *SecurityGroupEgressRule) { - *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 SecurityGroupEgressRule. -func (in *SecurityGroupEgressRule) DeepCopy() *SecurityGroupEgressRule { - if in == nil { - return nil - } - out := new(SecurityGroupEgressRule) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *SecurityGroupEgressRule) 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 *SecurityGroupEgressRuleInitParameters) DeepCopyInto(out *SecurityGroupEgressRuleInitParameters) { - *out = *in - if in.CidrIPv4 != nil { - in, out := &in.CidrIPv4, &out.CidrIPv4 - *out = new(string) - **out = **in - } - if in.CidrIPv6 != nil { - in, out := &in.CidrIPv6, &out.CidrIPv6 - *out = new(string) - **out = **in - } - if in.Description != nil { - in, out := &in.Description, &out.Description - *out = new(string) - **out = **in - } - if in.FromPort != nil { - in, out := &in.FromPort, &out.FromPort - *out = new(float64) - **out = **in - } - if in.IPProtocol != nil { - in, out := &in.IPProtocol, &out.IPProtocol - *out = new(string) - **out = **in - } - if in.PrefixListID != nil { - in, out := &in.PrefixListID, &out.PrefixListID - *out = new(string) - **out = **in - } - if in.ReferencedSecurityGroupID != nil { - in, out := &in.ReferencedSecurityGroupID, &out.ReferencedSecurityGroupID - *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.ToPort != nil { - in, out := &in.ToPort, &out.ToPort - *out = new(float64) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroupEgressRuleInitParameters. -func (in *SecurityGroupEgressRuleInitParameters) DeepCopy() *SecurityGroupEgressRuleInitParameters { - if in == nil { - return nil - } - out := new(SecurityGroupEgressRuleInitParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SecurityGroupEgressRuleList) DeepCopyInto(out *SecurityGroupEgressRuleList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]SecurityGroupEgressRule, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroupEgressRuleList. -func (in *SecurityGroupEgressRuleList) DeepCopy() *SecurityGroupEgressRuleList { - if in == nil { - return nil - } - out := new(SecurityGroupEgressRuleList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *SecurityGroupEgressRuleList) 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 *SecurityGroupEgressRuleObservation) DeepCopyInto(out *SecurityGroupEgressRuleObservation) { - *out = *in - if in.Arn != nil { - in, out := &in.Arn, &out.Arn - *out = new(string) - **out = **in - } - if in.CidrIPv4 != nil { - in, out := &in.CidrIPv4, &out.CidrIPv4 - *out = new(string) - **out = **in - } - if in.CidrIPv6 != nil { - in, out := &in.CidrIPv6, &out.CidrIPv6 - *out = new(string) - **out = **in - } - if in.Description != nil { - in, out := &in.Description, &out.Description - *out = new(string) - **out = **in - } - if in.FromPort != nil { - in, out := &in.FromPort, &out.FromPort - *out = new(float64) - **out = **in - } - if in.ID != nil { - in, out := &in.ID, &out.ID - *out = new(string) - **out = **in - } - if in.IPProtocol != nil { - in, out := &in.IPProtocol, &out.IPProtocol - *out = new(string) - **out = **in - } - if in.PrefixListID != nil { - in, out := &in.PrefixListID, &out.PrefixListID - *out = new(string) - **out = **in - } - if in.ReferencedSecurityGroupID != nil { - in, out := &in.ReferencedSecurityGroupID, &out.ReferencedSecurityGroupID - *out = new(string) - **out = **in - } - if in.SecurityGroupID != nil { - in, out := &in.SecurityGroupID, &out.SecurityGroupID - *out = new(string) - **out = **in - } - if in.SecurityGroupRuleID != nil { - in, out := &in.SecurityGroupRuleID, &out.SecurityGroupRuleID - *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 - } - } - if in.ToPort != nil { - in, out := &in.ToPort, &out.ToPort - *out = new(float64) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroupEgressRuleObservation. -func (in *SecurityGroupEgressRuleObservation) DeepCopy() *SecurityGroupEgressRuleObservation { - if in == nil { - return nil - } - out := new(SecurityGroupEgressRuleObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SecurityGroupEgressRuleParameters) DeepCopyInto(out *SecurityGroupEgressRuleParameters) { - *out = *in - if in.CidrIPv4 != nil { - in, out := &in.CidrIPv4, &out.CidrIPv4 - *out = new(string) - **out = **in - } - if in.CidrIPv6 != nil { - in, out := &in.CidrIPv6, &out.CidrIPv6 - *out = new(string) - **out = **in - } - if in.Description != nil { - in, out := &in.Description, &out.Description - *out = new(string) - **out = **in - } - if in.FromPort != nil { - in, out := &in.FromPort, &out.FromPort - *out = new(float64) - **out = **in - } - if in.IPProtocol != nil { - in, out := &in.IPProtocol, &out.IPProtocol - *out = new(string) - **out = **in - } - if in.PrefixListID != nil { - in, out := &in.PrefixListID, &out.PrefixListID - *out = new(string) - **out = **in - } - if in.ReferencedSecurityGroupID != nil { - in, out := &in.ReferencedSecurityGroupID, &out.ReferencedSecurityGroupID - *out = new(string) - **out = **in - } - if in.Region != nil { - in, out := &in.Region, &out.Region - *out = new(string) - **out = **in - } - if in.SecurityGroupID != nil { - in, out := &in.SecurityGroupID, &out.SecurityGroupID - *out = new(string) - **out = **in - } - if in.SecurityGroupIDRef != nil { - in, out := &in.SecurityGroupIDRef, &out.SecurityGroupIDRef - *out = new(v1.Reference) - (*in).DeepCopyInto(*out) - } - if in.SecurityGroupIDSelector != nil { - in, out := &in.SecurityGroupIDSelector, &out.SecurityGroupIDSelector - *out = new(v1.Selector) - (*in).DeepCopyInto(*out) - } - 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.ToPort != nil { - in, out := &in.ToPort, &out.ToPort - *out = new(float64) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroupEgressRuleParameters. -func (in *SecurityGroupEgressRuleParameters) DeepCopy() *SecurityGroupEgressRuleParameters { - if in == nil { - return nil - } - out := new(SecurityGroupEgressRuleParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SecurityGroupEgressRuleSpec) DeepCopyInto(out *SecurityGroupEgressRuleSpec) { - *out = *in - in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) - in.ForProvider.DeepCopyInto(&out.ForProvider) - in.InitProvider.DeepCopyInto(&out.InitProvider) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroupEgressRuleSpec. -func (in *SecurityGroupEgressRuleSpec) DeepCopy() *SecurityGroupEgressRuleSpec { - if in == nil { - return nil - } - out := new(SecurityGroupEgressRuleSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SecurityGroupEgressRuleStatus) DeepCopyInto(out *SecurityGroupEgressRuleStatus) { - *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) - in.AtProvider.DeepCopyInto(&out.AtProvider) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroupEgressRuleStatus. -func (in *SecurityGroupEgressRuleStatus) DeepCopy() *SecurityGroupEgressRuleStatus { - if in == nil { - return nil - } - out := new(SecurityGroupEgressRuleStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SecurityGroupIngressRule) DeepCopyInto(out *SecurityGroupIngressRule) { - *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 SecurityGroupIngressRule. -func (in *SecurityGroupIngressRule) DeepCopy() *SecurityGroupIngressRule { - if in == nil { - return nil - } - out := new(SecurityGroupIngressRule) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *SecurityGroupIngressRule) 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 *SecurityGroupIngressRuleInitParameters) DeepCopyInto(out *SecurityGroupIngressRuleInitParameters) { - *out = *in - if in.CidrIPv4 != nil { - in, out := &in.CidrIPv4, &out.CidrIPv4 - *out = new(string) - **out = **in - } - if in.CidrIPv6 != nil { - in, out := &in.CidrIPv6, &out.CidrIPv6 - *out = new(string) - **out = **in - } - if in.Description != nil { - in, out := &in.Description, &out.Description - *out = new(string) - **out = **in - } - if in.FromPort != nil { - in, out := &in.FromPort, &out.FromPort - *out = new(float64) - **out = **in - } - if in.IPProtocol != nil { - in, out := &in.IPProtocol, &out.IPProtocol - *out = new(string) - **out = **in - } - if in.PrefixListID != nil { - in, out := &in.PrefixListID, &out.PrefixListID - *out = new(string) - **out = **in - } - if in.ReferencedSecurityGroupID != nil { - in, out := &in.ReferencedSecurityGroupID, &out.ReferencedSecurityGroupID - *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.ToPort != nil { - in, out := &in.ToPort, &out.ToPort - *out = new(float64) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroupIngressRuleInitParameters. -func (in *SecurityGroupIngressRuleInitParameters) DeepCopy() *SecurityGroupIngressRuleInitParameters { - if in == nil { - return nil - } - out := new(SecurityGroupIngressRuleInitParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SecurityGroupIngressRuleList) DeepCopyInto(out *SecurityGroupIngressRuleList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]SecurityGroupIngressRule, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroupIngressRuleList. -func (in *SecurityGroupIngressRuleList) DeepCopy() *SecurityGroupIngressRuleList { - if in == nil { - return nil - } - out := new(SecurityGroupIngressRuleList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *SecurityGroupIngressRuleList) 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 *SecurityGroupIngressRuleObservation) DeepCopyInto(out *SecurityGroupIngressRuleObservation) { - *out = *in - if in.Arn != nil { - in, out := &in.Arn, &out.Arn - *out = new(string) - **out = **in - } - if in.CidrIPv4 != nil { - in, out := &in.CidrIPv4, &out.CidrIPv4 - *out = new(string) - **out = **in - } - if in.CidrIPv6 != nil { - in, out := &in.CidrIPv6, &out.CidrIPv6 - *out = new(string) - **out = **in - } - if in.Description != nil { - in, out := &in.Description, &out.Description - *out = new(string) - **out = **in - } - if in.FromPort != nil { - in, out := &in.FromPort, &out.FromPort - *out = new(float64) - **out = **in - } - if in.ID != nil { - in, out := &in.ID, &out.ID - *out = new(string) - **out = **in - } - if in.IPProtocol != nil { - in, out := &in.IPProtocol, &out.IPProtocol - *out = new(string) - **out = **in - } - if in.PrefixListID != nil { - in, out := &in.PrefixListID, &out.PrefixListID - *out = new(string) - **out = **in - } - if in.ReferencedSecurityGroupID != nil { - in, out := &in.ReferencedSecurityGroupID, &out.ReferencedSecurityGroupID - *out = new(string) - **out = **in - } - if in.SecurityGroupID != nil { - in, out := &in.SecurityGroupID, &out.SecurityGroupID - *out = new(string) - **out = **in - } - if in.SecurityGroupRuleID != nil { - in, out := &in.SecurityGroupRuleID, &out.SecurityGroupRuleID - *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 - } - } - if in.ToPort != nil { - in, out := &in.ToPort, &out.ToPort - *out = new(float64) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroupIngressRuleObservation. -func (in *SecurityGroupIngressRuleObservation) DeepCopy() *SecurityGroupIngressRuleObservation { - if in == nil { - return nil - } - out := new(SecurityGroupIngressRuleObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SecurityGroupIngressRuleParameters) DeepCopyInto(out *SecurityGroupIngressRuleParameters) { - *out = *in - if in.CidrIPv4 != nil { - in, out := &in.CidrIPv4, &out.CidrIPv4 - *out = new(string) - **out = **in - } - if in.CidrIPv6 != nil { - in, out := &in.CidrIPv6, &out.CidrIPv6 - *out = new(string) - **out = **in - } - if in.Description != nil { - in, out := &in.Description, &out.Description - *out = new(string) - **out = **in - } - if in.FromPort != nil { - in, out := &in.FromPort, &out.FromPort - *out = new(float64) - **out = **in - } - if in.IPProtocol != nil { - in, out := &in.IPProtocol, &out.IPProtocol - *out = new(string) - **out = **in - } - if in.PrefixListID != nil { - in, out := &in.PrefixListID, &out.PrefixListID - *out = new(string) - **out = **in - } - if in.ReferencedSecurityGroupID != nil { - in, out := &in.ReferencedSecurityGroupID, &out.ReferencedSecurityGroupID - *out = new(string) - **out = **in - } - if in.Region != nil { - in, out := &in.Region, &out.Region - *out = new(string) - **out = **in - } - if in.SecurityGroupID != nil { - in, out := &in.SecurityGroupID, &out.SecurityGroupID - *out = new(string) - **out = **in - } - if in.SecurityGroupIDRef != nil { - in, out := &in.SecurityGroupIDRef, &out.SecurityGroupIDRef - *out = new(v1.Reference) - (*in).DeepCopyInto(*out) - } - if in.SecurityGroupIDSelector != nil { - in, out := &in.SecurityGroupIDSelector, &out.SecurityGroupIDSelector - *out = new(v1.Selector) - (*in).DeepCopyInto(*out) - } - 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.ToPort != nil { - in, out := &in.ToPort, &out.ToPort - *out = new(float64) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroupIngressRuleParameters. -func (in *SecurityGroupIngressRuleParameters) DeepCopy() *SecurityGroupIngressRuleParameters { - if in == nil { - return nil - } - out := new(SecurityGroupIngressRuleParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SecurityGroupIngressRuleSpec) DeepCopyInto(out *SecurityGroupIngressRuleSpec) { - *out = *in - in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) - in.ForProvider.DeepCopyInto(&out.ForProvider) - in.InitProvider.DeepCopyInto(&out.InitProvider) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroupIngressRuleSpec. -func (in *SecurityGroupIngressRuleSpec) DeepCopy() *SecurityGroupIngressRuleSpec { - if in == nil { - return nil - } - out := new(SecurityGroupIngressRuleSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SecurityGroupIngressRuleStatus) DeepCopyInto(out *SecurityGroupIngressRuleStatus) { - *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) - in.AtProvider.DeepCopyInto(&out.AtProvider) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroupIngressRuleStatus. -func (in *SecurityGroupIngressRuleStatus) DeepCopy() *SecurityGroupIngressRuleStatus { - if in == nil { - return nil - } - out := new(SecurityGroupIngressRuleStatus) - in.DeepCopyInto(out) - return out -} diff --git a/apis/vpc/v1alpha1/zz_generated.managed.go b/apis/vpc/v1alpha1/zz_generated.managed.go deleted file mode 100644 index f060292..0000000 --- a/apis/vpc/v1alpha1/zz_generated.managed.go +++ /dev/null @@ -1,128 +0,0 @@ -/* -Copyright 2022 Upbound Inc. -*/ -// Code generated by angryjet. DO NOT EDIT. - -package v1alpha1 - -import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - -// GetCondition of this SecurityGroupEgressRule. -func (mg *SecurityGroupEgressRule) GetCondition(ct xpv1.ConditionType) xpv1.Condition { - return mg.Status.GetCondition(ct) -} - -// GetDeletionPolicy of this SecurityGroupEgressRule. -func (mg *SecurityGroupEgressRule) GetDeletionPolicy() xpv1.DeletionPolicy { - return mg.Spec.DeletionPolicy -} - -// GetManagementPolicies of this SecurityGroupEgressRule. -func (mg *SecurityGroupEgressRule) GetManagementPolicies() xpv1.ManagementPolicies { - return mg.Spec.ManagementPolicies -} - -// GetProviderConfigReference of this SecurityGroupEgressRule. -func (mg *SecurityGroupEgressRule) GetProviderConfigReference() *xpv1.Reference { - return mg.Spec.ProviderConfigReference -} - -// GetPublishConnectionDetailsTo of this SecurityGroupEgressRule. -func (mg *SecurityGroupEgressRule) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { - return mg.Spec.PublishConnectionDetailsTo -} - -// GetWriteConnectionSecretToReference of this SecurityGroupEgressRule. -func (mg *SecurityGroupEgressRule) GetWriteConnectionSecretToReference() *xpv1.SecretReference { - return mg.Spec.WriteConnectionSecretToReference -} - -// SetConditions of this SecurityGroupEgressRule. -func (mg *SecurityGroupEgressRule) SetConditions(c ...xpv1.Condition) { - mg.Status.SetConditions(c...) -} - -// SetDeletionPolicy of this SecurityGroupEgressRule. -func (mg *SecurityGroupEgressRule) SetDeletionPolicy(r xpv1.DeletionPolicy) { - mg.Spec.DeletionPolicy = r -} - -// SetManagementPolicies of this SecurityGroupEgressRule. -func (mg *SecurityGroupEgressRule) SetManagementPolicies(r xpv1.ManagementPolicies) { - mg.Spec.ManagementPolicies = r -} - -// SetProviderConfigReference of this SecurityGroupEgressRule. -func (mg *SecurityGroupEgressRule) SetProviderConfigReference(r *xpv1.Reference) { - mg.Spec.ProviderConfigReference = r -} - -// SetPublishConnectionDetailsTo of this SecurityGroupEgressRule. -func (mg *SecurityGroupEgressRule) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { - mg.Spec.PublishConnectionDetailsTo = r -} - -// SetWriteConnectionSecretToReference of this SecurityGroupEgressRule. -func (mg *SecurityGroupEgressRule) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { - mg.Spec.WriteConnectionSecretToReference = r -} - -// GetCondition of this SecurityGroupIngressRule. -func (mg *SecurityGroupIngressRule) GetCondition(ct xpv1.ConditionType) xpv1.Condition { - return mg.Status.GetCondition(ct) -} - -// GetDeletionPolicy of this SecurityGroupIngressRule. -func (mg *SecurityGroupIngressRule) GetDeletionPolicy() xpv1.DeletionPolicy { - return mg.Spec.DeletionPolicy -} - -// GetManagementPolicies of this SecurityGroupIngressRule. -func (mg *SecurityGroupIngressRule) GetManagementPolicies() xpv1.ManagementPolicies { - return mg.Spec.ManagementPolicies -} - -// GetProviderConfigReference of this SecurityGroupIngressRule. -func (mg *SecurityGroupIngressRule) GetProviderConfigReference() *xpv1.Reference { - return mg.Spec.ProviderConfigReference -} - -// GetPublishConnectionDetailsTo of this SecurityGroupIngressRule. -func (mg *SecurityGroupIngressRule) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { - return mg.Spec.PublishConnectionDetailsTo -} - -// GetWriteConnectionSecretToReference of this SecurityGroupIngressRule. -func (mg *SecurityGroupIngressRule) GetWriteConnectionSecretToReference() *xpv1.SecretReference { - return mg.Spec.WriteConnectionSecretToReference -} - -// SetConditions of this SecurityGroupIngressRule. -func (mg *SecurityGroupIngressRule) SetConditions(c ...xpv1.Condition) { - mg.Status.SetConditions(c...) -} - -// SetDeletionPolicy of this SecurityGroupIngressRule. -func (mg *SecurityGroupIngressRule) SetDeletionPolicy(r xpv1.DeletionPolicy) { - mg.Spec.DeletionPolicy = r -} - -// SetManagementPolicies of this SecurityGroupIngressRule. -func (mg *SecurityGroupIngressRule) SetManagementPolicies(r xpv1.ManagementPolicies) { - mg.Spec.ManagementPolicies = r -} - -// SetProviderConfigReference of this SecurityGroupIngressRule. -func (mg *SecurityGroupIngressRule) SetProviderConfigReference(r *xpv1.Reference) { - mg.Spec.ProviderConfigReference = r -} - -// SetPublishConnectionDetailsTo of this SecurityGroupIngressRule. -func (mg *SecurityGroupIngressRule) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { - mg.Spec.PublishConnectionDetailsTo = r -} - -// SetWriteConnectionSecretToReference of this SecurityGroupIngressRule. -func (mg *SecurityGroupIngressRule) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { - mg.Spec.WriteConnectionSecretToReference = r -} diff --git a/apis/vpc/v1alpha1/zz_generated.managedlist.go b/apis/vpc/v1alpha1/zz_generated.managedlist.go deleted file mode 100644 index a807a9d..0000000 --- a/apis/vpc/v1alpha1/zz_generated.managedlist.go +++ /dev/null @@ -1,26 +0,0 @@ -/* -Copyright 2022 Upbound Inc. -*/ -// Code generated by angryjet. DO NOT EDIT. - -package v1alpha1 - -import resource "github.com/crossplane/crossplane-runtime/pkg/resource" - -// GetItems of this SecurityGroupEgressRuleList. -func (l *SecurityGroupEgressRuleList) 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 SecurityGroupIngressRuleList. -func (l *SecurityGroupIngressRuleList) GetItems() []resource.Managed { - items := make([]resource.Managed, len(l.Items)) - for i := range l.Items { - items[i] = &l.Items[i] - } - return items -} diff --git a/apis/vpc/v1alpha1/zz_generated.resolvers.go b/apis/vpc/v1alpha1/zz_generated.resolvers.go deleted file mode 100644 index 5e4f519..0000000 --- a/apis/vpc/v1alpha1/zz_generated.resolvers.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright 2022 Upbound Inc. -*/ -// Code generated by angryjet. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - reference "github.com/crossplane/crossplane-runtime/pkg/reference" - errors "github.com/pkg/errors" - v1alpha1 "kubedb.dev/provider-aws/apis/ec2/v1alpha1" - client "sigs.k8s.io/controller-runtime/pkg/client" -) - -// ResolveReferences of this SecurityGroupEgressRule. -func (mg *SecurityGroupEgressRule) ResolveReferences(ctx context.Context, c client.Reader) error { - r := reference.NewAPIResolver(c, mg) - - var rsp reference.ResolutionResponse - var err error - - rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.SecurityGroupID), - Extract: reference.ExternalName(), - Reference: mg.Spec.ForProvider.SecurityGroupIDRef, - Selector: mg.Spec.ForProvider.SecurityGroupIDSelector, - To: reference.To{ - List: &v1alpha1.SecurityGroupList{}, - Managed: &v1alpha1.SecurityGroup{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.SecurityGroupID") - } - mg.Spec.ForProvider.SecurityGroupID = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.SecurityGroupIDRef = rsp.ResolvedReference - - return nil -} - -// ResolveReferences of this SecurityGroupIngressRule. -func (mg *SecurityGroupIngressRule) ResolveReferences(ctx context.Context, c client.Reader) error { - r := reference.NewAPIResolver(c, mg) - - var rsp reference.ResolutionResponse - var err error - - rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.SecurityGroupID), - Extract: reference.ExternalName(), - Reference: mg.Spec.ForProvider.SecurityGroupIDRef, - Selector: mg.Spec.ForProvider.SecurityGroupIDSelector, - To: reference.To{ - List: &v1alpha1.SecurityGroupList{}, - Managed: &v1alpha1.SecurityGroup{}, - }, - }) - if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.SecurityGroupID") - } - mg.Spec.ForProvider.SecurityGroupID = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.SecurityGroupIDRef = rsp.ResolvedReference - - return nil -} diff --git a/apis/vpc/v1alpha1/zz_generated_terraformed.go b/apis/vpc/v1alpha1/zz_generated_terraformed.go deleted file mode 100755 index ac9485e..0000000 --- a/apis/vpc/v1alpha1/zz_generated_terraformed.go +++ /dev/null @@ -1,247 +0,0 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by upjet. DO NOT EDIT. - -package v1alpha1 - -import ( - "dario.cat/mergo" - "github.com/pkg/errors" - - "github.com/crossplane/upjet/pkg/resource" - "github.com/crossplane/upjet/pkg/resource/json" -) - -// GetTerraformResourceType returns Terraform resource type for this SecurityGroupEgressRule -func (mg *SecurityGroupEgressRule) GetTerraformResourceType() string { - return "aws_vpc_security_group_egress_rule" -} - -// GetConnectionDetailsMapping for this SecurityGroupEgressRule -func (tr *SecurityGroupEgressRule) GetConnectionDetailsMapping() map[string]string { - return nil -} - -// GetObservation of this SecurityGroupEgressRule -func (tr *SecurityGroupEgressRule) 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 SecurityGroupEgressRule -func (tr *SecurityGroupEgressRule) SetObservation(obs map[string]any) error { - p, err := json.TFParser.Marshal(obs) - if err != nil { - return err - } - return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) -} - -// GetID returns ID of underlying Terraform resource of this SecurityGroupEgressRule -func (tr *SecurityGroupEgressRule) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" - } - return *tr.Status.AtProvider.ID -} - -// GetParameters of this SecurityGroupEgressRule -func (tr *SecurityGroupEgressRule) 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 SecurityGroupEgressRule -func (tr *SecurityGroupEgressRule) 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 SecurityGroupEgressRule -func (tr *SecurityGroupEgressRule) 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 SecurityGroupEgressRule -func (tr *SecurityGroupEgressRule) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { - params, err := tr.GetParameters() - if err != nil { - return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", 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 '%q'", 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 '%q'", tr.GetName()) - } - - return params, nil -} - -// LateInitialize this SecurityGroupEgressRule using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *SecurityGroupEgressRule) LateInitialize(attrs []byte) (bool, error) { - params := &SecurityGroupEgressRuleParameters{} - 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 *SecurityGroupEgressRule) GetTerraformSchemaVersion() int { - return 0 -} - -// GetTerraformResourceType returns Terraform resource type for this SecurityGroupIngressRule -func (mg *SecurityGroupIngressRule) GetTerraformResourceType() string { - return "aws_vpc_security_group_ingress_rule" -} - -// GetConnectionDetailsMapping for this SecurityGroupIngressRule -func (tr *SecurityGroupIngressRule) GetConnectionDetailsMapping() map[string]string { - return nil -} - -// GetObservation of this SecurityGroupIngressRule -func (tr *SecurityGroupIngressRule) 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 SecurityGroupIngressRule -func (tr *SecurityGroupIngressRule) SetObservation(obs map[string]any) error { - p, err := json.TFParser.Marshal(obs) - if err != nil { - return err - } - return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) -} - -// GetID returns ID of underlying Terraform resource of this SecurityGroupIngressRule -func (tr *SecurityGroupIngressRule) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" - } - return *tr.Status.AtProvider.ID -} - -// GetParameters of this SecurityGroupIngressRule -func (tr *SecurityGroupIngressRule) 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 SecurityGroupIngressRule -func (tr *SecurityGroupIngressRule) 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 SecurityGroupIngressRule -func (tr *SecurityGroupIngressRule) 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 SecurityGroupIngressRule -func (tr *SecurityGroupIngressRule) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { - params, err := tr.GetParameters() - if err != nil { - return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", 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 '%q'", 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 '%q'", tr.GetName()) - } - - return params, nil -} - -// LateInitialize this SecurityGroupIngressRule using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *SecurityGroupIngressRule) LateInitialize(attrs []byte) (bool, error) { - params := &SecurityGroupIngressRuleParameters{} - 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 *SecurityGroupIngressRule) GetTerraformSchemaVersion() int { - return 0 -} diff --git a/apis/vpc/v1alpha1/zz_groupversion_info.go b/apis/vpc/v1alpha1/zz_groupversion_info.go deleted file mode 100755 index 76520da..0000000 --- a/apis/vpc/v1alpha1/zz_groupversion_info.go +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by upjet. DO NOT EDIT. - -// +kubebuilder:object:generate=true -// +groupName=vpc.aws.kubedb.com -// +versionName=v1alpha1 -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -// Package type metadata. -const ( - CRDGroup = "vpc.aws.kubedb.com" - CRDVersion = "v1alpha1" -) - -var ( - // CRDGroupVersion is the API Group Version used to register the objects - CRDGroupVersion = schema.GroupVersion{Group: CRDGroup, Version: CRDVersion} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: CRDGroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme -) diff --git a/apis/vpc/v1alpha1/zz_securitygroupegressrule_types.go b/apis/vpc/v1alpha1/zz_securitygroupegressrule_types.go deleted file mode 100755 index a02162c..0000000 --- a/apis/vpc/v1alpha1/zz_securitygroupegressrule_types.go +++ /dev/null @@ -1,211 +0,0 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by upjet. DO NOT EDIT. - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - - v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" -) - -type SecurityGroupEgressRuleInitParameters struct { - - // The destination IPv4 CIDR range. - CidrIPv4 *string `json:"cidrIpv4,omitempty" tf:"cidr_ipv4,omitempty"` - - // The destination IPv6 CIDR range. - CidrIPv6 *string `json:"cidrIpv6,omitempty" tf:"cidr_ipv6,omitempty"` - - // The security group rule description. - Description *string `json:"description,omitempty" tf:"description,omitempty"` - - // The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type. - FromPort *float64 `json:"fromPort,omitempty" tf:"from_port,omitempty"` - - // The IP protocol name or number. Use -1 to specify all protocols. - IPProtocol *string `json:"ipProtocol,omitempty" tf:"ip_protocol,omitempty"` - - // The ID of the destination prefix list. - PrefixListID *string `json:"prefixListId,omitempty" tf:"prefix_list_id,omitempty"` - - // The destination security group that is referenced in the rule. - ReferencedSecurityGroupID *string `json:"referencedSecurityGroupId,omitempty" tf:"referenced_security_group_id,omitempty"` - - // A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` - - // The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. - ToPort *float64 `json:"toPort,omitempty" tf:"to_port,omitempty"` -} - -type SecurityGroupEgressRuleObservation struct { - - // The Amazon Resource Name (ARN) of the security group rule. - Arn *string `json:"arn,omitempty" tf:"arn,omitempty"` - - // The destination IPv4 CIDR range. - CidrIPv4 *string `json:"cidrIpv4,omitempty" tf:"cidr_ipv4,omitempty"` - - // The destination IPv6 CIDR range. - CidrIPv6 *string `json:"cidrIpv6,omitempty" tf:"cidr_ipv6,omitempty"` - - // The security group rule description. - Description *string `json:"description,omitempty" tf:"description,omitempty"` - - // The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type. - FromPort *float64 `json:"fromPort,omitempty" tf:"from_port,omitempty"` - - ID *string `json:"id,omitempty" tf:"id,omitempty"` - - // The IP protocol name or number. Use -1 to specify all protocols. - IPProtocol *string `json:"ipProtocol,omitempty" tf:"ip_protocol,omitempty"` - - // The ID of the destination prefix list. - PrefixListID *string `json:"prefixListId,omitempty" tf:"prefix_list_id,omitempty"` - - // The destination security group that is referenced in the rule. - ReferencedSecurityGroupID *string `json:"referencedSecurityGroupId,omitempty" tf:"referenced_security_group_id,omitempty"` - - // The ID of the security group. - SecurityGroupID *string `json:"securityGroupId,omitempty" tf:"security_group_id,omitempty"` - - // The ID of the security group rule. - SecurityGroupRuleID *string `json:"securityGroupRuleId,omitempty" tf:"security_group_rule_id,omitempty"` - - // A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level. - 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. - TagsAll map[string]*string `json:"tagsAll,omitempty" tf:"tags_all,omitempty"` - - // The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. - ToPort *float64 `json:"toPort,omitempty" tf:"to_port,omitempty"` -} - -type SecurityGroupEgressRuleParameters struct { - - // The destination IPv4 CIDR range. - // +kubebuilder:validation:Optional - CidrIPv4 *string `json:"cidrIpv4,omitempty" tf:"cidr_ipv4,omitempty"` - - // The destination IPv6 CIDR range. - // +kubebuilder:validation:Optional - CidrIPv6 *string `json:"cidrIpv6,omitempty" tf:"cidr_ipv6,omitempty"` - - // The security group rule description. - // +kubebuilder:validation:Optional - Description *string `json:"description,omitempty" tf:"description,omitempty"` - - // The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type. - // +kubebuilder:validation:Optional - FromPort *float64 `json:"fromPort,omitempty" tf:"from_port,omitempty"` - - // The IP protocol name or number. Use -1 to specify all protocols. - // +kubebuilder:validation:Optional - IPProtocol *string `json:"ipProtocol,omitempty" tf:"ip_protocol,omitempty"` - - // The ID of the destination prefix list. - // +kubebuilder:validation:Optional - PrefixListID *string `json:"prefixListId,omitempty" tf:"prefix_list_id,omitempty"` - - // The destination security group that is referenced in the rule. - // +kubebuilder:validation:Optional - ReferencedSecurityGroupID *string `json:"referencedSecurityGroupId,omitempty" tf:"referenced_security_group_id,omitempty"` - - // Region is the region you'd like your resource to be created in. - // +upjet:crd:field:TFTag=- - // +kubebuilder:validation:Optional - Region *string `json:"region,omitempty" tf:"-"` - - // The ID of the security group. - // +crossplane:generate:reference:type=kubedb.dev/provider-aws/apis/ec2/v1alpha1.SecurityGroup - // +kubebuilder:validation:Optional - SecurityGroupID *string `json:"securityGroupId,omitempty" tf:"security_group_id,omitempty"` - - // Reference to a SecurityGroup in ec2 to populate securityGroupId. - // +kubebuilder:validation:Optional - SecurityGroupIDRef *v1.Reference `json:"securityGroupIdRef,omitempty" tf:"-"` - - // Selector for a SecurityGroup in ec2 to populate securityGroupId. - // +kubebuilder:validation:Optional - SecurityGroupIDSelector *v1.Selector `json:"securityGroupIdSelector,omitempty" tf:"-"` - - // A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level. - // +kubebuilder:validation:Optional - Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` - - // The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. - // +kubebuilder:validation:Optional - ToPort *float64 `json:"toPort,omitempty" tf:"to_port,omitempty"` -} - -// SecurityGroupEgressRuleSpec defines the desired state of SecurityGroupEgressRule -type SecurityGroupEgressRuleSpec struct { - v1.ResourceSpec `json:",inline"` - ForProvider SecurityGroupEgressRuleParameters `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 SecurityGroupEgressRuleInitParameters `json:"initProvider,omitempty"` -} - -// SecurityGroupEgressRuleStatus defines the observed state of SecurityGroupEgressRule. -type SecurityGroupEgressRuleStatus struct { - v1.ResourceStatus `json:",inline"` - AtProvider SecurityGroupEgressRuleObservation `json:"atProvider,omitempty"` -} - -// +kubebuilder:object:root=true - -// SecurityGroupEgressRule is the Schema for the SecurityGroupEgressRules API. Provides a VPC security group egress rule resource. -// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" -// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" -// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" -// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" -// +kubebuilder:subresource:status -// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,aws} -type SecurityGroupEgressRule 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.ipProtocol) || (has(self.initProvider) && has(self.initProvider.ipProtocol))",message="spec.forProvider.ipProtocol is a required parameter" - // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.region)",message="spec.forProvider.region is a required parameter" - Spec SecurityGroupEgressRuleSpec `json:"spec"` - Status SecurityGroupEgressRuleStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// SecurityGroupEgressRuleList contains a list of SecurityGroupEgressRules -type SecurityGroupEgressRuleList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []SecurityGroupEgressRule `json:"items"` -} - -// Repository type metadata. -var ( - SecurityGroupEgressRule_Kind = "SecurityGroupEgressRule" - SecurityGroupEgressRule_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: SecurityGroupEgressRule_Kind}.String() - SecurityGroupEgressRule_KindAPIVersion = SecurityGroupEgressRule_Kind + "." + CRDGroupVersion.String() - SecurityGroupEgressRule_GroupVersionKind = CRDGroupVersion.WithKind(SecurityGroupEgressRule_Kind) -) - -func init() { - SchemeBuilder.Register(&SecurityGroupEgressRule{}, &SecurityGroupEgressRuleList{}) -} diff --git a/apis/vpc/v1alpha1/zz_securitygroupingressrule_types.go b/apis/vpc/v1alpha1/zz_securitygroupingressrule_types.go deleted file mode 100755 index ec6027a..0000000 --- a/apis/vpc/v1alpha1/zz_securitygroupingressrule_types.go +++ /dev/null @@ -1,211 +0,0 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by upjet. DO NOT EDIT. - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - - v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" -) - -type SecurityGroupIngressRuleInitParameters struct { - - // The source IPv4 CIDR range. - CidrIPv4 *string `json:"cidrIpv4,omitempty" tf:"cidr_ipv4,omitempty"` - - // The source IPv6 CIDR range. - CidrIPv6 *string `json:"cidrIpv6,omitempty" tf:"cidr_ipv6,omitempty"` - - // The security group rule description. - Description *string `json:"description,omitempty" tf:"description,omitempty"` - - // The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type. - FromPort *float64 `json:"fromPort,omitempty" tf:"from_port,omitempty"` - - // The IP protocol name or number. Use -1 to specify all protocols. - IPProtocol *string `json:"ipProtocol,omitempty" tf:"ip_protocol,omitempty"` - - // The ID of the source prefix list. - PrefixListID *string `json:"prefixListId,omitempty" tf:"prefix_list_id,omitempty"` - - // The source security group that is referenced in the rule. - ReferencedSecurityGroupID *string `json:"referencedSecurityGroupId,omitempty" tf:"referenced_security_group_id,omitempty"` - - // A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` - - // The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. - ToPort *float64 `json:"toPort,omitempty" tf:"to_port,omitempty"` -} - -type SecurityGroupIngressRuleObservation struct { - - // The Amazon Resource Name (ARN) of the security group rule. - Arn *string `json:"arn,omitempty" tf:"arn,omitempty"` - - // The source IPv4 CIDR range. - CidrIPv4 *string `json:"cidrIpv4,omitempty" tf:"cidr_ipv4,omitempty"` - - // The source IPv6 CIDR range. - CidrIPv6 *string `json:"cidrIpv6,omitempty" tf:"cidr_ipv6,omitempty"` - - // The security group rule description. - Description *string `json:"description,omitempty" tf:"description,omitempty"` - - // The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type. - FromPort *float64 `json:"fromPort,omitempty" tf:"from_port,omitempty"` - - ID *string `json:"id,omitempty" tf:"id,omitempty"` - - // The IP protocol name or number. Use -1 to specify all protocols. - IPProtocol *string `json:"ipProtocol,omitempty" tf:"ip_protocol,omitempty"` - - // The ID of the source prefix list. - PrefixListID *string `json:"prefixListId,omitempty" tf:"prefix_list_id,omitempty"` - - // The source security group that is referenced in the rule. - ReferencedSecurityGroupID *string `json:"referencedSecurityGroupId,omitempty" tf:"referenced_security_group_id,omitempty"` - - // The ID of the security group. - SecurityGroupID *string `json:"securityGroupId,omitempty" tf:"security_group_id,omitempty"` - - // The ID of the security group rule. - SecurityGroupRuleID *string `json:"securityGroupRuleId,omitempty" tf:"security_group_rule_id,omitempty"` - - // A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level. - 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. - TagsAll map[string]*string `json:"tagsAll,omitempty" tf:"tags_all,omitempty"` - - // The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. - ToPort *float64 `json:"toPort,omitempty" tf:"to_port,omitempty"` -} - -type SecurityGroupIngressRuleParameters struct { - - // The source IPv4 CIDR range. - // +kubebuilder:validation:Optional - CidrIPv4 *string `json:"cidrIpv4,omitempty" tf:"cidr_ipv4,omitempty"` - - // The source IPv6 CIDR range. - // +kubebuilder:validation:Optional - CidrIPv6 *string `json:"cidrIpv6,omitempty" tf:"cidr_ipv6,omitempty"` - - // The security group rule description. - // +kubebuilder:validation:Optional - Description *string `json:"description,omitempty" tf:"description,omitempty"` - - // The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type. - // +kubebuilder:validation:Optional - FromPort *float64 `json:"fromPort,omitempty" tf:"from_port,omitempty"` - - // The IP protocol name or number. Use -1 to specify all protocols. - // +kubebuilder:validation:Optional - IPProtocol *string `json:"ipProtocol,omitempty" tf:"ip_protocol,omitempty"` - - // The ID of the source prefix list. - // +kubebuilder:validation:Optional - PrefixListID *string `json:"prefixListId,omitempty" tf:"prefix_list_id,omitempty"` - - // The source security group that is referenced in the rule. - // +kubebuilder:validation:Optional - ReferencedSecurityGroupID *string `json:"referencedSecurityGroupId,omitempty" tf:"referenced_security_group_id,omitempty"` - - // Region is the region you'd like your resource to be created in. - // +upjet:crd:field:TFTag=- - // +kubebuilder:validation:Optional - Region *string `json:"region,omitempty" tf:"-"` - - // The ID of the security group. - // +crossplane:generate:reference:type=kubedb.dev/provider-aws/apis/ec2/v1alpha1.SecurityGroup - // +kubebuilder:validation:Optional - SecurityGroupID *string `json:"securityGroupId,omitempty" tf:"security_group_id,omitempty"` - - // Reference to a SecurityGroup in ec2 to populate securityGroupId. - // +kubebuilder:validation:Optional - SecurityGroupIDRef *v1.Reference `json:"securityGroupIdRef,omitempty" tf:"-"` - - // Selector for a SecurityGroup in ec2 to populate securityGroupId. - // +kubebuilder:validation:Optional - SecurityGroupIDSelector *v1.Selector `json:"securityGroupIdSelector,omitempty" tf:"-"` - - // A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level. - // +kubebuilder:validation:Optional - Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` - - // The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. - // +kubebuilder:validation:Optional - ToPort *float64 `json:"toPort,omitempty" tf:"to_port,omitempty"` -} - -// SecurityGroupIngressRuleSpec defines the desired state of SecurityGroupIngressRule -type SecurityGroupIngressRuleSpec struct { - v1.ResourceSpec `json:",inline"` - ForProvider SecurityGroupIngressRuleParameters `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 SecurityGroupIngressRuleInitParameters `json:"initProvider,omitempty"` -} - -// SecurityGroupIngressRuleStatus defines the observed state of SecurityGroupIngressRule. -type SecurityGroupIngressRuleStatus struct { - v1.ResourceStatus `json:",inline"` - AtProvider SecurityGroupIngressRuleObservation `json:"atProvider,omitempty"` -} - -// +kubebuilder:object:root=true - -// SecurityGroupIngressRule is the Schema for the SecurityGroupIngressRules API. Provides a VPC security group ingress rule resource. -// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" -// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" -// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" -// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" -// +kubebuilder:subresource:status -// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,aws} -type SecurityGroupIngressRule 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.ipProtocol) || (has(self.initProvider) && has(self.initProvider.ipProtocol))",message="spec.forProvider.ipProtocol is a required parameter" - // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.region)",message="spec.forProvider.region is a required parameter" - Spec SecurityGroupIngressRuleSpec `json:"spec"` - Status SecurityGroupIngressRuleStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// SecurityGroupIngressRuleList contains a list of SecurityGroupIngressRules -type SecurityGroupIngressRuleList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []SecurityGroupIngressRule `json:"items"` -} - -// Repository type metadata. -var ( - SecurityGroupIngressRule_Kind = "SecurityGroupIngressRule" - SecurityGroupIngressRule_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: SecurityGroupIngressRule_Kind}.String() - SecurityGroupIngressRule_KindAPIVersion = SecurityGroupIngressRule_Kind + "." + CRDGroupVersion.String() - SecurityGroupIngressRule_GroupVersionKind = CRDGroupVersion.WithKind(SecurityGroupIngressRule_Kind) -) - -func init() { - SchemeBuilder.Register(&SecurityGroupIngressRule{}, &SecurityGroupIngressRuleList{}) -} diff --git a/cmd/provider/main.go b/cmd/provider/main.go index fb2cc41..0f3db87 100644 --- a/cmd/provider/main.go +++ b/cmd/provider/main.go @@ -96,7 +96,7 @@ func main() { // use the following WorkspaceStoreOption to enable the shared gRPC mode // terraform.WithProviderRunner(terraform.NewSharedProvider(log, os.Getenv("TERRAFORM_NATIVE_PROVIDER_PATH"), terraform.WithNativeProviderArgs("-debuggable"))) WorkspaceStore: terraform.NewWorkspaceStore(log), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion), + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider), } if *enableExternalSecretStores { diff --git a/config/external_name.go b/config/external_name.go index 81a7329..53ce989 100644 --- a/config/external_name.go +++ b/config/external_name.go @@ -64,13 +64,15 @@ var CLIReconciledExternalNameConfigs = map[string]config.ExternalName{ //"aws_vpc_security_group_ingress_rule": vpcSecurityGroupRule(), // AppConfig Environments can be imported by using the environment ID and application ID separated by a colon (:) // terraform-plugin-framework - "aws_appconfig_environment": config.IdentifierFromProvider, + //"aws_appconfig_environment": config.IdentifierFromProvider, // us-west-2_abc123/3ho4ek12345678909nh3fmhpko //"aws_cognito_user_pool_client": FormattedIdentifierFromProvider("", "name"), // simpledb // // SimpleDB Domains can be imported using the name //"aws_simpledb_domain": config.NameAsIdentifier, + // DynamoDB tables can be imported using the name + "aws_dynamodb_table": config.NameAsIdentifier, } func vpcSecurityGroupRule() config.ExternalName { @@ -126,8 +128,7 @@ var ExternalNameConfigs = map[string]config.ExternalName{ // // DynamoDB table replicas can be imported using the table-name:main-region "aws_dynamodb_table_replica": config.IdentifierFromProvider, - // DynamoDB tables can be imported using the name - "aws_dynamodb_table": config.NameAsIdentifier, + // DynamoDB Global Tables can be imported using the global table name "aws_dynamodb_global_table": config.NameAsIdentifier, // aws_dynamodb_tag can be imported by using the DynamoDB resource identifier and key, separated by a comma (,) diff --git a/go.mod b/go.mod index d9ace3e..52050e3 100644 --- a/go.mod +++ b/go.mod @@ -92,6 +92,7 @@ require ( github.com/fatih/camelcase v1.0.0 // indirect github.com/fatih/color v1.15.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/go-ini/ini v1.67.0 // indirect github.com/go-logr/logr v1.2.4 // indirect github.com/go-logr/zapr v1.2.4 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect diff --git a/go.sum b/go.sum index 6800a65..5e6737c 100644 --- a/go.sum +++ b/go.sum @@ -250,6 +250,8 @@ github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4= github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= +github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A= +github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/internal/clients/aws.go b/internal/clients/aws.go index 73ff571..1221393 100644 --- a/internal/clients/aws.go +++ b/internal/clients/aws.go @@ -7,13 +7,17 @@ package clients import ( "context" "encoding/json" + "github.com/aws/aws-sdk-go-v2/aws" "github.com/crossplane/crossplane-runtime/pkg/fieldpath" - "k8s.io/apimachinery/pkg/runtime" - "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-provider-aws/xpprovider" "github.com/pkg/errors" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" + "reflect" "sigs.k8s.io/controller-runtime/pkg/client" + "unsafe" "github.com/crossplane/upjet/pkg/terraform" @@ -36,7 +40,7 @@ const ( // TerraformSetupBuilder builds Terraform a terraform.SetupFn function which // returns Terraform provider setup configuration -func TerraformSetupBuilder(version, providerSource, providerVersion string) terraform.SetupFn { +func TerraformSetupBuilder(version, providerSource, providerVersion string, mta *schema.Provider) terraform.SetupFn { return func(ctx context.Context, client client.Client, mg resource.Managed) (terraform.Setup, error) { ps := terraform.Setup{ Version: version, @@ -60,30 +64,103 @@ func TerraformSetupBuilder(version, providerSource, providerVersion string) terr return ps, errors.Wrap(err, errTrackUsage) } - data, err := resource.CommonCredentialExtractor(ctx, pc.Spec.Credentials.Source, client, pc.Spec.Credentials.CommonCredentialSelectors) + err := pushDownTerraformSetupBuilder(ctx, client, mg, pc, &ps) if err != nil { - return ps, errors.Wrap(err, errExtractCredentials) - } - creds := map[string]string{} - if err := json.Unmarshal(data, &creds); err != nil { - return ps, errors.Wrap(err, errUnmarshalCredentials) + return terraform.Setup{}, errors.Wrap(err, "cannot build terraform configuration") } - region, err := getRegion(mg) + awsConfig, err := configureNoForkAWSClient(ctx, client, mg, pc, &ps) if err != nil { - return ps, errors.Wrap(err, errRegionNotFound) + return terraform.Setup{}, errors.Wrap(err, "could not configure no-fork AWS client") } - - // Set credentials in Terraform provider configuration. - ps.Configuration = map[string]any{ - accessKeyID: creds[accessKeyID], - secretAccessKey: creds[secretAccessKey], - keyRegion: region, + p := mta.Meta() + tfClient, diag := awsConfig.GetClient(ctx, &xpprovider.AWSClient{ + // #nosec G103 + ServicePackages: (*xpprovider.AWSClient)(unsafe.Pointer(reflect.ValueOf(p).Pointer())).ServicePackages, + }) + if diag != nil && diag.HasError() { + return terraform.Setup{}, errors.Errorf("failed to configure the AWS client: %v", diag) } + ps.Meta = tfClient return ps, nil } } +func pushDownTerraformSetupBuilder(ctx context.Context, client client.Client, mg resource.Managed, pc *v1beta1.ProviderConfig, ps *terraform.Setup) error { + data, err := resource.CommonCredentialExtractor(ctx, pc.Spec.Credentials.Source, client, pc.Spec.Credentials.CommonCredentialSelectors) + if err != nil { + return errors.Wrap(err, errExtractCredentials) + } + creds := map[string]string{} + if err := json.Unmarshal(data, &creds); err != nil { + return errors.Wrap(err, errUnmarshalCredentials) + } + + region, err := getRegion(mg) + if err != nil { + return errors.Wrap(err, errRegionNotFound) + } + + // Set credentials in Terraform provider configuration. + ps.Configuration = map[string]any{ + accessKeyID: creds[accessKeyID], + secretAccessKey: creds[secretAccessKey], + keyRegion: region, + } + return nil +} + +func configureNoForkAWSClient(ctx context.Context, c client.Client, mg resource.Managed, pc *v1beta1.ProviderConfig, ps *terraform.Setup) (xpprovider.AWSConfig, error) { //nolint:gocyclo + + if len(pc.Spec.AssumeRoleChain) > 1 || pc.Spec.Endpoint != nil { + return xpprovider.AWSConfig{}, errors.New("cannot configure no-fork client because the length of assume role chain array " + + "is more than 1 or endpoint configuration is not nil") + } + + cfg, err := getAWSConfig(ctx, c, mg) + if err != nil { + return xpprovider.AWSConfig{}, errors.Wrap(err, "cannot get AWS config") + } + + awsConfig := xpprovider.AWSConfig{ + Region: cfg.Region, + TerraformVersion: ps.Version, + } + + data, err := resource.CommonCredentialExtractor(ctx, pc.Spec.Credentials.Source, c, pc.Spec.Credentials.CommonCredentialSelectors) + if err != nil { + return xpprovider.AWSConfig{}, errors.Wrap(err, errExtractCredentials) + } + creds := map[string]string{} + if err := json.Unmarshal(data, &creds); err != nil { + return xpprovider.AWSConfig{}, errors.Wrap(err, errUnmarshalCredentials) + } + + region, err := getRegion(mg) + if err != nil { + return xpprovider.AWSConfig{}, errors.Wrap(err, errRegionNotFound) + } + + // Set credentials in Terraform provider configuration. + + awsConfig.AccessKey = creds[accessKeyID] + awsConfig.SecretKey = creds[secretAccessKey] + awsConfig.Region = region + + return awsConfig, nil +} + +func getAWSConfig(ctx context.Context, c client.Client, mg resource.Managed) (*aws.Config, error) { + cfg, err := GetAWSConfig(ctx, c, mg) + if err != nil { + return nil, errors.Wrap(err, "cannot get AWS config") + } + if cfg.Region == "" && mg.GetObjectKind().GroupVersionKind().Group == "iam.aws.upbound.io" { + cfg.Region = "us-east-1" + } + return cfg, nil +} + func getRegion(obj runtime.Object) (string, error) { fromMap, err := runtime.DefaultUnstructuredConverter.ToUnstructured(obj) if err != nil { diff --git a/internal/clients/provider_config.go b/internal/clients/provider_config.go new file mode 100644 index 0000000..a7be7d9 --- /dev/null +++ b/internal/clients/provider_config.go @@ -0,0 +1,276 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +package clients + +import ( + "context" + "fmt" + "strings" + + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/config" + "github.com/aws/aws-sdk-go-v2/credentials" + "github.com/aws/aws-sdk-go-v2/credentials/stscreds" + "github.com/aws/aws-sdk-go-v2/service/sts" + stscredstypesv2 "github.com/aws/aws-sdk-go-v2/service/sts/types" + "github.com/aws/smithy-go/middleware" + "github.com/go-ini/ini" + "github.com/pkg/errors" + "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client" + + "github.com/crossplane/crossplane-runtime/pkg/resource" + + "kubedb.dev/provider-aws/apis/v1beta1" + "kubedb.dev/provider-aws/internal/version" +) + +const ( + // DefaultSection for INI files. + DefaultSection = "DEFAULT" + //ff=ini.DefaultSection + + // authentication types + errRoleChainConfig = "failed to load assumed role AWS config" + errAWSConfig = "failed to get AWS config" +) + +// GlobalRegion is the region name used for AWS services that do not have a notion +// of region. +const GlobalRegion = "aws-global" + +// Endpoint URL configuration types. +const ( + URLConfigTypeStatic = "Static" + URLConfigTypeDynamic = "Dynamic" +) + +// userAgentV2 constructs the Crossplane user agent for AWS v2 clients +var userAgentV2 = config.WithAPIOptions([]func(*middleware.Stack) error{ + awsmiddleware.AddUserAgentKeyValue("upbound-provider-aws", version.Version), + awsmiddleware.AddUserAgentKeyValue("crossplane-provider-aws", version.Version), +}) + +// GetAWSConfig to produce a config that can be used to authenticate to AWS. +func GetAWSConfig(ctx context.Context, c client.Client, mg resource.Managed) (*aws.Config, error) { // nolint:gocyclo + if mg.GetProviderConfigReference() == nil { + return nil, errors.New("no providerConfigRef provided") + } + region, err := getRegion(mg) + if err != nil { + return nil, errors.Wrap(err, "cannot get region") + } + pc := &v1beta1.ProviderConfig{} + if err := c.Get(ctx, types.NamespacedName{Name: mg.GetProviderConfigReference().Name}, pc); err != nil { + return nil, errors.Wrap(err, "cannot get referenced Provider") + } + + t := resource.NewProviderConfigUsageTracker(c, &v1beta1.ProviderConfigUsage{}) + if err := t.Track(ctx, mg); err != nil { + return nil, errors.Wrap(err, "cannot track ProviderConfig usage") + } + + var cfg *aws.Config + s := pc.Spec.Credentials.Source //nolint:exhaustive + + data, err := resource.CommonCredentialExtractor(ctx, s, c, pc.Spec.Credentials.CommonCredentialSelectors) + if err != nil { + return nil, errors.Wrap(err, "cannot get credentials") + } + cfg, err = UseProviderSecret(ctx, data, DefaultSection, region) + if err != nil { + return nil, errors.Wrap(err, errAWSConfig) + } + + cfg, err = GetRoleChainConfig(ctx, &pc.Spec, cfg) + if err != nil { + return nil, errors.Wrap(err, "cannot get credentials") + } + return SetResolver(pc, cfg), nil +} + +type awsEndpointResolverAdaptorWithOptions func(service, region string, options interface{}) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptorWithOptions) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region, options) +} + +// SetResolver parses annotations from the managed resource +// and returns a configuration accordingly. +func SetResolver(pc *v1beta1.ProviderConfig, cfg *aws.Config) *aws.Config { // nolint:gocyclo + if pc.Spec.Endpoint == nil { + return cfg + } + cfg.EndpointResolverWithOptions = awsEndpointResolverAdaptorWithOptions(func(service, region string, options interface{}) (aws.Endpoint, error) { //nolint:staticcheck + fullURL := "" + switch pc.Spec.Endpoint.URL.Type { + case URLConfigTypeStatic: + if pc.Spec.Endpoint.URL.Static == nil { + return aws.Endpoint{}, errors.New("static type is chosen but static field does not have a value") + } + fullURL = aws.ToString(pc.Spec.Endpoint.URL.Static) + case URLConfigTypeDynamic: + if pc.Spec.Endpoint.URL.Dynamic == nil { + return aws.Endpoint{}, errors.New("dynamic type is chosen but dynamic configuration is not given") + } + // NOTE(muvaf): IAM does not have any region. + if service == "IAM" { + fullURL = fmt.Sprintf("%s://%s.%s", pc.Spec.Endpoint.URL.Dynamic.Protocol, strings.ToLower(service), pc.Spec.Endpoint.URL.Dynamic.Host) + } else { + fullURL = fmt.Sprintf("%s://%s.%s.%s", pc.Spec.Endpoint.URL.Dynamic.Protocol, strings.ToLower(service), region, pc.Spec.Endpoint.URL.Dynamic.Host) + } + default: + return aws.Endpoint{}, errors.New("unsupported url config type is chosen") + } + e := aws.Endpoint{ + URL: fullURL, + HostnameImmutable: aws.ToBool(pc.Spec.Endpoint.HostnameImmutable), + PartitionID: aws.ToString(pc.Spec.Endpoint.PartitionID), + SigningName: aws.ToString(pc.Spec.Endpoint.SigningName), + SigningRegion: aws.ToString(LateInitializeStringPtr(pc.Spec.Endpoint.SigningRegion, ®ion)), + SigningMethod: aws.ToString(pc.Spec.Endpoint.SigningMethod), + } + // Only IAM does not have a region parameter and "aws-global" is used in + // SDK setup. However, signing region has to be us-east-1 and it needs + // to be set. + if region == "aws-global" { + switch aws.ToString(pc.Spec.Endpoint.PartitionID) { + case "aws-us-gov", "aws-cn", "aws-iso", "aws-iso-b": + e.SigningRegion = aws.ToString(LateInitializeStringPtr(pc.Spec.Endpoint.SigningRegion, ®ion)) + default: + e.SigningRegion = "us-east-1" + } + } + if pc.Spec.Endpoint.Source != nil { + switch *pc.Spec.Endpoint.Source { + case "ServiceMetadata": + e.Source = aws.EndpointSourceServiceMetadata + case "Custom": + e.Source = aws.EndpointSourceCustom + } + } + return e, nil + }) + return cfg +} + +// CredentialsIDSecret retrieves AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY from the data which contains +// aws credentials under given profile +// Example: +// [default] +// aws_access_key_id = +// aws_secret_access_key = +func CredentialsIDSecret(data []byte, profile string) (aws.Credentials, error) { + awsConfig, err := ini.InsensitiveLoad(data) + if err != nil { + return aws.Credentials{}, errors.Wrap(err, "cannot parse credentials secret") + } + + iniProfile, err := awsConfig.GetSection(profile) + if err != nil { + return aws.Credentials{}, errors.Wrap(err, fmt.Sprintf("cannot get %s profile in credentials secret", profile)) + } + + accessKeyID := iniProfile.Key("aws_access_key_id") + secretAccessKey := iniProfile.Key("aws_secret_access_key") + sessionToken := iniProfile.Key("aws_session_token") + + // NOTE(muvaf): Key function implementation never returns nil but still its + // type is pointer so we check to make sure its next versions doesn't break + // that implicit contract. + if accessKeyID == nil || secretAccessKey == nil || sessionToken == nil { + return aws.Credentials{}, errors.New("returned key can be empty but cannot be nil") + } + + return aws.Credentials{ + AccessKeyID: accessKeyID.Value(), + SecretAccessKey: secretAccessKey.Value(), + SessionToken: sessionToken.Value(), + }, nil +} + +// AuthMethod is a method of authenticating to the AWS API +type AuthMethod func(context.Context, []byte, string, string) (*aws.Config, error) + +// stsRegionOrDefault sets the STS client region to the passed region, or +// defaults to the global region. +func stsRegionOrDefault(region string) func(*sts.Options) { + return func(o *sts.Options) { + if region == "" { + o.Region = GlobalRegion + } + } +} + +// UseProviderSecret - AWS configuration which can be used to issue requests against AWS API +func UseProviderSecret(ctx context.Context, data []byte, profile, region string) (*aws.Config, error) { + creds, err := CredentialsIDSecret(data, profile) + if err != nil { + return nil, errors.Wrap(err, "cannot parse credentials secret") + } + + awsConfig, err := config.LoadDefaultConfig( + ctx, + userAgentV2, + config.WithRegion(region), + config.WithCredentialsProvider(credentials.StaticCredentialsProvider{ + Value: creds, + }), + ) + if err != nil { + return nil, errors.Wrap(err, "cannot load default AWS config") + } + return &awsConfig, nil +} + +// GetRoleChainConfig returns an aws.Config capable of doing role chaining with +// AssumeRoleWithWebIdentity & AssumeRoles. +func GetRoleChainConfig(ctx context.Context, pcs *v1beta1.ProviderConfigSpec, cfg *aws.Config) (*aws.Config, error) { + pCfg := cfg + for _, aro := range pcs.AssumeRoleChain { + stsAssume := stscreds.NewAssumeRoleProvider( + sts.NewFromConfig(*pCfg, stsRegionOrDefault(cfg.Region)), //nolint:contextcheck + aws.ToString(aro.RoleARN), + SetAssumeRoleOptions(aro), + ) + cfgWithAssumeRole, err := config.LoadDefaultConfig( + ctx, + userAgentV2, + config.WithRegion(cfg.Region), + config.WithCredentialsProvider(aws.NewCredentialsCache(stsAssume)), + ) + if err != nil { + return nil, errors.Wrap(err, errRoleChainConfig) + } + pCfg = &cfgWithAssumeRole + } + return pCfg, nil +} + +// SetAssumeRoleOptions sets options when Assuming an IAM Role +func SetAssumeRoleOptions(aro v1beta1.AssumeRoleOptions) func(*stscreds.AssumeRoleOptions) { + return func(opt *stscreds.AssumeRoleOptions) { + opt.ExternalID = aro.ExternalID + for _, t := range aro.Tags { + opt.Tags = append( + opt.Tags, + stscredstypesv2.Tag{ + Key: t.Key, + Value: t.Value, + }) + } + opt.TransitiveTagKeys = append(opt.TransitiveTagKeys, aro.TransitiveTagKeys...) + } +} + +// LateInitializeStringPtr returns in if it's non-nil, otherwise returns from +// which is the backup for the cases in is nil. +func LateInitializeStringPtr(in *string, from *string) *string { + if in != nil { + return in + } + return from +}