From a926a7823c3955fdd4a453eea333b64c00f8c2e0 Mon Sep 17 00:00:00 2001 From: Anthony Mallica Date: Tue, 10 Feb 2026 13:58:27 -0500 Subject: [PATCH 1/8] Add VPC Origin resource for Cloudfront provider Signed-off-by: Anthony Mallica --- .../v1beta1/zz_generated.conversion_hubs.go | 3 + .../v1beta1/zz_generated.deepcopy.go | 493 ++++++++++++++++ .../v1beta1/zz_generated.managed.go | 50 ++ .../v1beta1/zz_generated.managedlist.go | 9 + .../v1beta1/zz_generated.resolvers.go | 57 ++ .../v1beta1/zz_vpcorigin_terraformed.go | 129 ++++ .../cloudfront/v1beta1/zz_vpcorigin_types.go | 235 ++++++++ .../v1beta1/zz_generated.conversion_hubs.go | 3 + .../v1beta1/zz_generated.deepcopy.go | 493 ++++++++++++++++ .../v1beta1/zz_generated.managed.go | 40 ++ .../v1beta1/zz_generated.managedlist.go | 9 + .../v1beta1/zz_generated.resolvers.go | 57 ++ .../v1beta1/zz_vpcorigin_terraformed.go | 129 ++++ .../cloudfront/v1beta1/zz_vpcorigin_types.go | 236 ++++++++ config/externalname.go | 2 + config/generated.lst | 1 + .../cluster/cloudfront/v1beta1/vpcorigin.yaml | 27 + .../cloudfront/v1beta1/vpcorigin.yaml | 28 + .../cloudfront/cluster/v1beta1/vpcorigin.yaml | 127 ++++ .../namespaced/v1beta1/vpcorigin.yaml | 127 ++++ .../cloudfront/vpcorigin/zz_controller.go | 103 ++++ .../controller/cluster/zz_cloudfront_setup.go | 3 + .../controller/cluster/zz_monolith_setup.go | 3 + .../cloudfront/vpcorigin/zz_controller.go | 103 ++++ .../namespaced/zz_cloudfront_setup.go | 3 + .../namespaced/zz_monolith_setup.go | 3 + ...loudfront.aws.m.upbound.io_vpcorigins.yaml | 519 +++++++++++++++++ .../cloudfront.aws.upbound.io_vpcorigins.yaml | 549 ++++++++++++++++++ 28 files changed, 3541 insertions(+) create mode 100755 apis/cluster/cloudfront/v1beta1/zz_vpcorigin_terraformed.go create mode 100755 apis/cluster/cloudfront/v1beta1/zz_vpcorigin_types.go create mode 100755 apis/namespaced/cloudfront/v1beta1/zz_vpcorigin_terraformed.go create mode 100755 apis/namespaced/cloudfront/v1beta1/zz_vpcorigin_types.go create mode 100644 examples-generated/cluster/cloudfront/v1beta1/vpcorigin.yaml create mode 100644 examples-generated/namespaced/cloudfront/v1beta1/vpcorigin.yaml create mode 100644 examples/cloudfront/cluster/v1beta1/vpcorigin.yaml create mode 100644 examples/cloudfront/namespaced/v1beta1/vpcorigin.yaml create mode 100755 internal/controller/cluster/cloudfront/vpcorigin/zz_controller.go create mode 100755 internal/controller/namespaced/cloudfront/vpcorigin/zz_controller.go create mode 100644 package/crds/cloudfront.aws.m.upbound.io_vpcorigins.yaml create mode 100644 package/crds/cloudfront.aws.upbound.io_vpcorigins.yaml diff --git a/apis/cluster/cloudfront/v1beta1/zz_generated.conversion_hubs.go b/apis/cluster/cloudfront/v1beta1/zz_generated.conversion_hubs.go index 31f1720fca..7d3866ccef 100755 --- a/apis/cluster/cloudfront/v1beta1/zz_generated.conversion_hubs.go +++ b/apis/cluster/cloudfront/v1beta1/zz_generated.conversion_hubs.go @@ -20,3 +20,6 @@ func (tr *OriginAccessIdentity) Hub() {} // Hub marks this type as a conversion hub. func (tr *PublicKey) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *VPCOrigin) Hub() {} diff --git a/apis/cluster/cloudfront/v1beta1/zz_generated.deepcopy.go b/apis/cluster/cloudfront/v1beta1/zz_generated.deepcopy.go index e5c53e672d..8fe10c1f12 100644 --- a/apis/cluster/cloudfront/v1beta1/zz_generated.deepcopy.go +++ b/apis/cluster/cloudfront/v1beta1/zz_generated.deepcopy.go @@ -7949,6 +7949,99 @@ func (in *OriginRequestPolicyStatus) DeepCopy() *OriginRequestPolicyStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OriginSSLProtocolsInitParameters) DeepCopyInto(out *OriginSSLProtocolsInitParameters) { + *out = *in + if in.Items != nil { + in, out := &in.Items, &out.Items + *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.Quantity != nil { + in, out := &in.Quantity, &out.Quantity + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OriginSSLProtocolsInitParameters. +func (in *OriginSSLProtocolsInitParameters) DeepCopy() *OriginSSLProtocolsInitParameters { + if in == nil { + return nil + } + out := new(OriginSSLProtocolsInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OriginSSLProtocolsObservation) DeepCopyInto(out *OriginSSLProtocolsObservation) { + *out = *in + if in.Items != nil { + in, out := &in.Items, &out.Items + *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.Quantity != nil { + in, out := &in.Quantity, &out.Quantity + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OriginSSLProtocolsObservation. +func (in *OriginSSLProtocolsObservation) DeepCopy() *OriginSSLProtocolsObservation { + if in == nil { + return nil + } + out := new(OriginSSLProtocolsObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OriginSSLProtocolsParameters) DeepCopyInto(out *OriginSSLProtocolsParameters) { + *out = *in + if in.Items != nil { + in, out := &in.Items, &out.Items + *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.Quantity != nil { + in, out := &in.Quantity, &out.Quantity + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OriginSSLProtocolsParameters. +func (in *OriginSSLProtocolsParameters) DeepCopy() *OriginSSLProtocolsParameters { + if in == nil { + return nil + } + out := new(OriginSSLProtocolsParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OriginShieldInitParameters) DeepCopyInto(out *OriginShieldInitParameters) { *out = *in @@ -10282,6 +10375,33 @@ func (in *TrustedSignersParameters) DeepCopy() *TrustedSignersParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCOrigin) DeepCopyInto(out *VPCOrigin) { + *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 VPCOrigin. +func (in *VPCOrigin) DeepCopy() *VPCOrigin { + if in == nil { + return nil + } + out := new(VPCOrigin) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VPCOrigin) 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 *VPCOriginConfigInitParameters) DeepCopyInto(out *VPCOriginConfigInitParameters) { *out = *in @@ -10372,6 +10492,379 @@ func (in *VPCOriginConfigParameters) DeepCopy() *VPCOriginConfigParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCOriginEndpointConfigInitParameters) DeepCopyInto(out *VPCOriginEndpointConfigInitParameters) { + *out = *in + if in.Arn != nil { + in, out := &in.Arn, &out.Arn + *out = new(string) + **out = **in + } + if in.ArnRef != nil { + in, out := &in.ArnRef, &out.ArnRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.ArnSelector != nil { + in, out := &in.ArnSelector, &out.ArnSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.HTTPPort != nil { + in, out := &in.HTTPPort, &out.HTTPPort + *out = new(float64) + **out = **in + } + if in.HTTPSPort != nil { + in, out := &in.HTTPSPort, &out.HTTPSPort + *out = new(float64) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.OriginProtocolPolicy != nil { + in, out := &in.OriginProtocolPolicy, &out.OriginProtocolPolicy + *out = new(string) + **out = **in + } + if in.OriginSSLProtocols != nil { + in, out := &in.OriginSSLProtocols, &out.OriginSSLProtocols + *out = make([]OriginSSLProtocolsInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCOriginEndpointConfigInitParameters. +func (in *VPCOriginEndpointConfigInitParameters) DeepCopy() *VPCOriginEndpointConfigInitParameters { + if in == nil { + return nil + } + out := new(VPCOriginEndpointConfigInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCOriginEndpointConfigObservation) DeepCopyInto(out *VPCOriginEndpointConfigObservation) { + *out = *in + if in.Arn != nil { + in, out := &in.Arn, &out.Arn + *out = new(string) + **out = **in + } + if in.HTTPPort != nil { + in, out := &in.HTTPPort, &out.HTTPPort + *out = new(float64) + **out = **in + } + if in.HTTPSPort != nil { + in, out := &in.HTTPSPort, &out.HTTPSPort + *out = new(float64) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.OriginProtocolPolicy != nil { + in, out := &in.OriginProtocolPolicy, &out.OriginProtocolPolicy + *out = new(string) + **out = **in + } + if in.OriginSSLProtocols != nil { + in, out := &in.OriginSSLProtocols, &out.OriginSSLProtocols + *out = make([]OriginSSLProtocolsObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCOriginEndpointConfigObservation. +func (in *VPCOriginEndpointConfigObservation) DeepCopy() *VPCOriginEndpointConfigObservation { + if in == nil { + return nil + } + out := new(VPCOriginEndpointConfigObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCOriginEndpointConfigParameters) DeepCopyInto(out *VPCOriginEndpointConfigParameters) { + *out = *in + if in.Arn != nil { + in, out := &in.Arn, &out.Arn + *out = new(string) + **out = **in + } + if in.ArnRef != nil { + in, out := &in.ArnRef, &out.ArnRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.ArnSelector != nil { + in, out := &in.ArnSelector, &out.ArnSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.HTTPPort != nil { + in, out := &in.HTTPPort, &out.HTTPPort + *out = new(float64) + **out = **in + } + if in.HTTPSPort != nil { + in, out := &in.HTTPSPort, &out.HTTPSPort + *out = new(float64) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.OriginProtocolPolicy != nil { + in, out := &in.OriginProtocolPolicy, &out.OriginProtocolPolicy + *out = new(string) + **out = **in + } + if in.OriginSSLProtocols != nil { + in, out := &in.OriginSSLProtocols, &out.OriginSSLProtocols + *out = make([]OriginSSLProtocolsParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCOriginEndpointConfigParameters. +func (in *VPCOriginEndpointConfigParameters) DeepCopy() *VPCOriginEndpointConfigParameters { + if in == nil { + return nil + } + out := new(VPCOriginEndpointConfigParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCOriginInitParameters) DeepCopyInto(out *VPCOriginInitParameters) { + *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.VPCOriginEndpointConfig != nil { + in, out := &in.VPCOriginEndpointConfig, &out.VPCOriginEndpointConfig + *out = make([]VPCOriginEndpointConfigInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCOriginInitParameters. +func (in *VPCOriginInitParameters) DeepCopy() *VPCOriginInitParameters { + if in == nil { + return nil + } + out := new(VPCOriginInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCOriginList) DeepCopyInto(out *VPCOriginList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]VPCOrigin, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCOriginList. +func (in *VPCOriginList) DeepCopy() *VPCOriginList { + if in == nil { + return nil + } + out := new(VPCOriginList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VPCOriginList) 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 *VPCOriginObservation) DeepCopyInto(out *VPCOriginObservation) { + *out = *in + if in.Arn != nil { + in, out := &in.Arn, &out.Arn + *out = new(string) + **out = **in + } + if in.Etag != nil { + in, out := &in.Etag, &out.Etag + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *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.VPCOriginEndpointConfig != nil { + in, out := &in.VPCOriginEndpointConfig, &out.VPCOriginEndpointConfig + *out = make([]VPCOriginEndpointConfigObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCOriginObservation. +func (in *VPCOriginObservation) DeepCopy() *VPCOriginObservation { + if in == nil { + return nil + } + out := new(VPCOriginObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCOriginParameters) DeepCopyInto(out *VPCOriginParameters) { + *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.VPCOriginEndpointConfig != nil { + in, out := &in.VPCOriginEndpointConfig, &out.VPCOriginEndpointConfig + *out = make([]VPCOriginEndpointConfigParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCOriginParameters. +func (in *VPCOriginParameters) DeepCopy() *VPCOriginParameters { + if in == nil { + return nil + } + out := new(VPCOriginParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCOriginSpec) DeepCopyInto(out *VPCOriginSpec) { + *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 VPCOriginSpec. +func (in *VPCOriginSpec) DeepCopy() *VPCOriginSpec { + if in == nil { + return nil + } + out := new(VPCOriginSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCOriginStatus) DeepCopyInto(out *VPCOriginStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCOriginStatus. +func (in *VPCOriginStatus) DeepCopy() *VPCOriginStatus { + if in == nil { + return nil + } + out := new(VPCOriginStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ViewerCertificateInitParameters) DeepCopyInto(out *ViewerCertificateInitParameters) { *out = *in diff --git a/apis/cluster/cloudfront/v1beta1/zz_generated.managed.go b/apis/cluster/cloudfront/v1beta1/zz_generated.managed.go index 05663edbd9..ceeb955995 100644 --- a/apis/cluster/cloudfront/v1beta1/zz_generated.managed.go +++ b/apis/cluster/cloudfront/v1beta1/zz_generated.managed.go @@ -656,3 +656,53 @@ func (mg *ResponseHeadersPolicy) SetProviderConfigReference(r *xpv1.Reference) { func (mg *ResponseHeadersPolicy) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } + +// GetCondition of this VPCOrigin. +func (mg *VPCOrigin) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this VPCOrigin. +func (mg *VPCOrigin) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this VPCOrigin. +func (mg *VPCOrigin) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this VPCOrigin. +func (mg *VPCOrigin) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetWriteConnectionSecretToReference of this VPCOrigin. +func (mg *VPCOrigin) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this VPCOrigin. +func (mg *VPCOrigin) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this VPCOrigin. +func (mg *VPCOrigin) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this VPCOrigin. +func (mg *VPCOrigin) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this VPCOrigin. +func (mg *VPCOrigin) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetWriteConnectionSecretToReference of this VPCOrigin. +func (mg *VPCOrigin) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} diff --git a/apis/cluster/cloudfront/v1beta1/zz_generated.managedlist.go b/apis/cluster/cloudfront/v1beta1/zz_generated.managedlist.go index 9add5f8828..8b2f19ae2f 100644 --- a/apis/cluster/cloudfront/v1beta1/zz_generated.managedlist.go +++ b/apis/cluster/cloudfront/v1beta1/zz_generated.managedlist.go @@ -123,3 +123,12 @@ func (l *ResponseHeadersPolicyList) GetItems() []resource.Managed { } return items } + +// GetItems of this VPCOriginList. +func (l *VPCOriginList) 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/cluster/cloudfront/v1beta1/zz_generated.resolvers.go b/apis/cluster/cloudfront/v1beta1/zz_generated.resolvers.go index 7d60f15474..5870998319 100644 --- a/apis/cluster/cloudfront/v1beta1/zz_generated.resolvers.go +++ b/apis/cluster/cloudfront/v1beta1/zz_generated.resolvers.go @@ -556,3 +556,60 @@ func (mg *RealtimeLogConfig) ResolveReferences(ctx context.Context, c client.Rea return nil } + +// ResolveReferences of this VPCOrigin. +func (mg *VPCOrigin) ResolveReferences(ctx context.Context, c client.Reader) error { + var m xpresource.Managed + var l xpresource.ManagedList + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + for i3 := 0; i3 < len(mg.Spec.ForProvider.VPCOriginEndpointConfig); i3++ { + { + m, l, err = apisresolver.GetManagedResource("elbv2.aws.upbound.io", "v1beta2", "LB", "LBList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.VPCOriginEndpointConfig[i3].Arn), + Extract: resource.ExtractParamPath("arn", true), + Namespace: mg.GetNamespace(), + Reference: mg.Spec.ForProvider.VPCOriginEndpointConfig[i3].ArnRef, + Selector: mg.Spec.ForProvider.VPCOriginEndpointConfig[i3].ArnSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.VPCOriginEndpointConfig[i3].Arn") + } + mg.Spec.ForProvider.VPCOriginEndpointConfig[i3].Arn = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.VPCOriginEndpointConfig[i3].ArnRef = rsp.ResolvedReference + + } + for i3 := 0; i3 < len(mg.Spec.InitProvider.VPCOriginEndpointConfig); i3++ { + { + m, l, err = apisresolver.GetManagedResource("elbv2.aws.upbound.io", "v1beta2", "LB", "LBList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.VPCOriginEndpointConfig[i3].Arn), + Extract: resource.ExtractParamPath("arn", true), + Namespace: mg.GetNamespace(), + Reference: mg.Spec.InitProvider.VPCOriginEndpointConfig[i3].ArnRef, + Selector: mg.Spec.InitProvider.VPCOriginEndpointConfig[i3].ArnSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.VPCOriginEndpointConfig[i3].Arn") + } + mg.Spec.InitProvider.VPCOriginEndpointConfig[i3].Arn = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.VPCOriginEndpointConfig[i3].ArnRef = rsp.ResolvedReference + + } + + return nil +} diff --git a/apis/cluster/cloudfront/v1beta1/zz_vpcorigin_terraformed.go b/apis/cluster/cloudfront/v1beta1/zz_vpcorigin_terraformed.go new file mode 100755 index 0000000000..496b91bdf9 --- /dev/null +++ b/apis/cluster/cloudfront/v1beta1/zz_vpcorigin_terraformed.go @@ -0,0 +1,129 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1beta1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/v2/pkg/resource" + "github.com/crossplane/upjet/v2/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this VPCOrigin +func (mg *VPCOrigin) GetTerraformResourceType() string { + return "aws_cloudfront_vpc_origin" +} + +// GetConnectionDetailsMapping for this VPCOrigin +func (tr *VPCOrigin) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this VPCOrigin +func (tr *VPCOrigin) 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 VPCOrigin +func (tr *VPCOrigin) 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 VPCOrigin +func (tr *VPCOrigin) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this VPCOrigin +func (tr *VPCOrigin) 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 VPCOrigin +func (tr *VPCOrigin) 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 VPCOrigin +func (tr *VPCOrigin) 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 VPCOrigin +func (tr *VPCOrigin) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource \"%s/%s\"", tr.GetNamespace(), tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource \"%s/%s\"", tr.GetNamespace(), tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource \"%s/%s\"", tr.GetNamespace(), tr.GetName()) + } + + return params, nil +} + +// LateInitialize this VPCOrigin using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *VPCOrigin) LateInitialize(attrs []byte) (bool, error) { + params := &VPCOriginParameters{} + 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 *VPCOrigin) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/cluster/cloudfront/v1beta1/zz_vpcorigin_types.go b/apis/cluster/cloudfront/v1beta1/zz_vpcorigin_types.go new file mode 100755 index 0000000000..79c8b3b9ae --- /dev/null +++ b/apis/cluster/cloudfront/v1beta1/zz_vpcorigin_types.go @@ -0,0 +1,235 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" +) + +type OriginSSLProtocolsInitParameters struct { + + // +listType=set + Items []*string `json:"items,omitempty" tf:"items,omitempty"` + + Quantity *float64 `json:"quantity,omitempty" tf:"quantity,omitempty"` +} + +type OriginSSLProtocolsObservation struct { + + // +listType=set + Items []*string `json:"items,omitempty" tf:"items,omitempty"` + + Quantity *float64 `json:"quantity,omitempty" tf:"quantity,omitempty"` +} + +type OriginSSLProtocolsParameters struct { + + // +kubebuilder:validation:Optional + // +listType=set + Items []*string `json:"items" tf:"items,omitempty"` + + // +kubebuilder:validation:Optional + Quantity *float64 `json:"quantity" tf:"quantity,omitempty"` +} + +type VPCOriginEndpointConfigInitParameters struct { + + // The ARN of the CloudFront VPC origin endpoint configuration. + // +crossplane:generate:reference:type=github.com/upbound/provider-aws/v2/apis/cluster/elbv2/v1beta2.LB + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/v2/pkg/resource.ExtractParamPath("arn",true) + Arn *string `json:"arn,omitempty" tf:"arn,omitempty"` + + // Reference to a LB in elbv2 to populate arn. + // +kubebuilder:validation:Optional + ArnRef *v1.Reference `json:"arnRef,omitempty" tf:"-"` + + // Selector for a LB in elbv2 to populate arn. + // +kubebuilder:validation:Optional + ArnSelector *v1.Selector `json:"arnSelector,omitempty" tf:"-"` + + // The HTTP port for the CloudFront VPC origin endpoint configuration. + HTTPPort *float64 `json:"httpPort,omitempty" tf:"http_port,omitempty"` + + // The HTTPS port for the CloudFront VPC origin endpoint configuration. + HTTPSPort *float64 `json:"httpsPort,omitempty" tf:"https_port,omitempty"` + + // The name of the CloudFront VPC origin endpoint configuration. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // The origin protocol policy for the CloudFront VPC origin endpoint configuration. + OriginProtocolPolicy *string `json:"originProtocolPolicy,omitempty" tf:"origin_protocol_policy,omitempty"` + + // A complex type that contains information about the SSL/TLS protocols that CloudFront can use when establishing an HTTPS connection with your origin. + OriginSSLProtocols []OriginSSLProtocolsInitParameters `json:"originSslProtocols,omitempty" tf:"origin_ssl_protocols,omitempty"` +} + +type VPCOriginEndpointConfigObservation struct { + + // The ARN of the CloudFront VPC origin endpoint configuration. + Arn *string `json:"arn,omitempty" tf:"arn,omitempty"` + + // The HTTP port for the CloudFront VPC origin endpoint configuration. + HTTPPort *float64 `json:"httpPort,omitempty" tf:"http_port,omitempty"` + + // The HTTPS port for the CloudFront VPC origin endpoint configuration. + HTTPSPort *float64 `json:"httpsPort,omitempty" tf:"https_port,omitempty"` + + // The name of the CloudFront VPC origin endpoint configuration. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // The origin protocol policy for the CloudFront VPC origin endpoint configuration. + OriginProtocolPolicy *string `json:"originProtocolPolicy,omitempty" tf:"origin_protocol_policy,omitempty"` + + // A complex type that contains information about the SSL/TLS protocols that CloudFront can use when establishing an HTTPS connection with your origin. + OriginSSLProtocols []OriginSSLProtocolsObservation `json:"originSslProtocols,omitempty" tf:"origin_ssl_protocols,omitempty"` +} + +type VPCOriginEndpointConfigParameters struct { + + // The ARN of the CloudFront VPC origin endpoint configuration. + // +crossplane:generate:reference:type=github.com/upbound/provider-aws/v2/apis/cluster/elbv2/v1beta2.LB + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/v2/pkg/resource.ExtractParamPath("arn",true) + // +kubebuilder:validation:Optional + Arn *string `json:"arn,omitempty" tf:"arn,omitempty"` + + // Reference to a LB in elbv2 to populate arn. + // +kubebuilder:validation:Optional + ArnRef *v1.Reference `json:"arnRef,omitempty" tf:"-"` + + // Selector for a LB in elbv2 to populate arn. + // +kubebuilder:validation:Optional + ArnSelector *v1.Selector `json:"arnSelector,omitempty" tf:"-"` + + // The HTTP port for the CloudFront VPC origin endpoint configuration. + // +kubebuilder:validation:Optional + HTTPPort *float64 `json:"httpPort" tf:"http_port,omitempty"` + + // The HTTPS port for the CloudFront VPC origin endpoint configuration. + // +kubebuilder:validation:Optional + HTTPSPort *float64 `json:"httpsPort" tf:"https_port,omitempty"` + + // The name of the CloudFront VPC origin endpoint configuration. + // +kubebuilder:validation:Optional + Name *string `json:"name" tf:"name,omitempty"` + + // The origin protocol policy for the CloudFront VPC origin endpoint configuration. + // +kubebuilder:validation:Optional + OriginProtocolPolicy *string `json:"originProtocolPolicy" tf:"origin_protocol_policy,omitempty"` + + // A complex type that contains information about the SSL/TLS protocols that CloudFront can use when establishing an HTTPS connection with your origin. + // +kubebuilder:validation:Optional + OriginSSLProtocols []OriginSSLProtocolsParameters `json:"originSslProtocols,omitempty" tf:"origin_ssl_protocols,omitempty"` +} + +type VPCOriginInitParameters struct { + + // Key-value map of resource tags. + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // The VPC origin endpoint configuration. + VPCOriginEndpointConfig []VPCOriginEndpointConfigInitParameters `json:"vpcOriginEndpointConfig,omitempty" tf:"vpc_origin_endpoint_config,omitempty"` +} + +type VPCOriginObservation struct { + + // The ARN of the CloudFront VPC origin endpoint configuration. + Arn *string `json:"arn,omitempty" tf:"arn,omitempty"` + + // The current version of the origin. + Etag *string `json:"etag,omitempty" tf:"etag,omitempty"` + + // The VPC origin ID. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // Key-value map of resource tags. + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block. + // +mapType=granular + TagsAll map[string]*string `json:"tagsAll,omitempty" tf:"tags_all,omitempty"` + + // The VPC origin endpoint configuration. + VPCOriginEndpointConfig []VPCOriginEndpointConfigObservation `json:"vpcOriginEndpointConfig,omitempty" tf:"vpc_origin_endpoint_config,omitempty"` +} + +type VPCOriginParameters struct { + + // Key-value map of resource tags. + // +kubebuilder:validation:Optional + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // The VPC origin endpoint configuration. + // +kubebuilder:validation:Optional + VPCOriginEndpointConfig []VPCOriginEndpointConfigParameters `json:"vpcOriginEndpointConfig,omitempty" tf:"vpc_origin_endpoint_config,omitempty"` +} + +// VPCOriginSpec defines the desired state of VPCOrigin +type VPCOriginSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider VPCOriginParameters `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 VPCOriginInitParameters `json:"initProvider,omitempty"` +} + +// VPCOriginStatus defines the observed state of VPCOrigin. +type VPCOriginStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider VPCOriginObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// VPCOrigin is the Schema for the VPCOrigins API. Provides a CloudFront VPC Origin +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,aws} +type VPCOrigin struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec VPCOriginSpec `json:"spec"` + Status VPCOriginStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// VPCOriginList contains a list of VPCOrigins +type VPCOriginList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []VPCOrigin `json:"items"` +} + +// Repository type metadata. +var ( + VPCOrigin_Kind = "VPCOrigin" + VPCOrigin_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: VPCOrigin_Kind}.String() + VPCOrigin_KindAPIVersion = VPCOrigin_Kind + "." + CRDGroupVersion.String() + VPCOrigin_GroupVersionKind = CRDGroupVersion.WithKind(VPCOrigin_Kind) +) + +func init() { + SchemeBuilder.Register(&VPCOrigin{}, &VPCOriginList{}) +} diff --git a/apis/namespaced/cloudfront/v1beta1/zz_generated.conversion_hubs.go b/apis/namespaced/cloudfront/v1beta1/zz_generated.conversion_hubs.go index 7567db5090..56c43d51fa 100755 --- a/apis/namespaced/cloudfront/v1beta1/zz_generated.conversion_hubs.go +++ b/apis/namespaced/cloudfront/v1beta1/zz_generated.conversion_hubs.go @@ -44,3 +44,6 @@ func (tr *RealtimeLogConfig) Hub() {} // Hub marks this type as a conversion hub. func (tr *ResponseHeadersPolicy) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *VPCOrigin) Hub() {} diff --git a/apis/namespaced/cloudfront/v1beta1/zz_generated.deepcopy.go b/apis/namespaced/cloudfront/v1beta1/zz_generated.deepcopy.go index cf1e6cfa6a..6243cc8b1a 100644 --- a/apis/namespaced/cloudfront/v1beta1/zz_generated.deepcopy.go +++ b/apis/namespaced/cloudfront/v1beta1/zz_generated.deepcopy.go @@ -7733,6 +7733,99 @@ func (in *OriginRequestPolicyStatus) DeepCopy() *OriginRequestPolicyStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OriginSSLProtocolsInitParameters) DeepCopyInto(out *OriginSSLProtocolsInitParameters) { + *out = *in + if in.Items != nil { + in, out := &in.Items, &out.Items + *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.Quantity != nil { + in, out := &in.Quantity, &out.Quantity + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OriginSSLProtocolsInitParameters. +func (in *OriginSSLProtocolsInitParameters) DeepCopy() *OriginSSLProtocolsInitParameters { + if in == nil { + return nil + } + out := new(OriginSSLProtocolsInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OriginSSLProtocolsObservation) DeepCopyInto(out *OriginSSLProtocolsObservation) { + *out = *in + if in.Items != nil { + in, out := &in.Items, &out.Items + *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.Quantity != nil { + in, out := &in.Quantity, &out.Quantity + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OriginSSLProtocolsObservation. +func (in *OriginSSLProtocolsObservation) DeepCopy() *OriginSSLProtocolsObservation { + if in == nil { + return nil + } + out := new(OriginSSLProtocolsObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OriginSSLProtocolsParameters) DeepCopyInto(out *OriginSSLProtocolsParameters) { + *out = *in + if in.Items != nil { + in, out := &in.Items, &out.Items + *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.Quantity != nil { + in, out := &in.Quantity, &out.Quantity + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OriginSSLProtocolsParameters. +func (in *OriginSSLProtocolsParameters) DeepCopy() *OriginSSLProtocolsParameters { + if in == nil { + return nil + } + out := new(OriginSSLProtocolsParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OriginShieldInitParameters) DeepCopyInto(out *OriginShieldInitParameters) { *out = *in @@ -9958,6 +10051,33 @@ func (in *TrustedSignersParameters) DeepCopy() *TrustedSignersParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCOrigin) DeepCopyInto(out *VPCOrigin) { + *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 VPCOrigin. +func (in *VPCOrigin) DeepCopy() *VPCOrigin { + if in == nil { + return nil + } + out := new(VPCOrigin) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VPCOrigin) 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 *VPCOriginConfigInitParameters) DeepCopyInto(out *VPCOriginConfigInitParameters) { *out = *in @@ -10048,6 +10168,379 @@ func (in *VPCOriginConfigParameters) DeepCopy() *VPCOriginConfigParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCOriginEndpointConfigInitParameters) DeepCopyInto(out *VPCOriginEndpointConfigInitParameters) { + *out = *in + if in.Arn != nil { + in, out := &in.Arn, &out.Arn + *out = new(string) + **out = **in + } + if in.ArnRef != nil { + in, out := &in.ArnRef, &out.ArnRef + *out = new(v1.NamespacedReference) + (*in).DeepCopyInto(*out) + } + if in.ArnSelector != nil { + in, out := &in.ArnSelector, &out.ArnSelector + *out = new(v1.NamespacedSelector) + (*in).DeepCopyInto(*out) + } + if in.HTTPPort != nil { + in, out := &in.HTTPPort, &out.HTTPPort + *out = new(float64) + **out = **in + } + if in.HTTPSPort != nil { + in, out := &in.HTTPSPort, &out.HTTPSPort + *out = new(float64) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.OriginProtocolPolicy != nil { + in, out := &in.OriginProtocolPolicy, &out.OriginProtocolPolicy + *out = new(string) + **out = **in + } + if in.OriginSSLProtocols != nil { + in, out := &in.OriginSSLProtocols, &out.OriginSSLProtocols + *out = make([]OriginSSLProtocolsInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCOriginEndpointConfigInitParameters. +func (in *VPCOriginEndpointConfigInitParameters) DeepCopy() *VPCOriginEndpointConfigInitParameters { + if in == nil { + return nil + } + out := new(VPCOriginEndpointConfigInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCOriginEndpointConfigObservation) DeepCopyInto(out *VPCOriginEndpointConfigObservation) { + *out = *in + if in.Arn != nil { + in, out := &in.Arn, &out.Arn + *out = new(string) + **out = **in + } + if in.HTTPPort != nil { + in, out := &in.HTTPPort, &out.HTTPPort + *out = new(float64) + **out = **in + } + if in.HTTPSPort != nil { + in, out := &in.HTTPSPort, &out.HTTPSPort + *out = new(float64) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.OriginProtocolPolicy != nil { + in, out := &in.OriginProtocolPolicy, &out.OriginProtocolPolicy + *out = new(string) + **out = **in + } + if in.OriginSSLProtocols != nil { + in, out := &in.OriginSSLProtocols, &out.OriginSSLProtocols + *out = make([]OriginSSLProtocolsObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCOriginEndpointConfigObservation. +func (in *VPCOriginEndpointConfigObservation) DeepCopy() *VPCOriginEndpointConfigObservation { + if in == nil { + return nil + } + out := new(VPCOriginEndpointConfigObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCOriginEndpointConfigParameters) DeepCopyInto(out *VPCOriginEndpointConfigParameters) { + *out = *in + if in.Arn != nil { + in, out := &in.Arn, &out.Arn + *out = new(string) + **out = **in + } + if in.ArnRef != nil { + in, out := &in.ArnRef, &out.ArnRef + *out = new(v1.NamespacedReference) + (*in).DeepCopyInto(*out) + } + if in.ArnSelector != nil { + in, out := &in.ArnSelector, &out.ArnSelector + *out = new(v1.NamespacedSelector) + (*in).DeepCopyInto(*out) + } + if in.HTTPPort != nil { + in, out := &in.HTTPPort, &out.HTTPPort + *out = new(float64) + **out = **in + } + if in.HTTPSPort != nil { + in, out := &in.HTTPSPort, &out.HTTPSPort + *out = new(float64) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.OriginProtocolPolicy != nil { + in, out := &in.OriginProtocolPolicy, &out.OriginProtocolPolicy + *out = new(string) + **out = **in + } + if in.OriginSSLProtocols != nil { + in, out := &in.OriginSSLProtocols, &out.OriginSSLProtocols + *out = make([]OriginSSLProtocolsParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCOriginEndpointConfigParameters. +func (in *VPCOriginEndpointConfigParameters) DeepCopy() *VPCOriginEndpointConfigParameters { + if in == nil { + return nil + } + out := new(VPCOriginEndpointConfigParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCOriginInitParameters) DeepCopyInto(out *VPCOriginInitParameters) { + *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.VPCOriginEndpointConfig != nil { + in, out := &in.VPCOriginEndpointConfig, &out.VPCOriginEndpointConfig + *out = make([]VPCOriginEndpointConfigInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCOriginInitParameters. +func (in *VPCOriginInitParameters) DeepCopy() *VPCOriginInitParameters { + if in == nil { + return nil + } + out := new(VPCOriginInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCOriginList) DeepCopyInto(out *VPCOriginList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]VPCOrigin, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCOriginList. +func (in *VPCOriginList) DeepCopy() *VPCOriginList { + if in == nil { + return nil + } + out := new(VPCOriginList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VPCOriginList) 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 *VPCOriginObservation) DeepCopyInto(out *VPCOriginObservation) { + *out = *in + if in.Arn != nil { + in, out := &in.Arn, &out.Arn + *out = new(string) + **out = **in + } + if in.Etag != nil { + in, out := &in.Etag, &out.Etag + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *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.VPCOriginEndpointConfig != nil { + in, out := &in.VPCOriginEndpointConfig, &out.VPCOriginEndpointConfig + *out = make([]VPCOriginEndpointConfigObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCOriginObservation. +func (in *VPCOriginObservation) DeepCopy() *VPCOriginObservation { + if in == nil { + return nil + } + out := new(VPCOriginObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCOriginParameters) DeepCopyInto(out *VPCOriginParameters) { + *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.VPCOriginEndpointConfig != nil { + in, out := &in.VPCOriginEndpointConfig, &out.VPCOriginEndpointConfig + *out = make([]VPCOriginEndpointConfigParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCOriginParameters. +func (in *VPCOriginParameters) DeepCopy() *VPCOriginParameters { + if in == nil { + return nil + } + out := new(VPCOriginParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCOriginSpec) DeepCopyInto(out *VPCOriginSpec) { + *out = *in + in.ManagedResourceSpec.DeepCopyInto(&out.ManagedResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) + in.InitProvider.DeepCopyInto(&out.InitProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCOriginSpec. +func (in *VPCOriginSpec) DeepCopy() *VPCOriginSpec { + if in == nil { + return nil + } + out := new(VPCOriginSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCOriginStatus) DeepCopyInto(out *VPCOriginStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCOriginStatus. +func (in *VPCOriginStatus) DeepCopy() *VPCOriginStatus { + if in == nil { + return nil + } + out := new(VPCOriginStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ViewerCertificateInitParameters) DeepCopyInto(out *ViewerCertificateInitParameters) { *out = *in diff --git a/apis/namespaced/cloudfront/v1beta1/zz_generated.managed.go b/apis/namespaced/cloudfront/v1beta1/zz_generated.managed.go index fb04996dcf..07d75731e3 100644 --- a/apis/namespaced/cloudfront/v1beta1/zz_generated.managed.go +++ b/apis/namespaced/cloudfront/v1beta1/zz_generated.managed.go @@ -526,3 +526,43 @@ func (mg *ResponseHeadersPolicy) SetProviderConfigReference(r *xpv1.ProviderConf func (mg *ResponseHeadersPolicy) SetWriteConnectionSecretToReference(r *xpv1.LocalSecretReference) { mg.Spec.WriteConnectionSecretToReference = r } + +// GetCondition of this VPCOrigin. +func (mg *VPCOrigin) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetManagementPolicies of this VPCOrigin. +func (mg *VPCOrigin) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this VPCOrigin. +func (mg *VPCOrigin) GetProviderConfigReference() *xpv1.ProviderConfigReference { + return mg.Spec.ProviderConfigReference +} + +// GetWriteConnectionSecretToReference of this VPCOrigin. +func (mg *VPCOrigin) GetWriteConnectionSecretToReference() *xpv1.LocalSecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this VPCOrigin. +func (mg *VPCOrigin) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetManagementPolicies of this VPCOrigin. +func (mg *VPCOrigin) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this VPCOrigin. +func (mg *VPCOrigin) SetProviderConfigReference(r *xpv1.ProviderConfigReference) { + mg.Spec.ProviderConfigReference = r +} + +// SetWriteConnectionSecretToReference of this VPCOrigin. +func (mg *VPCOrigin) SetWriteConnectionSecretToReference(r *xpv1.LocalSecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} diff --git a/apis/namespaced/cloudfront/v1beta1/zz_generated.managedlist.go b/apis/namespaced/cloudfront/v1beta1/zz_generated.managedlist.go index 9add5f8828..8b2f19ae2f 100644 --- a/apis/namespaced/cloudfront/v1beta1/zz_generated.managedlist.go +++ b/apis/namespaced/cloudfront/v1beta1/zz_generated.managedlist.go @@ -123,3 +123,12 @@ func (l *ResponseHeadersPolicyList) GetItems() []resource.Managed { } return items } + +// GetItems of this VPCOriginList. +func (l *VPCOriginList) 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/namespaced/cloudfront/v1beta1/zz_generated.resolvers.go b/apis/namespaced/cloudfront/v1beta1/zz_generated.resolvers.go index d6c0a353da..700cb5df1a 100644 --- a/apis/namespaced/cloudfront/v1beta1/zz_generated.resolvers.go +++ b/apis/namespaced/cloudfront/v1beta1/zz_generated.resolvers.go @@ -556,3 +556,60 @@ func (mg *RealtimeLogConfig) ResolveReferences(ctx context.Context, c client.Rea return nil } + +// ResolveReferences of this VPCOrigin. +func (mg *VPCOrigin) ResolveReferences(ctx context.Context, c client.Reader) error { + var m xpresource.Managed + var l xpresource.ManagedList + r := reference.NewAPINamespacedResolver(c, mg) + + var rsp reference.NamespacedResolutionResponse + var err error + + for i3 := 0; i3 < len(mg.Spec.ForProvider.VPCOriginEndpointConfig); i3++ { + { + m, l, err = apisresolver.GetManagedResource("elbv2.aws.m.upbound.io", "v1beta1", "LB", "LBList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + rsp, err = r.Resolve(ctx, reference.NamespacedResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.VPCOriginEndpointConfig[i3].Arn), + Extract: resource.ExtractParamPath("arn", true), + Namespace: mg.GetNamespace(), + Reference: mg.Spec.ForProvider.VPCOriginEndpointConfig[i3].ArnRef, + Selector: mg.Spec.ForProvider.VPCOriginEndpointConfig[i3].ArnSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.VPCOriginEndpointConfig[i3].Arn") + } + mg.Spec.ForProvider.VPCOriginEndpointConfig[i3].Arn = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.VPCOriginEndpointConfig[i3].ArnRef = rsp.ResolvedReference + + } + for i3 := 0; i3 < len(mg.Spec.InitProvider.VPCOriginEndpointConfig); i3++ { + { + m, l, err = apisresolver.GetManagedResource("elbv2.aws.m.upbound.io", "v1beta1", "LB", "LBList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + rsp, err = r.Resolve(ctx, reference.NamespacedResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.VPCOriginEndpointConfig[i3].Arn), + Extract: resource.ExtractParamPath("arn", true), + Namespace: mg.GetNamespace(), + Reference: mg.Spec.InitProvider.VPCOriginEndpointConfig[i3].ArnRef, + Selector: mg.Spec.InitProvider.VPCOriginEndpointConfig[i3].ArnSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.VPCOriginEndpointConfig[i3].Arn") + } + mg.Spec.InitProvider.VPCOriginEndpointConfig[i3].Arn = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.VPCOriginEndpointConfig[i3].ArnRef = rsp.ResolvedReference + + } + + return nil +} diff --git a/apis/namespaced/cloudfront/v1beta1/zz_vpcorigin_terraformed.go b/apis/namespaced/cloudfront/v1beta1/zz_vpcorigin_terraformed.go new file mode 100755 index 0000000000..496b91bdf9 --- /dev/null +++ b/apis/namespaced/cloudfront/v1beta1/zz_vpcorigin_terraformed.go @@ -0,0 +1,129 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1beta1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/v2/pkg/resource" + "github.com/crossplane/upjet/v2/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this VPCOrigin +func (mg *VPCOrigin) GetTerraformResourceType() string { + return "aws_cloudfront_vpc_origin" +} + +// GetConnectionDetailsMapping for this VPCOrigin +func (tr *VPCOrigin) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this VPCOrigin +func (tr *VPCOrigin) 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 VPCOrigin +func (tr *VPCOrigin) 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 VPCOrigin +func (tr *VPCOrigin) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this VPCOrigin +func (tr *VPCOrigin) 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 VPCOrigin +func (tr *VPCOrigin) 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 VPCOrigin +func (tr *VPCOrigin) 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 VPCOrigin +func (tr *VPCOrigin) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource \"%s/%s\"", tr.GetNamespace(), tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource \"%s/%s\"", tr.GetNamespace(), tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource \"%s/%s\"", tr.GetNamespace(), tr.GetName()) + } + + return params, nil +} + +// LateInitialize this VPCOrigin using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *VPCOrigin) LateInitialize(attrs []byte) (bool, error) { + params := &VPCOriginParameters{} + 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 *VPCOrigin) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/namespaced/cloudfront/v1beta1/zz_vpcorigin_types.go b/apis/namespaced/cloudfront/v1beta1/zz_vpcorigin_types.go new file mode 100755 index 0000000000..98a6f1e688 --- /dev/null +++ b/apis/namespaced/cloudfront/v1beta1/zz_vpcorigin_types.go @@ -0,0 +1,236 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/v2/apis/common/v1" + v2 "github.com/crossplane/crossplane-runtime/v2/apis/common/v2" +) + +type OriginSSLProtocolsInitParameters struct { + + // +listType=set + Items []*string `json:"items,omitempty" tf:"items,omitempty"` + + Quantity *float64 `json:"quantity,omitempty" tf:"quantity,omitempty"` +} + +type OriginSSLProtocolsObservation struct { + + // +listType=set + Items []*string `json:"items,omitempty" tf:"items,omitempty"` + + Quantity *float64 `json:"quantity,omitempty" tf:"quantity,omitempty"` +} + +type OriginSSLProtocolsParameters struct { + + // +kubebuilder:validation:Optional + // +listType=set + Items []*string `json:"items" tf:"items,omitempty"` + + // +kubebuilder:validation:Optional + Quantity *float64 `json:"quantity" tf:"quantity,omitempty"` +} + +type VPCOriginEndpointConfigInitParameters struct { + + // The ARN of the CloudFront VPC origin endpoint configuration. + // +crossplane:generate:reference:type=github.com/upbound/provider-aws/v2/apis/namespaced/elbv2/v1beta1.LB + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/v2/pkg/resource.ExtractParamPath("arn",true) + Arn *string `json:"arn,omitempty" tf:"arn,omitempty"` + + // Reference to a LB in elbv2 to populate arn. + // +kubebuilder:validation:Optional + ArnRef *v1.NamespacedReference `json:"arnRef,omitempty" tf:"-"` + + // Selector for a LB in elbv2 to populate arn. + // +kubebuilder:validation:Optional + ArnSelector *v1.NamespacedSelector `json:"arnSelector,omitempty" tf:"-"` + + // The HTTP port for the CloudFront VPC origin endpoint configuration. + HTTPPort *float64 `json:"httpPort,omitempty" tf:"http_port,omitempty"` + + // The HTTPS port for the CloudFront VPC origin endpoint configuration. + HTTPSPort *float64 `json:"httpsPort,omitempty" tf:"https_port,omitempty"` + + // The name of the CloudFront VPC origin endpoint configuration. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // The origin protocol policy for the CloudFront VPC origin endpoint configuration. + OriginProtocolPolicy *string `json:"originProtocolPolicy,omitempty" tf:"origin_protocol_policy,omitempty"` + + // A complex type that contains information about the SSL/TLS protocols that CloudFront can use when establishing an HTTPS connection with your origin. + OriginSSLProtocols []OriginSSLProtocolsInitParameters `json:"originSslProtocols,omitempty" tf:"origin_ssl_protocols,omitempty"` +} + +type VPCOriginEndpointConfigObservation struct { + + // The ARN of the CloudFront VPC origin endpoint configuration. + Arn *string `json:"arn,omitempty" tf:"arn,omitempty"` + + // The HTTP port for the CloudFront VPC origin endpoint configuration. + HTTPPort *float64 `json:"httpPort,omitempty" tf:"http_port,omitempty"` + + // The HTTPS port for the CloudFront VPC origin endpoint configuration. + HTTPSPort *float64 `json:"httpsPort,omitempty" tf:"https_port,omitempty"` + + // The name of the CloudFront VPC origin endpoint configuration. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // The origin protocol policy for the CloudFront VPC origin endpoint configuration. + OriginProtocolPolicy *string `json:"originProtocolPolicy,omitempty" tf:"origin_protocol_policy,omitempty"` + + // A complex type that contains information about the SSL/TLS protocols that CloudFront can use when establishing an HTTPS connection with your origin. + OriginSSLProtocols []OriginSSLProtocolsObservation `json:"originSslProtocols,omitempty" tf:"origin_ssl_protocols,omitempty"` +} + +type VPCOriginEndpointConfigParameters struct { + + // The ARN of the CloudFront VPC origin endpoint configuration. + // +crossplane:generate:reference:type=github.com/upbound/provider-aws/v2/apis/namespaced/elbv2/v1beta1.LB + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/v2/pkg/resource.ExtractParamPath("arn",true) + // +kubebuilder:validation:Optional + Arn *string `json:"arn,omitempty" tf:"arn,omitempty"` + + // Reference to a LB in elbv2 to populate arn. + // +kubebuilder:validation:Optional + ArnRef *v1.NamespacedReference `json:"arnRef,omitempty" tf:"-"` + + // Selector for a LB in elbv2 to populate arn. + // +kubebuilder:validation:Optional + ArnSelector *v1.NamespacedSelector `json:"arnSelector,omitempty" tf:"-"` + + // The HTTP port for the CloudFront VPC origin endpoint configuration. + // +kubebuilder:validation:Optional + HTTPPort *float64 `json:"httpPort" tf:"http_port,omitempty"` + + // The HTTPS port for the CloudFront VPC origin endpoint configuration. + // +kubebuilder:validation:Optional + HTTPSPort *float64 `json:"httpsPort" tf:"https_port,omitempty"` + + // The name of the CloudFront VPC origin endpoint configuration. + // +kubebuilder:validation:Optional + Name *string `json:"name" tf:"name,omitempty"` + + // The origin protocol policy for the CloudFront VPC origin endpoint configuration. + // +kubebuilder:validation:Optional + OriginProtocolPolicy *string `json:"originProtocolPolicy" tf:"origin_protocol_policy,omitempty"` + + // A complex type that contains information about the SSL/TLS protocols that CloudFront can use when establishing an HTTPS connection with your origin. + // +kubebuilder:validation:Optional + OriginSSLProtocols []OriginSSLProtocolsParameters `json:"originSslProtocols,omitempty" tf:"origin_ssl_protocols,omitempty"` +} + +type VPCOriginInitParameters struct { + + // Key-value map of resource tags. + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // The VPC origin endpoint configuration. + VPCOriginEndpointConfig []VPCOriginEndpointConfigInitParameters `json:"vpcOriginEndpointConfig,omitempty" tf:"vpc_origin_endpoint_config,omitempty"` +} + +type VPCOriginObservation struct { + + // The ARN of the CloudFront VPC origin endpoint configuration. + Arn *string `json:"arn,omitempty" tf:"arn,omitempty"` + + // The current version of the origin. + Etag *string `json:"etag,omitempty" tf:"etag,omitempty"` + + // The VPC origin ID. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // Key-value map of resource tags. + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block. + // +mapType=granular + TagsAll map[string]*string `json:"tagsAll,omitempty" tf:"tags_all,omitempty"` + + // The VPC origin endpoint configuration. + VPCOriginEndpointConfig []VPCOriginEndpointConfigObservation `json:"vpcOriginEndpointConfig,omitempty" tf:"vpc_origin_endpoint_config,omitempty"` +} + +type VPCOriginParameters struct { + + // Key-value map of resource tags. + // +kubebuilder:validation:Optional + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // The VPC origin endpoint configuration. + // +kubebuilder:validation:Optional + VPCOriginEndpointConfig []VPCOriginEndpointConfigParameters `json:"vpcOriginEndpointConfig,omitempty" tf:"vpc_origin_endpoint_config,omitempty"` +} + +// VPCOriginSpec defines the desired state of VPCOrigin +type VPCOriginSpec struct { + v2.ManagedResourceSpec `json:",inline"` + ForProvider VPCOriginParameters `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 VPCOriginInitParameters `json:"initProvider,omitempty"` +} + +// VPCOriginStatus defines the observed state of VPCOrigin. +type VPCOriginStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider VPCOriginObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// VPCOrigin is the Schema for the VPCOrigins API. Provides a CloudFront VPC Origin +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:scope=Namespaced,categories={crossplane,managed,aws} +type VPCOrigin struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec VPCOriginSpec `json:"spec"` + Status VPCOriginStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// VPCOriginList contains a list of VPCOrigins +type VPCOriginList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []VPCOrigin `json:"items"` +} + +// Repository type metadata. +var ( + VPCOrigin_Kind = "VPCOrigin" + VPCOrigin_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: VPCOrigin_Kind}.String() + VPCOrigin_KindAPIVersion = VPCOrigin_Kind + "." + CRDGroupVersion.String() + VPCOrigin_GroupVersionKind = CRDGroupVersion.WithKind(VPCOrigin_Kind) +) + +func init() { + SchemeBuilder.Register(&VPCOrigin{}, &VPCOriginList{}) +} diff --git a/config/externalname.go b/config/externalname.go index 90f2da5e07..4aaba39d4e 100644 --- a/config/externalname.go +++ b/config/externalname.go @@ -549,6 +549,8 @@ var TerraformPluginSDKExternalNameConfigs = map[string]config.ExternalName{ "aws_cloudfront_realtime_log_config": config.IdentifierFromProvider, // Cloudfront Response Headers Policies can be imported using the id "aws_cloudfront_response_headers_policy": config.IdentifierFromProvider, + // Cloudfront VPC Origin can be imported using the id + "aws_cloudfront_vpc_origin": config.IdentifierFromProvider, // cloudsearch // diff --git a/config/generated.lst b/config/generated.lst index 8a9dbd70c5..55e54efd77 100644 --- a/config/generated.lst +++ b/config/generated.lst @@ -150,6 +150,7 @@ "aws_cloudfront_public_key", "aws_cloudfront_realtime_log_config", "aws_cloudfront_response_headers_policy", +"aws_cloudfront_vpc_origin", "aws_cloudsearch_domain", "aws_cloudsearch_domain_service_access_policy", "aws_cloudtrail", diff --git a/examples-generated/cluster/cloudfront/v1beta1/vpcorigin.yaml b/examples-generated/cluster/cloudfront/v1beta1/vpcorigin.yaml new file mode 100644 index 0000000000..591acb7d3b --- /dev/null +++ b/examples-generated/cluster/cloudfront/v1beta1/vpcorigin.yaml @@ -0,0 +1,27 @@ +# SPDX-FileCopyrightText: 2025 The Crossplane Authors +# +# SPDX-License-Identifier: CC0-1.0 + + +apiVersion: cloudfront.aws.upbound.io/v1beta1 +kind: VPCOrigin +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: alb + name: alb +spec: + forProvider: + vpcOriginEndpointConfig: + - arnSelector: + matchLabels: + testing.upbound.io/example-name: this + httpPort: 8080 + httpsPort: 8443 + name: example-vpc-origin + originProtocolPolicy: https-only + originSslProtocols: + - items: + - TLSv1.2 + quantity: 1 diff --git a/examples-generated/namespaced/cloudfront/v1beta1/vpcorigin.yaml b/examples-generated/namespaced/cloudfront/v1beta1/vpcorigin.yaml new file mode 100644 index 0000000000..adaec1ac11 --- /dev/null +++ b/examples-generated/namespaced/cloudfront/v1beta1/vpcorigin.yaml @@ -0,0 +1,28 @@ +# SPDX-FileCopyrightText: 2025 The Crossplane Authors +# +# SPDX-License-Identifier: CC0-1.0 + + +apiVersion: cloudfront.aws.m.upbound.io/v1beta1 +kind: VPCOrigin +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: alb + name: alb + namespace: upbound-system +spec: + forProvider: + vpcOriginEndpointConfig: + - arnSelector: + matchLabels: + testing.upbound.io/example-name: this + httpPort: 8080 + httpsPort: 8443 + name: example-vpc-origin + originProtocolPolicy: https-only + originSslProtocols: + - items: + - TLSv1.2 + quantity: 1 diff --git a/examples/cloudfront/cluster/v1beta1/vpcorigin.yaml b/examples/cloudfront/cluster/v1beta1/vpcorigin.yaml new file mode 100644 index 0000000000..2e15b05f67 --- /dev/null +++ b/examples/cloudfront/cluster/v1beta1/vpcorigin.yaml @@ -0,0 +1,127 @@ +# SPDX-FileCopyrightText: 2025 The Crossplane Authors +# +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: cloudfront.aws.upbound.io/v1beta1 +kind: VPCOrigin +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: example-with-selector + name: example-with-selector +spec: + forProvider: + arnSelector: + matchLabels: + testing.upbound.io/example-name: example-alb + region: us-west-2 +--- +apiVersion: ec2.aws.upbound.io/v1beta1 +kind: VPC +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: example-vpc + name: example-vpc +spec: + forProvider: + cidrBlock: 172.16.0.0/16 + region: us-west-2 + tags: + Name: example-vpc +--- +apiVersion: ec2.aws.upbound.io/v1beta1 +kind: Subnet +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: example-subnet-a + name: example-subnet-a +spec: + forProvider: + availabilityZone: us-west-2a + cidrBlock: 172.16.0.0/24 + region: us-west-2 + vpcIdSelector: + matchLabels: + testing.upbound.io/example-name: example-vpc +--- +apiVersion: ec2.aws.upbound.io/v1beta1 +kind: Subnet +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: example-subnet-b + name: example-subnet-b +spec: + forProvider: + availabilityZone: us-west-2b + cidrBlock: 172.16.1.0/24 + region: us-west-2 + vpcIdSelector: + matchLabels: + testing.upbound.io/example-name: example-vpc +--- +apiVersion: ec2.aws.upbound.io/v1beta1 +kind: SecurityGroup +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: example-sg + name: example-sg +spec: + forProvider: + description: Security group for ALB + region: us-west-2 + vpcIdSelector: + matchLabels: + testing.upbound.io/example-name: example-vpc +--- +apiVersion: ec2.aws.upbound.io/v1beta1 +kind: SecurityGroupRule +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: example-sg-ingress + name: example-sg-ingress +spec: + forProvider: + type: ingress + fromPort: 80 + toPort: 80 + protocol: tcp + cidrBlocks: + - 0.0.0.0/0 + region: us-west-2 + securityGroupIdSelector: + matchLabels: + testing.upbound.io/example-name: example-sg +--- +apiVersion: elbv2.aws.upbound.io/v1beta1 +kind: LB +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: example-alb + name: example-alb +spec: + forProvider: + region: us-west-2 + loadBalancerType: application + securityGroupSelector: + matchLabels: + testing.upbound.io/example-name: example-sg + subnetMapping: + - subnetIdSelector: + matchLabels: + testing.upbound.io/example-name: example-subnet-b + - subnetIdSelector: + matchLabels: + testing.upbound.io/example-name: example-subnet-a diff --git a/examples/cloudfront/namespaced/v1beta1/vpcorigin.yaml b/examples/cloudfront/namespaced/v1beta1/vpcorigin.yaml new file mode 100644 index 0000000000..9fd413a2b1 --- /dev/null +++ b/examples/cloudfront/namespaced/v1beta1/vpcorigin.yaml @@ -0,0 +1,127 @@ +# SPDX-FileCopyrightText: 2025 The Crossplane Authors +# +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: cloudfront.aws.m.upbound.io/v1beta1 +kind: VPCOrigin +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: example-with-selector + name: example-with-selector +spec: + forProvider: + arnSelector: + matchLabels: + testing.upbound.io/example-name: example-alb + region: us-west-2 +--- +apiVersion: ec2.aws.m.upbound.io/v1beta1 +kind: VPC +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: example-vpc + name: example-vpc +spec: + forProvider: + cidrBlock: 172.16.0.0/16 + region: us-west-2 + tags: + Name: example-vpc +--- +apiVersion: ec2.aws.m.upbound.io/v1beta1 +kind: Subnet +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: example-subnet-a + name: example-subnet-a +spec: + forProvider: + availabilityZone: us-west-2a + cidrBlock: 172.16.0.0/24 + region: us-west-2 + vpcIdSelector: + matchLabels: + testing.upbound.io/example-name: example-vpc +--- +apiVersion: ec2.aws.m.upbound.io/v1beta1 +kind: Subnet +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: example-subnet-b + name: example-subnet-b +spec: + forProvider: + availabilityZone: us-west-2b + cidrBlock: 172.16.1.0/24 + region: us-west-2 + vpcIdSelector: + matchLabels: + testing.upbound.io/example-name: example-vpc +--- +apiVersion: ec2.aws.m.upbound.io/v1beta1 +kind: SecurityGroup +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: example-sg + name: example-sg +spec: + forProvider: + description: Security group for ALB + region: us-west-2 + vpcIdSelector: + matchLabels: + testing.upbound.io/example-name: example-vpc +--- +apiVersion: ec2.aws.m.upbound.io/v1beta1 +kind: SecurityGroupRule +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: example-sg-ingress + name: example-sg-ingress +spec: + forProvider: + type: ingress + fromPort: 80 + toPort: 80 + protocol: tcp + cidrBlocks: + - 0.0.0.0/0 + region: us-west-2 + securityGroupIdSelector: + matchLabels: + testing.upbound.io/example-name: example-sg +--- +apiVersion: elbv2.aws.m.upbound.io/v1beta1 +kind: LB +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: example-alb + name: example-alb +spec: + forProvider: + region: us-west-2 + loadBalancerType: application + securityGroupSelector: + matchLabels: + testing.upbound.io/example-name: example-sg + subnetMapping: + - subnetIdSelector: + matchLabels: + testing.upbound.io/example-name: example-subnet-b + - subnetIdSelector: + matchLabels: + testing.upbound.io/example-name: example-subnet-a diff --git a/internal/controller/cluster/cloudfront/vpcorigin/zz_controller.go b/internal/controller/cluster/cloudfront/vpcorigin/zz_controller.go new file mode 100755 index 0000000000..418a35405b --- /dev/null +++ b/internal/controller/cluster/cloudfront/vpcorigin/zz_controller.go @@ -0,0 +1,103 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package vpcorigin + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/v2/pkg/event" + xpfeature "github.com/crossplane/crossplane-runtime/v2/pkg/feature" + "github.com/crossplane/crossplane-runtime/v2/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + "github.com/crossplane/crossplane-runtime/v2/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/v2/pkg/controller" + "github.com/crossplane/upjet/v2/pkg/controller/handler" + "github.com/crossplane/upjet/v2/pkg/metrics" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1beta1 "github.com/upbound/provider-aws/v2/apis/cluster/cloudfront/v1beta1" + features "github.com/upbound/provider-aws/v2/internal/features" +) + +// SetupGated adds a controller that reconciles VPCOrigin managed resources. +func SetupGated(mgr ctrl.Manager, o tjcontroller.Options) error { + o.Options.Gate.Register(func() { + if err := Setup(mgr, o); err != nil { + mgr.GetLogger().Error(err, "unable to setup reconciler", "gvk", v1beta1.VPCOrigin_GroupVersionKind.String()) + } + }, v1beta1.VPCOrigin_GroupVersionKind) + return nil +} + +// Setup adds a controller that reconciles VPCOrigin managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1beta1.VPCOrigin_GroupVersionKind.String()) + var initializers managed.InitializerChain + for _, i := range o.Provider.Resources["aws_cloudfront_vpc_origin"].InitializerFns { + initializers = append(initializers, i(mgr.GetClient())) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VPCOrigin_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VPCOrigin_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["aws_cloudfront_vpc_origin"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VPCOrigin_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithPollInterval(o.PollInterval), + } + if o.PollJitter != 0 { + opts = append(opts, managed.WithPollJitterHook(o.PollJitter)) + } + if o.Features.Enabled(features.EnableBetaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1beta1.VPCOrigin + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1beta1.VPCOrigin{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.VPCOrigin") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.VPCOriginList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.VPCOriginList") + } + } + + if o.Features.Enabled(xpfeature.EnableAlphaChangeLogs) { + opts = append(opts, managed.WithChangeLogger(o.ChangeLogOptions.ChangeLogger)) + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.VPCOrigin_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1beta1.VPCOrigin{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/cluster/zz_cloudfront_setup.go b/internal/controller/cluster/zz_cloudfront_setup.go index 78ba33a6a0..390b5cd7c2 100755 --- a/internal/controller/cluster/zz_cloudfront_setup.go +++ b/internal/controller/cluster/zz_cloudfront_setup.go @@ -22,6 +22,7 @@ import ( publickey "github.com/upbound/provider-aws/v2/internal/controller/cluster/cloudfront/publickey" realtimelogconfig "github.com/upbound/provider-aws/v2/internal/controller/cluster/cloudfront/realtimelogconfig" responseheaderspolicy "github.com/upbound/provider-aws/v2/internal/controller/cluster/cloudfront/responseheaderspolicy" + vpcorigin "github.com/upbound/provider-aws/v2/internal/controller/cluster/cloudfront/vpcorigin" ) // Setup_cloudfront creates all controllers with the supplied logger and adds them to @@ -41,6 +42,7 @@ func Setup_cloudfront(mgr ctrl.Manager, o controller.Options) error { publickey.Setup, realtimelogconfig.Setup, responseheaderspolicy.Setup, + vpcorigin.Setup, } { if err := setup(mgr, o); err != nil { return err @@ -66,6 +68,7 @@ func SetupGated_cloudfront(mgr ctrl.Manager, o controller.Options) error { publickey.SetupGated, realtimelogconfig.SetupGated, responseheaderspolicy.SetupGated, + vpcorigin.SetupGated, } { if err := setup(mgr, o); err != nil { return err diff --git a/internal/controller/cluster/zz_monolith_setup.go b/internal/controller/cluster/zz_monolith_setup.go index c69bbe9047..65da24efe8 100755 --- a/internal/controller/cluster/zz_monolith_setup.go +++ b/internal/controller/cluster/zz_monolith_setup.go @@ -161,6 +161,7 @@ import ( publickey "github.com/upbound/provider-aws/v2/internal/controller/cluster/cloudfront/publickey" realtimelogconfig "github.com/upbound/provider-aws/v2/internal/controller/cluster/cloudfront/realtimelogconfig" responseheaderspolicy "github.com/upbound/provider-aws/v2/internal/controller/cluster/cloudfront/responseheaderspolicy" + vpcorigin "github.com/upbound/provider-aws/v2/internal/controller/cluster/cloudfront/vpcorigin" domain "github.com/upbound/provider-aws/v2/internal/controller/cluster/cloudsearch/domain" domainserviceaccesspolicy "github.com/upbound/provider-aws/v2/internal/controller/cluster/cloudsearch/domainserviceaccesspolicy" eventdatastore "github.com/upbound/provider-aws/v2/internal/controller/cluster/cloudtrail/eventdatastore" @@ -1148,6 +1149,7 @@ func Setup_monolith(mgr ctrl.Manager, o controller.Options) error { publickey.Setup, realtimelogconfig.Setup, responseheaderspolicy.Setup, + vpcorigin.Setup, domain.Setup, domainserviceaccesspolicy.Setup, eventdatastore.Setup, @@ -2141,6 +2143,7 @@ func SetupGated_monolith(mgr ctrl.Manager, o controller.Options) error { publickey.SetupGated, realtimelogconfig.SetupGated, responseheaderspolicy.SetupGated, + vpcorigin.SetupGated, domain.SetupGated, domainserviceaccesspolicy.SetupGated, eventdatastore.SetupGated, diff --git a/internal/controller/namespaced/cloudfront/vpcorigin/zz_controller.go b/internal/controller/namespaced/cloudfront/vpcorigin/zz_controller.go new file mode 100755 index 0000000000..9fc4845f08 --- /dev/null +++ b/internal/controller/namespaced/cloudfront/vpcorigin/zz_controller.go @@ -0,0 +1,103 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package vpcorigin + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/v2/pkg/event" + xpfeature "github.com/crossplane/crossplane-runtime/v2/pkg/feature" + "github.com/crossplane/crossplane-runtime/v2/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/v2/pkg/resource" + "github.com/crossplane/crossplane-runtime/v2/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/v2/pkg/controller" + "github.com/crossplane/upjet/v2/pkg/controller/handler" + "github.com/crossplane/upjet/v2/pkg/metrics" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1beta1 "github.com/upbound/provider-aws/v2/apis/namespaced/cloudfront/v1beta1" + features "github.com/upbound/provider-aws/v2/internal/features" +) + +// SetupGated adds a controller that reconciles VPCOrigin managed resources. +func SetupGated(mgr ctrl.Manager, o tjcontroller.Options) error { + o.Options.Gate.Register(func() { + if err := Setup(mgr, o); err != nil { + mgr.GetLogger().Error(err, "unable to setup reconciler", "gvk", v1beta1.VPCOrigin_GroupVersionKind.String()) + } + }, v1beta1.VPCOrigin_GroupVersionKind) + return nil +} + +// Setup adds a controller that reconciles VPCOrigin managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1beta1.VPCOrigin_GroupVersionKind.String()) + var initializers managed.InitializerChain + for _, i := range o.Provider.Resources["aws_cloudfront_vpc_origin"].InitializerFns { + initializers = append(initializers, i(mgr.GetClient())) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VPCOrigin_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VPCOrigin_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["aws_cloudfront_vpc_origin"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VPCOrigin_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithPollInterval(o.PollInterval), + } + if o.PollJitter != 0 { + opts = append(opts, managed.WithPollJitterHook(o.PollJitter)) + } + if o.Features.Enabled(features.EnableBetaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1beta1.VPCOrigin + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1beta1.VPCOrigin{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.VPCOrigin") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.VPCOriginList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.VPCOriginList") + } + } + + if o.Features.Enabled(xpfeature.EnableAlphaChangeLogs) { + opts = append(opts, managed.WithChangeLogger(o.ChangeLogOptions.ChangeLogger)) + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.VPCOrigin_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1beta1.VPCOrigin{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/namespaced/zz_cloudfront_setup.go b/internal/controller/namespaced/zz_cloudfront_setup.go index e4e1601771..7ed1861956 100755 --- a/internal/controller/namespaced/zz_cloudfront_setup.go +++ b/internal/controller/namespaced/zz_cloudfront_setup.go @@ -22,6 +22,7 @@ import ( publickey "github.com/upbound/provider-aws/v2/internal/controller/namespaced/cloudfront/publickey" realtimelogconfig "github.com/upbound/provider-aws/v2/internal/controller/namespaced/cloudfront/realtimelogconfig" responseheaderspolicy "github.com/upbound/provider-aws/v2/internal/controller/namespaced/cloudfront/responseheaderspolicy" + vpcorigin "github.com/upbound/provider-aws/v2/internal/controller/namespaced/cloudfront/vpcorigin" ) // Setup_cloudfront creates all controllers with the supplied logger and adds them to @@ -41,6 +42,7 @@ func Setup_cloudfront(mgr ctrl.Manager, o controller.Options) error { publickey.Setup, realtimelogconfig.Setup, responseheaderspolicy.Setup, + vpcorigin.Setup, } { if err := setup(mgr, o); err != nil { return err @@ -66,6 +68,7 @@ func SetupGated_cloudfront(mgr ctrl.Manager, o controller.Options) error { publickey.SetupGated, realtimelogconfig.SetupGated, responseheaderspolicy.SetupGated, + vpcorigin.SetupGated, } { if err := setup(mgr, o); err != nil { return err diff --git a/internal/controller/namespaced/zz_monolith_setup.go b/internal/controller/namespaced/zz_monolith_setup.go index 4917c52f7a..44ea4fcd0b 100755 --- a/internal/controller/namespaced/zz_monolith_setup.go +++ b/internal/controller/namespaced/zz_monolith_setup.go @@ -161,6 +161,7 @@ import ( publickey "github.com/upbound/provider-aws/v2/internal/controller/namespaced/cloudfront/publickey" realtimelogconfig "github.com/upbound/provider-aws/v2/internal/controller/namespaced/cloudfront/realtimelogconfig" responseheaderspolicy "github.com/upbound/provider-aws/v2/internal/controller/namespaced/cloudfront/responseheaderspolicy" + vpcorigin "github.com/upbound/provider-aws/v2/internal/controller/namespaced/cloudfront/vpcorigin" domain "github.com/upbound/provider-aws/v2/internal/controller/namespaced/cloudsearch/domain" domainserviceaccesspolicy "github.com/upbound/provider-aws/v2/internal/controller/namespaced/cloudsearch/domainserviceaccesspolicy" eventdatastore "github.com/upbound/provider-aws/v2/internal/controller/namespaced/cloudtrail/eventdatastore" @@ -1148,6 +1149,7 @@ func Setup_monolith(mgr ctrl.Manager, o controller.Options) error { publickey.Setup, realtimelogconfig.Setup, responseheaderspolicy.Setup, + vpcorigin.Setup, domain.Setup, domainserviceaccesspolicy.Setup, eventdatastore.Setup, @@ -2141,6 +2143,7 @@ func SetupGated_monolith(mgr ctrl.Manager, o controller.Options) error { publickey.SetupGated, realtimelogconfig.SetupGated, responseheaderspolicy.SetupGated, + vpcorigin.SetupGated, domain.SetupGated, domainserviceaccesspolicy.SetupGated, eventdatastore.SetupGated, diff --git a/package/crds/cloudfront.aws.m.upbound.io_vpcorigins.yaml b/package/crds/cloudfront.aws.m.upbound.io_vpcorigins.yaml new file mode 100644 index 0000000000..4aba95e953 --- /dev/null +++ b/package/crds/cloudfront.aws.m.upbound.io_vpcorigins.yaml @@ -0,0 +1,519 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.18.0 + name: vpcorigins.cloudfront.aws.m.upbound.io +spec: + group: cloudfront.aws.m.upbound.io + names: + categories: + - crossplane + - managed + - aws + kind: VPCOrigin + listKind: VPCOriginList + plural: vpcorigins + singular: vpcorigin + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1beta1 + schema: + openAPIV3Schema: + description: VPCOrigin is the Schema for the VPCOrigins API. Provides a CloudFront + VPC Origin + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: VPCOriginSpec defines the desired state of VPCOrigin + properties: + forProvider: + properties: + tags: + additionalProperties: + type: string + description: Key-value map of resource tags. + type: object + x-kubernetes-map-type: granular + vpcOriginEndpointConfig: + description: The VPC origin endpoint configuration. + items: + properties: + arn: + description: The ARN of the CloudFront VPC origin endpoint + configuration. + type: string + arnRef: + description: Reference to a LB in elbv2 to populate arn. + properties: + name: + description: Name of the referenced object. + type: string + namespace: + description: Namespace of the referenced object + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + arnSelector: + description: Selector for a LB in elbv2 to populate arn. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + namespace: + description: Namespace for the selector + type: string + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + httpPort: + description: The HTTP port for the CloudFront VPC origin + endpoint configuration. + type: number + httpsPort: + description: The HTTPS port for the CloudFront VPC origin + endpoint configuration. + type: number + name: + description: The name of the CloudFront VPC origin endpoint + configuration. + type: string + originProtocolPolicy: + description: The origin protocol policy for the CloudFront + VPC origin endpoint configuration. + type: string + originSslProtocols: + description: A complex type that contains information about + the SSL/TLS protocols that CloudFront can use when establishing + an HTTPS connection with your origin. + items: + properties: + items: + items: + type: string + type: array + x-kubernetes-list-type: set + quantity: + type: number + type: object + type: array + type: object + type: array + type: object + initProvider: + description: |- + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + properties: + tags: + additionalProperties: + type: string + description: Key-value map of resource tags. + type: object + x-kubernetes-map-type: granular + vpcOriginEndpointConfig: + description: The VPC origin endpoint configuration. + items: + properties: + arn: + description: The ARN of the CloudFront VPC origin endpoint + configuration. + type: string + arnRef: + description: Reference to a LB in elbv2 to populate arn. + properties: + name: + description: Name of the referenced object. + type: string + namespace: + description: Namespace of the referenced object + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + arnSelector: + description: Selector for a LB in elbv2 to populate arn. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + namespace: + description: Namespace for the selector + type: string + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + httpPort: + description: The HTTP port for the CloudFront VPC origin + endpoint configuration. + type: number + httpsPort: + description: The HTTPS port for the CloudFront VPC origin + endpoint configuration. + type: number + name: + description: The name of the CloudFront VPC origin endpoint + configuration. + type: string + originProtocolPolicy: + description: The origin protocol policy for the CloudFront + VPC origin endpoint configuration. + type: string + originSslProtocols: + description: A complex type that contains information about + the SSL/TLS protocols that CloudFront can use when establishing + an HTTPS connection with your origin. + items: + properties: + items: + items: + type: string + type: array + x-kubernetes-list-type: set + quantity: + type: number + type: object + type: array + type: object + type: array + type: object + managementPolicies: + default: + - '*' + description: |- + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + items: + description: |- + A ManagementAction represents an action that the Crossplane controllers + can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + providerConfigRef: + default: + kind: ClusterProviderConfig + name: default + description: |- + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + properties: + kind: + description: Kind of the referenced object. + type: string + name: + description: Name of the referenced object. + type: string + required: + - kind + - name + type: object + writeConnectionSecretToRef: + description: |- + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + properties: + name: + description: Name of the secret. + type: string + required: + - name + type: object + required: + - forProvider + type: object + status: + description: VPCOriginStatus defines the observed state of VPCOrigin. + properties: + atProvider: + properties: + arn: + description: The ARN of the CloudFront VPC origin endpoint configuration. + type: string + etag: + description: The current version of the origin. + type: string + id: + description: The VPC origin ID. + type: string + tags: + additionalProperties: + type: string + description: Key-value map of resource tags. + type: object + x-kubernetes-map-type: granular + tagsAll: + additionalProperties: + type: string + description: A map of tags assigned to the resource, including + those inherited from the provider default_tags configuration + block. + type: object + x-kubernetes-map-type: granular + vpcOriginEndpointConfig: + description: The VPC origin endpoint configuration. + items: + properties: + arn: + description: The ARN of the CloudFront VPC origin endpoint + configuration. + type: string + httpPort: + description: The HTTP port for the CloudFront VPC origin + endpoint configuration. + type: number + httpsPort: + description: The HTTPS port for the CloudFront VPC origin + endpoint configuration. + type: number + name: + description: The name of the CloudFront VPC origin endpoint + configuration. + type: string + originProtocolPolicy: + description: The origin protocol policy for the CloudFront + VPC origin endpoint configuration. + type: string + originSslProtocols: + description: A complex type that contains information about + the SSL/TLS protocols that CloudFront can use when establishing + an HTTPS connection with your origin. + items: + properties: + items: + items: + type: string + type: array + x-kubernetes-list-type: set + quantity: + type: number + type: object + type: array + type: object + type: array + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/cloudfront.aws.upbound.io_vpcorigins.yaml b/package/crds/cloudfront.aws.upbound.io_vpcorigins.yaml new file mode 100644 index 0000000000..a72f909245 --- /dev/null +++ b/package/crds/cloudfront.aws.upbound.io_vpcorigins.yaml @@ -0,0 +1,549 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.18.0 + name: vpcorigins.cloudfront.aws.upbound.io +spec: + group: cloudfront.aws.upbound.io + names: + categories: + - crossplane + - managed + - aws + kind: VPCOrigin + listKind: VPCOriginList + plural: vpcorigins + singular: vpcorigin + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1beta1 + schema: + openAPIV3Schema: + description: VPCOrigin is the Schema for the VPCOrigins API. Provides a CloudFront + VPC Origin + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: VPCOriginSpec defines the desired state of VPCOrigin + properties: + deletionPolicy: + default: Delete + description: |- + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + tags: + additionalProperties: + type: string + description: Key-value map of resource tags. + type: object + x-kubernetes-map-type: granular + vpcOriginEndpointConfig: + description: The VPC origin endpoint configuration. + items: + properties: + arn: + description: The ARN of the CloudFront VPC origin endpoint + configuration. + type: string + arnRef: + description: Reference to a LB in elbv2 to populate arn. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + arnSelector: + description: Selector for a LB in elbv2 to populate arn. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + httpPort: + description: The HTTP port for the CloudFront VPC origin + endpoint configuration. + type: number + httpsPort: + description: The HTTPS port for the CloudFront VPC origin + endpoint configuration. + type: number + name: + description: The name of the CloudFront VPC origin endpoint + configuration. + type: string + originProtocolPolicy: + description: The origin protocol policy for the CloudFront + VPC origin endpoint configuration. + type: string + originSslProtocols: + description: A complex type that contains information about + the SSL/TLS protocols that CloudFront can use when establishing + an HTTPS connection with your origin. + items: + properties: + items: + items: + type: string + type: array + x-kubernetes-list-type: set + quantity: + type: number + type: object + type: array + type: object + type: array + type: object + initProvider: + description: |- + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + properties: + tags: + additionalProperties: + type: string + description: Key-value map of resource tags. + type: object + x-kubernetes-map-type: granular + vpcOriginEndpointConfig: + description: The VPC origin endpoint configuration. + items: + properties: + arn: + description: The ARN of the CloudFront VPC origin endpoint + configuration. + type: string + arnRef: + description: Reference to a LB in elbv2 to populate arn. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + arnSelector: + description: Selector for a LB in elbv2 to populate arn. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + httpPort: + description: The HTTP port for the CloudFront VPC origin + endpoint configuration. + type: number + httpsPort: + description: The HTTPS port for the CloudFront VPC origin + endpoint configuration. + type: number + name: + description: The name of the CloudFront VPC origin endpoint + configuration. + type: string + originProtocolPolicy: + description: The origin protocol policy for the CloudFront + VPC origin endpoint configuration. + type: string + originSslProtocols: + description: A complex type that contains information about + the SSL/TLS protocols that CloudFront can use when establishing + an HTTPS connection with your origin. + items: + properties: + items: + items: + type: string + type: array + x-kubernetes-list-type: set + quantity: + type: number + type: object + type: array + type: object + type: array + type: object + managementPolicies: + default: + - '*' + description: |- + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + items: + description: |- + A ManagementAction represents an action that the Crossplane controllers + can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + providerConfigRef: + default: + name: default + description: |- + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + writeConnectionSecretToRef: + description: |- + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + status: + description: VPCOriginStatus defines the observed state of VPCOrigin. + properties: + atProvider: + properties: + arn: + description: The ARN of the CloudFront VPC origin endpoint configuration. + type: string + etag: + description: The current version of the origin. + type: string + id: + description: The VPC origin ID. + type: string + tags: + additionalProperties: + type: string + description: Key-value map of resource tags. + type: object + x-kubernetes-map-type: granular + tagsAll: + additionalProperties: + type: string + description: A map of tags assigned to the resource, including + those inherited from the provider default_tags configuration + block. + type: object + x-kubernetes-map-type: granular + vpcOriginEndpointConfig: + description: The VPC origin endpoint configuration. + items: + properties: + arn: + description: The ARN of the CloudFront VPC origin endpoint + configuration. + type: string + httpPort: + description: The HTTP port for the CloudFront VPC origin + endpoint configuration. + type: number + httpsPort: + description: The HTTPS port for the CloudFront VPC origin + endpoint configuration. + type: number + name: + description: The name of the CloudFront VPC origin endpoint + configuration. + type: string + originProtocolPolicy: + description: The origin protocol policy for the CloudFront + VPC origin endpoint configuration. + type: string + originSslProtocols: + description: A complex type that contains information about + the SSL/TLS protocols that CloudFront can use when establishing + an HTTPS connection with your origin. + items: + properties: + items: + items: + type: string + type: array + x-kubernetes-list-type: set + quantity: + type: number + type: object + type: array + type: object + type: array + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} From 420ca4e5ecd2ae29fcd3bfb0dc18231cc421d544 Mon Sep 17 00:00:00 2001 From: Erhan Cagirici Date: Thu, 12 Mar 2026 23:17:41 +0300 Subject: [PATCH 2/8] external-name: use stub value in aws_cloudfront_vpc_origin config Signed-off-by: Erhan Cagirici --- config/externalname.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/externalname.go b/config/externalname.go index 8ce5dda6bb..76bbf04955 100644 --- a/config/externalname.go +++ b/config/externalname.go @@ -576,7 +576,7 @@ var TerraformPluginSDKExternalNameConfigs = map[string]config.ExternalName{ // Cloudfront Response Headers Policies can be imported using the id "aws_cloudfront_response_headers_policy": config.IdentifierFromProvider, // Cloudfront VPC Origin can be imported using the id - "aws_cloudfront_vpc_origin": config.IdentifierFromProvider, + "aws_cloudfront_vpc_origin": identifierFromProviderWithDefaultStub("vo_stub000000000000000000"), // cloudsearch // From 31bdf3540bd1879c1f5b558faf146f057779d163 Mon Sep 17 00:00:00 2001 From: Erhan Cagirici Date: Thu, 12 Mar 2026 23:18:17 +0300 Subject: [PATCH 3/8] manually add singleton list conversion config for aws_cloudfront_vpc_origin Signed-off-by: Erhan Cagirici --- config/cluster/cloudfront/config.go | 5 +++++ config/namespaced/cloudfront/config.go | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/config/cluster/cloudfront/config.go b/config/cluster/cloudfront/config.go index 73f9df930a..349eeb3bdb 100644 --- a/config/cluster/cloudfront/config.go +++ b/config/cluster/cloudfront/config.go @@ -48,4 +48,9 @@ func Configure(p *config.Provider) { //nolint:gocyclo Extractor: common.PathTerraformIDExtractor, } }) + + p.AddResourceConfigurator("aws_cloudfront_vpc_origin", func(r *config.Resource) { + r.AddSingletonListConversion("vpc_origin_endpoint_config", "vpcOriginEndpointConfig") + r.AddSingletonListConversion("vpc_origin_endpoint_config[*].origin_ssl_protocols", "vpcOriginEndpointConfig[*].originSslProtocols") + }) } diff --git a/config/namespaced/cloudfront/config.go b/config/namespaced/cloudfront/config.go index c5aabc9841..e4e0493921 100644 --- a/config/namespaced/cloudfront/config.go +++ b/config/namespaced/cloudfront/config.go @@ -48,4 +48,9 @@ func Configure(p *config.Provider) { //nolint:gocyclo Extractor: common.PathTerraformIDExtractor, } }) + + p.AddResourceConfigurator("aws_cloudfront_vpc_origin", func(r *config.Resource) { + r.AddSingletonListConversion("vpc_origin_endpoint_config", "vpcOriginEndpointConfig") + r.AddSingletonListConversion("vpc_origin_endpoint_config[*].origin_ssl_protocols", "vpcOriginEndpointConfig[*].originSslProtocols") + }) } From 4e74677ae8ffa2a02a6c4d9129488e557f9e798e Mon Sep 17 00:00:00 2001 From: Erhan Cagirici Date: Fri, 13 Mar 2026 00:57:00 +0300 Subject: [PATCH 4/8] make genereate: aws_cloudfront_vpc_origin singleton lists Signed-off-by: Erhan Cagirici --- .../v1beta1/zz_generated.deepcopy.go | 36 +- .../v1beta1/zz_generated.resolvers.go | 28 +- .../cloudfront/v1beta1/zz_vpcorigin_types.go | 12 +- .../v1beta1/zz_generated.deepcopy.go | 36 +- .../v1beta1/zz_generated.resolvers.go | 28 +- .../cloudfront/v1beta1/zz_vpcorigin_types.go | 12 +- .../cluster/cloudfront/v1beta1/vpcorigin.yaml | 4 +- .../cloudfront/v1beta1/vpcorigin.yaml | 4 +- ...loudfront.aws.m.upbound.io_vpcorigins.yaml | 524 +++++++++--------- .../cloudfront.aws.upbound.io_vpcorigins.yaml | 504 ++++++++--------- 10 files changed, 570 insertions(+), 618 deletions(-) diff --git a/apis/cluster/cloudfront/v1beta1/zz_generated.deepcopy.go b/apis/cluster/cloudfront/v1beta1/zz_generated.deepcopy.go index a2be0a514e..9ea4944dd6 100644 --- a/apis/cluster/cloudfront/v1beta1/zz_generated.deepcopy.go +++ b/apis/cluster/cloudfront/v1beta1/zz_generated.deepcopy.go @@ -10759,10 +10759,8 @@ func (in *VPCOriginEndpointConfigInitParameters) DeepCopyInto(out *VPCOriginEndp } if in.OriginSSLProtocols != nil { in, out := &in.OriginSSLProtocols, &out.OriginSSLProtocols - *out = make([]OriginSSLProtocolsInitParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(OriginSSLProtocolsInitParameters) + (*in).DeepCopyInto(*out) } } @@ -10806,10 +10804,8 @@ func (in *VPCOriginEndpointConfigObservation) DeepCopyInto(out *VPCOriginEndpoin } if in.OriginSSLProtocols != nil { in, out := &in.OriginSSLProtocols, &out.OriginSSLProtocols - *out = make([]OriginSSLProtocolsObservation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(OriginSSLProtocolsObservation) + (*in).DeepCopyInto(*out) } } @@ -10863,10 +10859,8 @@ func (in *VPCOriginEndpointConfigParameters) DeepCopyInto(out *VPCOriginEndpoint } if in.OriginSSLProtocols != nil { in, out := &in.OriginSSLProtocols, &out.OriginSSLProtocols - *out = make([]OriginSSLProtocolsParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(OriginSSLProtocolsParameters) + (*in).DeepCopyInto(*out) } } @@ -10901,10 +10895,8 @@ func (in *VPCOriginInitParameters) DeepCopyInto(out *VPCOriginInitParameters) { } if in.VPCOriginEndpointConfig != nil { in, out := &in.VPCOriginEndpointConfig, &out.VPCOriginEndpointConfig - *out = make([]VPCOriginEndpointConfigInitParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(VPCOriginEndpointConfigInitParameters) + (*in).DeepCopyInto(*out) } } @@ -11002,10 +10994,8 @@ func (in *VPCOriginObservation) DeepCopyInto(out *VPCOriginObservation) { } if in.VPCOriginEndpointConfig != nil { in, out := &in.VPCOriginEndpointConfig, &out.VPCOriginEndpointConfig - *out = make([]VPCOriginEndpointConfigObservation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(VPCOriginEndpointConfigObservation) + (*in).DeepCopyInto(*out) } } @@ -11040,10 +11030,8 @@ func (in *VPCOriginParameters) DeepCopyInto(out *VPCOriginParameters) { } if in.VPCOriginEndpointConfig != nil { in, out := &in.VPCOriginEndpointConfig, &out.VPCOriginEndpointConfig - *out = make([]VPCOriginEndpointConfigParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(VPCOriginEndpointConfigParameters) + (*in).DeepCopyInto(*out) } } diff --git a/apis/cluster/cloudfront/v1beta1/zz_generated.resolvers.go b/apis/cluster/cloudfront/v1beta1/zz_generated.resolvers.go index 5870998319..54961dd12d 100644 --- a/apis/cluster/cloudfront/v1beta1/zz_generated.resolvers.go +++ b/apis/cluster/cloudfront/v1beta1/zz_generated.resolvers.go @@ -566,48 +566,48 @@ func (mg *VPCOrigin) ResolveReferences(ctx context.Context, c client.Reader) err var rsp reference.ResolutionResponse var err error - for i3 := 0; i3 < len(mg.Spec.ForProvider.VPCOriginEndpointConfig); i3++ { + if mg.Spec.ForProvider.VPCOriginEndpointConfig != nil { { m, l, err = apisresolver.GetManagedResource("elbv2.aws.upbound.io", "v1beta2", "LB", "LBList") if err != nil { return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") } rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.VPCOriginEndpointConfig[i3].Arn), + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.VPCOriginEndpointConfig.Arn), Extract: resource.ExtractParamPath("arn", true), Namespace: mg.GetNamespace(), - Reference: mg.Spec.ForProvider.VPCOriginEndpointConfig[i3].ArnRef, - Selector: mg.Spec.ForProvider.VPCOriginEndpointConfig[i3].ArnSelector, + Reference: mg.Spec.ForProvider.VPCOriginEndpointConfig.ArnRef, + Selector: mg.Spec.ForProvider.VPCOriginEndpointConfig.ArnSelector, To: reference.To{List: l, Managed: m}, }) } if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.VPCOriginEndpointConfig[i3].Arn") + return errors.Wrap(err, "mg.Spec.ForProvider.VPCOriginEndpointConfig.Arn") } - mg.Spec.ForProvider.VPCOriginEndpointConfig[i3].Arn = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.VPCOriginEndpointConfig[i3].ArnRef = rsp.ResolvedReference + mg.Spec.ForProvider.VPCOriginEndpointConfig.Arn = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.VPCOriginEndpointConfig.ArnRef = rsp.ResolvedReference } - for i3 := 0; i3 < len(mg.Spec.InitProvider.VPCOriginEndpointConfig); i3++ { + if mg.Spec.InitProvider.VPCOriginEndpointConfig != nil { { m, l, err = apisresolver.GetManagedResource("elbv2.aws.upbound.io", "v1beta2", "LB", "LBList") if err != nil { return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") } rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.VPCOriginEndpointConfig[i3].Arn), + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.VPCOriginEndpointConfig.Arn), Extract: resource.ExtractParamPath("arn", true), Namespace: mg.GetNamespace(), - Reference: mg.Spec.InitProvider.VPCOriginEndpointConfig[i3].ArnRef, - Selector: mg.Spec.InitProvider.VPCOriginEndpointConfig[i3].ArnSelector, + Reference: mg.Spec.InitProvider.VPCOriginEndpointConfig.ArnRef, + Selector: mg.Spec.InitProvider.VPCOriginEndpointConfig.ArnSelector, To: reference.To{List: l, Managed: m}, }) } if err != nil { - return errors.Wrap(err, "mg.Spec.InitProvider.VPCOriginEndpointConfig[i3].Arn") + return errors.Wrap(err, "mg.Spec.InitProvider.VPCOriginEndpointConfig.Arn") } - mg.Spec.InitProvider.VPCOriginEndpointConfig[i3].Arn = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.InitProvider.VPCOriginEndpointConfig[i3].ArnRef = rsp.ResolvedReference + mg.Spec.InitProvider.VPCOriginEndpointConfig.Arn = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.VPCOriginEndpointConfig.ArnRef = rsp.ResolvedReference } diff --git a/apis/cluster/cloudfront/v1beta1/zz_vpcorigin_types.go b/apis/cluster/cloudfront/v1beta1/zz_vpcorigin_types.go index 79c8b3b9ae..c74535af06 100755 --- a/apis/cluster/cloudfront/v1beta1/zz_vpcorigin_types.go +++ b/apis/cluster/cloudfront/v1beta1/zz_vpcorigin_types.go @@ -67,7 +67,7 @@ type VPCOriginEndpointConfigInitParameters struct { OriginProtocolPolicy *string `json:"originProtocolPolicy,omitempty" tf:"origin_protocol_policy,omitempty"` // A complex type that contains information about the SSL/TLS protocols that CloudFront can use when establishing an HTTPS connection with your origin. - OriginSSLProtocols []OriginSSLProtocolsInitParameters `json:"originSslProtocols,omitempty" tf:"origin_ssl_protocols,omitempty"` + OriginSSLProtocols *OriginSSLProtocolsInitParameters `json:"originSslProtocols,omitempty" tf:"origin_ssl_protocols,omitempty"` } type VPCOriginEndpointConfigObservation struct { @@ -88,7 +88,7 @@ type VPCOriginEndpointConfigObservation struct { OriginProtocolPolicy *string `json:"originProtocolPolicy,omitempty" tf:"origin_protocol_policy,omitempty"` // A complex type that contains information about the SSL/TLS protocols that CloudFront can use when establishing an HTTPS connection with your origin. - OriginSSLProtocols []OriginSSLProtocolsObservation `json:"originSslProtocols,omitempty" tf:"origin_ssl_protocols,omitempty"` + OriginSSLProtocols *OriginSSLProtocolsObservation `json:"originSslProtocols,omitempty" tf:"origin_ssl_protocols,omitempty"` } type VPCOriginEndpointConfigParameters struct { @@ -125,7 +125,7 @@ type VPCOriginEndpointConfigParameters struct { // A complex type that contains information about the SSL/TLS protocols that CloudFront can use when establishing an HTTPS connection with your origin. // +kubebuilder:validation:Optional - OriginSSLProtocols []OriginSSLProtocolsParameters `json:"originSslProtocols,omitempty" tf:"origin_ssl_protocols,omitempty"` + OriginSSLProtocols *OriginSSLProtocolsParameters `json:"originSslProtocols,omitempty" tf:"origin_ssl_protocols,omitempty"` } type VPCOriginInitParameters struct { @@ -135,7 +135,7 @@ type VPCOriginInitParameters struct { Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` // The VPC origin endpoint configuration. - VPCOriginEndpointConfig []VPCOriginEndpointConfigInitParameters `json:"vpcOriginEndpointConfig,omitempty" tf:"vpc_origin_endpoint_config,omitempty"` + VPCOriginEndpointConfig *VPCOriginEndpointConfigInitParameters `json:"vpcOriginEndpointConfig,omitempty" tf:"vpc_origin_endpoint_config,omitempty"` } type VPCOriginObservation struct { @@ -158,7 +158,7 @@ type VPCOriginObservation struct { TagsAll map[string]*string `json:"tagsAll,omitempty" tf:"tags_all,omitempty"` // The VPC origin endpoint configuration. - VPCOriginEndpointConfig []VPCOriginEndpointConfigObservation `json:"vpcOriginEndpointConfig,omitempty" tf:"vpc_origin_endpoint_config,omitempty"` + VPCOriginEndpointConfig *VPCOriginEndpointConfigObservation `json:"vpcOriginEndpointConfig,omitempty" tf:"vpc_origin_endpoint_config,omitempty"` } type VPCOriginParameters struct { @@ -170,7 +170,7 @@ type VPCOriginParameters struct { // The VPC origin endpoint configuration. // +kubebuilder:validation:Optional - VPCOriginEndpointConfig []VPCOriginEndpointConfigParameters `json:"vpcOriginEndpointConfig,omitempty" tf:"vpc_origin_endpoint_config,omitempty"` + VPCOriginEndpointConfig *VPCOriginEndpointConfigParameters `json:"vpcOriginEndpointConfig,omitempty" tf:"vpc_origin_endpoint_config,omitempty"` } // VPCOriginSpec defines the desired state of VPCOrigin diff --git a/apis/namespaced/cloudfront/v1beta1/zz_generated.deepcopy.go b/apis/namespaced/cloudfront/v1beta1/zz_generated.deepcopy.go index 1129b9f75c..4e96f5ad56 100644 --- a/apis/namespaced/cloudfront/v1beta1/zz_generated.deepcopy.go +++ b/apis/namespaced/cloudfront/v1beta1/zz_generated.deepcopy.go @@ -10423,10 +10423,8 @@ func (in *VPCOriginEndpointConfigInitParameters) DeepCopyInto(out *VPCOriginEndp } if in.OriginSSLProtocols != nil { in, out := &in.OriginSSLProtocols, &out.OriginSSLProtocols - *out = make([]OriginSSLProtocolsInitParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(OriginSSLProtocolsInitParameters) + (*in).DeepCopyInto(*out) } } @@ -10470,10 +10468,8 @@ func (in *VPCOriginEndpointConfigObservation) DeepCopyInto(out *VPCOriginEndpoin } if in.OriginSSLProtocols != nil { in, out := &in.OriginSSLProtocols, &out.OriginSSLProtocols - *out = make([]OriginSSLProtocolsObservation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(OriginSSLProtocolsObservation) + (*in).DeepCopyInto(*out) } } @@ -10527,10 +10523,8 @@ func (in *VPCOriginEndpointConfigParameters) DeepCopyInto(out *VPCOriginEndpoint } if in.OriginSSLProtocols != nil { in, out := &in.OriginSSLProtocols, &out.OriginSSLProtocols - *out = make([]OriginSSLProtocolsParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(OriginSSLProtocolsParameters) + (*in).DeepCopyInto(*out) } } @@ -10565,10 +10559,8 @@ func (in *VPCOriginInitParameters) DeepCopyInto(out *VPCOriginInitParameters) { } if in.VPCOriginEndpointConfig != nil { in, out := &in.VPCOriginEndpointConfig, &out.VPCOriginEndpointConfig - *out = make([]VPCOriginEndpointConfigInitParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(VPCOriginEndpointConfigInitParameters) + (*in).DeepCopyInto(*out) } } @@ -10666,10 +10658,8 @@ func (in *VPCOriginObservation) DeepCopyInto(out *VPCOriginObservation) { } if in.VPCOriginEndpointConfig != nil { in, out := &in.VPCOriginEndpointConfig, &out.VPCOriginEndpointConfig - *out = make([]VPCOriginEndpointConfigObservation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(VPCOriginEndpointConfigObservation) + (*in).DeepCopyInto(*out) } } @@ -10704,10 +10694,8 @@ func (in *VPCOriginParameters) DeepCopyInto(out *VPCOriginParameters) { } if in.VPCOriginEndpointConfig != nil { in, out := &in.VPCOriginEndpointConfig, &out.VPCOriginEndpointConfig - *out = make([]VPCOriginEndpointConfigParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(VPCOriginEndpointConfigParameters) + (*in).DeepCopyInto(*out) } } diff --git a/apis/namespaced/cloudfront/v1beta1/zz_generated.resolvers.go b/apis/namespaced/cloudfront/v1beta1/zz_generated.resolvers.go index 700cb5df1a..7c18ac44a7 100644 --- a/apis/namespaced/cloudfront/v1beta1/zz_generated.resolvers.go +++ b/apis/namespaced/cloudfront/v1beta1/zz_generated.resolvers.go @@ -566,48 +566,48 @@ func (mg *VPCOrigin) ResolveReferences(ctx context.Context, c client.Reader) err var rsp reference.NamespacedResolutionResponse var err error - for i3 := 0; i3 < len(mg.Spec.ForProvider.VPCOriginEndpointConfig); i3++ { + if mg.Spec.ForProvider.VPCOriginEndpointConfig != nil { { m, l, err = apisresolver.GetManagedResource("elbv2.aws.m.upbound.io", "v1beta1", "LB", "LBList") if err != nil { return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") } rsp, err = r.Resolve(ctx, reference.NamespacedResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.VPCOriginEndpointConfig[i3].Arn), + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.VPCOriginEndpointConfig.Arn), Extract: resource.ExtractParamPath("arn", true), Namespace: mg.GetNamespace(), - Reference: mg.Spec.ForProvider.VPCOriginEndpointConfig[i3].ArnRef, - Selector: mg.Spec.ForProvider.VPCOriginEndpointConfig[i3].ArnSelector, + Reference: mg.Spec.ForProvider.VPCOriginEndpointConfig.ArnRef, + Selector: mg.Spec.ForProvider.VPCOriginEndpointConfig.ArnSelector, To: reference.To{List: l, Managed: m}, }) } if err != nil { - return errors.Wrap(err, "mg.Spec.ForProvider.VPCOriginEndpointConfig[i3].Arn") + return errors.Wrap(err, "mg.Spec.ForProvider.VPCOriginEndpointConfig.Arn") } - mg.Spec.ForProvider.VPCOriginEndpointConfig[i3].Arn = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.ForProvider.VPCOriginEndpointConfig[i3].ArnRef = rsp.ResolvedReference + mg.Spec.ForProvider.VPCOriginEndpointConfig.Arn = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.VPCOriginEndpointConfig.ArnRef = rsp.ResolvedReference } - for i3 := 0; i3 < len(mg.Spec.InitProvider.VPCOriginEndpointConfig); i3++ { + if mg.Spec.InitProvider.VPCOriginEndpointConfig != nil { { m, l, err = apisresolver.GetManagedResource("elbv2.aws.m.upbound.io", "v1beta1", "LB", "LBList") if err != nil { return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") } rsp, err = r.Resolve(ctx, reference.NamespacedResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.VPCOriginEndpointConfig[i3].Arn), + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.VPCOriginEndpointConfig.Arn), Extract: resource.ExtractParamPath("arn", true), Namespace: mg.GetNamespace(), - Reference: mg.Spec.InitProvider.VPCOriginEndpointConfig[i3].ArnRef, - Selector: mg.Spec.InitProvider.VPCOriginEndpointConfig[i3].ArnSelector, + Reference: mg.Spec.InitProvider.VPCOriginEndpointConfig.ArnRef, + Selector: mg.Spec.InitProvider.VPCOriginEndpointConfig.ArnSelector, To: reference.To{List: l, Managed: m}, }) } if err != nil { - return errors.Wrap(err, "mg.Spec.InitProvider.VPCOriginEndpointConfig[i3].Arn") + return errors.Wrap(err, "mg.Spec.InitProvider.VPCOriginEndpointConfig.Arn") } - mg.Spec.InitProvider.VPCOriginEndpointConfig[i3].Arn = reference.ToPtrValue(rsp.ResolvedValue) - mg.Spec.InitProvider.VPCOriginEndpointConfig[i3].ArnRef = rsp.ResolvedReference + mg.Spec.InitProvider.VPCOriginEndpointConfig.Arn = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.VPCOriginEndpointConfig.ArnRef = rsp.ResolvedReference } diff --git a/apis/namespaced/cloudfront/v1beta1/zz_vpcorigin_types.go b/apis/namespaced/cloudfront/v1beta1/zz_vpcorigin_types.go index 98a6f1e688..b434375749 100755 --- a/apis/namespaced/cloudfront/v1beta1/zz_vpcorigin_types.go +++ b/apis/namespaced/cloudfront/v1beta1/zz_vpcorigin_types.go @@ -68,7 +68,7 @@ type VPCOriginEndpointConfigInitParameters struct { OriginProtocolPolicy *string `json:"originProtocolPolicy,omitempty" tf:"origin_protocol_policy,omitempty"` // A complex type that contains information about the SSL/TLS protocols that CloudFront can use when establishing an HTTPS connection with your origin. - OriginSSLProtocols []OriginSSLProtocolsInitParameters `json:"originSslProtocols,omitempty" tf:"origin_ssl_protocols,omitempty"` + OriginSSLProtocols *OriginSSLProtocolsInitParameters `json:"originSslProtocols,omitempty" tf:"origin_ssl_protocols,omitempty"` } type VPCOriginEndpointConfigObservation struct { @@ -89,7 +89,7 @@ type VPCOriginEndpointConfigObservation struct { OriginProtocolPolicy *string `json:"originProtocolPolicy,omitempty" tf:"origin_protocol_policy,omitempty"` // A complex type that contains information about the SSL/TLS protocols that CloudFront can use when establishing an HTTPS connection with your origin. - OriginSSLProtocols []OriginSSLProtocolsObservation `json:"originSslProtocols,omitempty" tf:"origin_ssl_protocols,omitempty"` + OriginSSLProtocols *OriginSSLProtocolsObservation `json:"originSslProtocols,omitempty" tf:"origin_ssl_protocols,omitempty"` } type VPCOriginEndpointConfigParameters struct { @@ -126,7 +126,7 @@ type VPCOriginEndpointConfigParameters struct { // A complex type that contains information about the SSL/TLS protocols that CloudFront can use when establishing an HTTPS connection with your origin. // +kubebuilder:validation:Optional - OriginSSLProtocols []OriginSSLProtocolsParameters `json:"originSslProtocols,omitempty" tf:"origin_ssl_protocols,omitempty"` + OriginSSLProtocols *OriginSSLProtocolsParameters `json:"originSslProtocols,omitempty" tf:"origin_ssl_protocols,omitempty"` } type VPCOriginInitParameters struct { @@ -136,7 +136,7 @@ type VPCOriginInitParameters struct { Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` // The VPC origin endpoint configuration. - VPCOriginEndpointConfig []VPCOriginEndpointConfigInitParameters `json:"vpcOriginEndpointConfig,omitempty" tf:"vpc_origin_endpoint_config,omitempty"` + VPCOriginEndpointConfig *VPCOriginEndpointConfigInitParameters `json:"vpcOriginEndpointConfig,omitempty" tf:"vpc_origin_endpoint_config,omitempty"` } type VPCOriginObservation struct { @@ -159,7 +159,7 @@ type VPCOriginObservation struct { TagsAll map[string]*string `json:"tagsAll,omitempty" tf:"tags_all,omitempty"` // The VPC origin endpoint configuration. - VPCOriginEndpointConfig []VPCOriginEndpointConfigObservation `json:"vpcOriginEndpointConfig,omitempty" tf:"vpc_origin_endpoint_config,omitempty"` + VPCOriginEndpointConfig *VPCOriginEndpointConfigObservation `json:"vpcOriginEndpointConfig,omitempty" tf:"vpc_origin_endpoint_config,omitempty"` } type VPCOriginParameters struct { @@ -171,7 +171,7 @@ type VPCOriginParameters struct { // The VPC origin endpoint configuration. // +kubebuilder:validation:Optional - VPCOriginEndpointConfig []VPCOriginEndpointConfigParameters `json:"vpcOriginEndpointConfig,omitempty" tf:"vpc_origin_endpoint_config,omitempty"` + VPCOriginEndpointConfig *VPCOriginEndpointConfigParameters `json:"vpcOriginEndpointConfig,omitempty" tf:"vpc_origin_endpoint_config,omitempty"` } // VPCOriginSpec defines the desired state of VPCOrigin diff --git a/examples-generated/cluster/cloudfront/v1beta1/vpcorigin.yaml b/examples-generated/cluster/cloudfront/v1beta1/vpcorigin.yaml index 591acb7d3b..bff73850a3 100644 --- a/examples-generated/cluster/cloudfront/v1beta1/vpcorigin.yaml +++ b/examples-generated/cluster/cloudfront/v1beta1/vpcorigin.yaml @@ -14,7 +14,7 @@ metadata: spec: forProvider: vpcOriginEndpointConfig: - - arnSelector: + arnSelector: matchLabels: testing.upbound.io/example-name: this httpPort: 8080 @@ -22,6 +22,6 @@ spec: name: example-vpc-origin originProtocolPolicy: https-only originSslProtocols: - - items: + items: - TLSv1.2 quantity: 1 diff --git a/examples-generated/namespaced/cloudfront/v1beta1/vpcorigin.yaml b/examples-generated/namespaced/cloudfront/v1beta1/vpcorigin.yaml index adaec1ac11..bd14f78e8d 100644 --- a/examples-generated/namespaced/cloudfront/v1beta1/vpcorigin.yaml +++ b/examples-generated/namespaced/cloudfront/v1beta1/vpcorigin.yaml @@ -15,7 +15,7 @@ metadata: spec: forProvider: vpcOriginEndpointConfig: - - arnSelector: + arnSelector: matchLabels: testing.upbound.io/example-name: this httpPort: 8080 @@ -23,6 +23,6 @@ spec: name: example-vpc-origin originProtocolPolicy: https-only originSslProtocols: - - items: + items: - TLSv1.2 quantity: 1 diff --git a/package/crds/cloudfront.aws.m.upbound.io_vpcorigins.yaml b/package/crds/cloudfront.aws.m.upbound.io_vpcorigins.yaml index 4aba95e953..c10736b2e1 100644 --- a/package/crds/cloudfront.aws.m.upbound.io_vpcorigins.yaml +++ b/package/crds/cloudfront.aws.m.upbound.io_vpcorigins.yaml @@ -67,125 +67,121 @@ spec: x-kubernetes-map-type: granular vpcOriginEndpointConfig: description: The VPC origin endpoint configuration. - items: - properties: - arn: - description: The ARN of the CloudFront VPC origin endpoint - configuration. - type: string - arnRef: - description: Reference to a LB in elbv2 to populate arn. - properties: - name: - description: Name of the referenced object. - type: string - namespace: - description: Namespace of the referenced object - type: string - policy: - description: Policies for referencing. - properties: - resolution: - default: Required - description: |- - Resolution specifies whether resolution of this reference is required. - The default is 'Required', which means the reconcile will fail if the - reference cannot be resolved. 'Optional' means this reference will be - a no-op if it cannot be resolved. - enum: - - Required - - Optional - type: string - resolve: - description: |- - Resolve specifies when this reference should be resolved. The default - is 'IfNotPresent', which will attempt to resolve the reference only when - the corresponding field is not present. Use 'Always' to resolve the - reference on every reconcile. - enum: - - Always - - IfNotPresent - type: string - type: object - required: - - name - type: object - arnSelector: - description: Selector for a LB in elbv2 to populate arn. - properties: - matchControllerRef: - description: |- - MatchControllerRef ensures an object with the same controller reference - as the selecting object is selected. - type: boolean - matchLabels: - additionalProperties: + properties: + arn: + description: The ARN of the CloudFront VPC origin endpoint + configuration. + type: string + arnRef: + description: Reference to a LB in elbv2 to populate arn. + properties: + name: + description: Name of the referenced object. + type: string + namespace: + description: Namespace of the referenced object + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent type: string - description: MatchLabels ensures an object with matching - labels is selected. - type: object - namespace: - description: Namespace for the selector + type: object + required: + - name + type: object + arnSelector: + description: Selector for a LB in elbv2 to populate arn. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: type: string - policy: - description: Policies for selection. - properties: - resolution: - default: Required - description: |- - Resolution specifies whether resolution of this reference is required. - The default is 'Required', which means the reconcile will fail if the - reference cannot be resolved. 'Optional' means this reference will be - a no-op if it cannot be resolved. - enum: - - Required - - Optional - type: string - resolve: - description: |- - Resolve specifies when this reference should be resolved. The default - is 'IfNotPresent', which will attempt to resolve the reference only when - the corresponding field is not present. Use 'Always' to resolve the - reference on every reconcile. - enum: - - Always - - IfNotPresent - type: string - type: object - type: object - httpPort: - description: The HTTP port for the CloudFront VPC origin - endpoint configuration. - type: number - httpsPort: - description: The HTTPS port for the CloudFront VPC origin - endpoint configuration. - type: number - name: - description: The name of the CloudFront VPC origin endpoint - configuration. - type: string - originProtocolPolicy: - description: The origin protocol policy for the CloudFront - VPC origin endpoint configuration. - type: string - originSslProtocols: - description: A complex type that contains information about - the SSL/TLS protocols that CloudFront can use when establishing - an HTTPS connection with your origin. - items: + description: MatchLabels ensures an object with matching + labels is selected. + type: object + namespace: + description: Namespace for the selector + type: string + policy: + description: Policies for selection. properties: - items: - items: - type: string - type: array - x-kubernetes-list-type: set - quantity: - type: number + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string type: object - type: array - type: object - type: array + type: object + httpPort: + description: The HTTP port for the CloudFront VPC origin endpoint + configuration. + type: number + httpsPort: + description: The HTTPS port for the CloudFront VPC origin + endpoint configuration. + type: number + name: + description: The name of the CloudFront VPC origin endpoint + configuration. + type: string + originProtocolPolicy: + description: The origin protocol policy for the CloudFront + VPC origin endpoint configuration. + type: string + originSslProtocols: + description: A complex type that contains information about + the SSL/TLS protocols that CloudFront can use when establishing + an HTTPS connection with your origin. + properties: + items: + items: + type: string + type: array + x-kubernetes-list-type: set + quantity: + type: number + type: object + type: object type: object initProvider: description: |- @@ -208,125 +204,121 @@ spec: x-kubernetes-map-type: granular vpcOriginEndpointConfig: description: The VPC origin endpoint configuration. - items: - properties: - arn: - description: The ARN of the CloudFront VPC origin endpoint - configuration. - type: string - arnRef: - description: Reference to a LB in elbv2 to populate arn. - properties: - name: - description: Name of the referenced object. - type: string - namespace: - description: Namespace of the referenced object - type: string - policy: - description: Policies for referencing. - properties: - resolution: - default: Required - description: |- - Resolution specifies whether resolution of this reference is required. - The default is 'Required', which means the reconcile will fail if the - reference cannot be resolved. 'Optional' means this reference will be - a no-op if it cannot be resolved. - enum: - - Required - - Optional - type: string - resolve: - description: |- - Resolve specifies when this reference should be resolved. The default - is 'IfNotPresent', which will attempt to resolve the reference only when - the corresponding field is not present. Use 'Always' to resolve the - reference on every reconcile. - enum: - - Always - - IfNotPresent - type: string - type: object - required: - - name - type: object - arnSelector: - description: Selector for a LB in elbv2 to populate arn. - properties: - matchControllerRef: - description: |- - MatchControllerRef ensures an object with the same controller reference - as the selecting object is selected. - type: boolean - matchLabels: - additionalProperties: + properties: + arn: + description: The ARN of the CloudFront VPC origin endpoint + configuration. + type: string + arnRef: + description: Reference to a LB in elbv2 to populate arn. + properties: + name: + description: Name of the referenced object. + type: string + namespace: + description: Namespace of the referenced object + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent type: string - description: MatchLabels ensures an object with matching - labels is selected. - type: object - namespace: - description: Namespace for the selector + type: object + required: + - name + type: object + arnSelector: + description: Selector for a LB in elbv2 to populate arn. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: type: string - policy: - description: Policies for selection. - properties: - resolution: - default: Required - description: |- - Resolution specifies whether resolution of this reference is required. - The default is 'Required', which means the reconcile will fail if the - reference cannot be resolved. 'Optional' means this reference will be - a no-op if it cannot be resolved. - enum: - - Required - - Optional - type: string - resolve: - description: |- - Resolve specifies when this reference should be resolved. The default - is 'IfNotPresent', which will attempt to resolve the reference only when - the corresponding field is not present. Use 'Always' to resolve the - reference on every reconcile. - enum: - - Always - - IfNotPresent - type: string - type: object - type: object - httpPort: - description: The HTTP port for the CloudFront VPC origin - endpoint configuration. - type: number - httpsPort: - description: The HTTPS port for the CloudFront VPC origin - endpoint configuration. - type: number - name: - description: The name of the CloudFront VPC origin endpoint - configuration. - type: string - originProtocolPolicy: - description: The origin protocol policy for the CloudFront - VPC origin endpoint configuration. - type: string - originSslProtocols: - description: A complex type that contains information about - the SSL/TLS protocols that CloudFront can use when establishing - an HTTPS connection with your origin. - items: + description: MatchLabels ensures an object with matching + labels is selected. + type: object + namespace: + description: Namespace for the selector + type: string + policy: + description: Policies for selection. properties: - items: - items: - type: string - type: array - x-kubernetes-list-type: set - quantity: - type: number + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string type: object - type: array - type: object - type: array + type: object + httpPort: + description: The HTTP port for the CloudFront VPC origin endpoint + configuration. + type: number + httpsPort: + description: The HTTPS port for the CloudFront VPC origin + endpoint configuration. + type: number + name: + description: The name of the CloudFront VPC origin endpoint + configuration. + type: string + originProtocolPolicy: + description: The origin protocol policy for the CloudFront + VPC origin endpoint configuration. + type: string + originSslProtocols: + description: A complex type that contains information about + the SSL/TLS protocols that CloudFront can use when establishing + an HTTPS connection with your origin. + properties: + items: + items: + type: string + type: array + x-kubernetes-list-type: set + quantity: + type: number + type: object + type: object type: object managementPolicies: default: @@ -416,45 +408,41 @@ spec: x-kubernetes-map-type: granular vpcOriginEndpointConfig: description: The VPC origin endpoint configuration. - items: - properties: - arn: - description: The ARN of the CloudFront VPC origin endpoint - configuration. - type: string - httpPort: - description: The HTTP port for the CloudFront VPC origin - endpoint configuration. - type: number - httpsPort: - description: The HTTPS port for the CloudFront VPC origin - endpoint configuration. - type: number - name: - description: The name of the CloudFront VPC origin endpoint - configuration. - type: string - originProtocolPolicy: - description: The origin protocol policy for the CloudFront - VPC origin endpoint configuration. - type: string - originSslProtocols: - description: A complex type that contains information about - the SSL/TLS protocols that CloudFront can use when establishing - an HTTPS connection with your origin. + properties: + arn: + description: The ARN of the CloudFront VPC origin endpoint + configuration. + type: string + httpPort: + description: The HTTP port for the CloudFront VPC origin endpoint + configuration. + type: number + httpsPort: + description: The HTTPS port for the CloudFront VPC origin + endpoint configuration. + type: number + name: + description: The name of the CloudFront VPC origin endpoint + configuration. + type: string + originProtocolPolicy: + description: The origin protocol policy for the CloudFront + VPC origin endpoint configuration. + type: string + originSslProtocols: + description: A complex type that contains information about + the SSL/TLS protocols that CloudFront can use when establishing + an HTTPS connection with your origin. + properties: items: - properties: - items: - items: - type: string - type: array - x-kubernetes-list-type: set - quantity: - type: number - type: object - type: array - type: object - type: array + items: + type: string + type: array + x-kubernetes-list-type: set + quantity: + type: number + type: object + type: object type: object conditions: description: Conditions of the resource. diff --git a/package/crds/cloudfront.aws.upbound.io_vpcorigins.yaml b/package/crds/cloudfront.aws.upbound.io_vpcorigins.yaml index a72f909245..4e38998080 100644 --- a/package/crds/cloudfront.aws.upbound.io_vpcorigins.yaml +++ b/package/crds/cloudfront.aws.upbound.io_vpcorigins.yaml @@ -81,119 +81,115 @@ spec: x-kubernetes-map-type: granular vpcOriginEndpointConfig: description: The VPC origin endpoint configuration. - items: - properties: - arn: - description: The ARN of the CloudFront VPC origin endpoint - configuration. - type: string - arnRef: - description: Reference to a LB in elbv2 to populate arn. - properties: - name: - description: Name of the referenced object. - type: string - policy: - description: Policies for referencing. - properties: - resolution: - default: Required - description: |- - Resolution specifies whether resolution of this reference is required. - The default is 'Required', which means the reconcile will fail if the - reference cannot be resolved. 'Optional' means this reference will be - a no-op if it cannot be resolved. - enum: - - Required - - Optional - type: string - resolve: - description: |- - Resolve specifies when this reference should be resolved. The default - is 'IfNotPresent', which will attempt to resolve the reference only when - the corresponding field is not present. Use 'Always' to resolve the - reference on every reconcile. - enum: - - Always - - IfNotPresent - type: string - type: object - required: - - name - type: object - arnSelector: - description: Selector for a LB in elbv2 to populate arn. - properties: - matchControllerRef: - description: |- - MatchControllerRef ensures an object with the same controller reference - as the selecting object is selected. - type: boolean - matchLabels: - additionalProperties: + properties: + arn: + description: The ARN of the CloudFront VPC origin endpoint + configuration. + type: string + arnRef: + description: Reference to a LB in elbv2 to populate arn. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional type: string - description: MatchLabels ensures an object with matching - labels is selected. - type: object - policy: - description: Policies for selection. - properties: - resolution: - default: Required - description: |- - Resolution specifies whether resolution of this reference is required. - The default is 'Required', which means the reconcile will fail if the - reference cannot be resolved. 'Optional' means this reference will be - a no-op if it cannot be resolved. - enum: - - Required - - Optional - type: string - resolve: - description: |- - Resolve specifies when this reference should be resolved. The default - is 'IfNotPresent', which will attempt to resolve the reference only when - the corresponding field is not present. Use 'Always' to resolve the - reference on every reconcile. - enum: - - Always - - IfNotPresent - type: string - type: object - type: object - httpPort: - description: The HTTP port for the CloudFront VPC origin - endpoint configuration. - type: number - httpsPort: - description: The HTTPS port for the CloudFront VPC origin - endpoint configuration. - type: number - name: - description: The name of the CloudFront VPC origin endpoint - configuration. - type: string - originProtocolPolicy: - description: The origin protocol policy for the CloudFront - VPC origin endpoint configuration. - type: string - originSslProtocols: - description: A complex type that contains information about - the SSL/TLS protocols that CloudFront can use when establishing - an HTTPS connection with your origin. - items: + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + arnSelector: + description: Selector for a LB in elbv2 to populate arn. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. properties: - items: - items: - type: string - type: array - x-kubernetes-list-type: set - quantity: - type: number + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string type: object - type: array - type: object - type: array + type: object + httpPort: + description: The HTTP port for the CloudFront VPC origin endpoint + configuration. + type: number + httpsPort: + description: The HTTPS port for the CloudFront VPC origin + endpoint configuration. + type: number + name: + description: The name of the CloudFront VPC origin endpoint + configuration. + type: string + originProtocolPolicy: + description: The origin protocol policy for the CloudFront + VPC origin endpoint configuration. + type: string + originSslProtocols: + description: A complex type that contains information about + the SSL/TLS protocols that CloudFront can use when establishing + an HTTPS connection with your origin. + properties: + items: + items: + type: string + type: array + x-kubernetes-list-type: set + quantity: + type: number + type: object + type: object type: object initProvider: description: |- @@ -216,119 +212,115 @@ spec: x-kubernetes-map-type: granular vpcOriginEndpointConfig: description: The VPC origin endpoint configuration. - items: - properties: - arn: - description: The ARN of the CloudFront VPC origin endpoint - configuration. - type: string - arnRef: - description: Reference to a LB in elbv2 to populate arn. - properties: - name: - description: Name of the referenced object. - type: string - policy: - description: Policies for referencing. - properties: - resolution: - default: Required - description: |- - Resolution specifies whether resolution of this reference is required. - The default is 'Required', which means the reconcile will fail if the - reference cannot be resolved. 'Optional' means this reference will be - a no-op if it cannot be resolved. - enum: - - Required - - Optional - type: string - resolve: - description: |- - Resolve specifies when this reference should be resolved. The default - is 'IfNotPresent', which will attempt to resolve the reference only when - the corresponding field is not present. Use 'Always' to resolve the - reference on every reconcile. - enum: - - Always - - IfNotPresent - type: string - type: object - required: - - name - type: object - arnSelector: - description: Selector for a LB in elbv2 to populate arn. - properties: - matchControllerRef: - description: |- - MatchControllerRef ensures an object with the same controller reference - as the selecting object is selected. - type: boolean - matchLabels: - additionalProperties: + properties: + arn: + description: The ARN of the CloudFront VPC origin endpoint + configuration. + type: string + arnRef: + description: Reference to a LB in elbv2 to populate arn. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional type: string - description: MatchLabels ensures an object with matching - labels is selected. - type: object - policy: - description: Policies for selection. - properties: - resolution: - default: Required - description: |- - Resolution specifies whether resolution of this reference is required. - The default is 'Required', which means the reconcile will fail if the - reference cannot be resolved. 'Optional' means this reference will be - a no-op if it cannot be resolved. - enum: - - Required - - Optional - type: string - resolve: - description: |- - Resolve specifies when this reference should be resolved. The default - is 'IfNotPresent', which will attempt to resolve the reference only when - the corresponding field is not present. Use 'Always' to resolve the - reference on every reconcile. - enum: - - Always - - IfNotPresent - type: string - type: object - type: object - httpPort: - description: The HTTP port for the CloudFront VPC origin - endpoint configuration. - type: number - httpsPort: - description: The HTTPS port for the CloudFront VPC origin - endpoint configuration. - type: number - name: - description: The name of the CloudFront VPC origin endpoint - configuration. - type: string - originProtocolPolicy: - description: The origin protocol policy for the CloudFront - VPC origin endpoint configuration. - type: string - originSslProtocols: - description: A complex type that contains information about - the SSL/TLS protocols that CloudFront can use when establishing - an HTTPS connection with your origin. - items: + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + arnSelector: + description: Selector for a LB in elbv2 to populate arn. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. properties: - items: - items: - type: string - type: array - x-kubernetes-list-type: set - quantity: - type: number + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string type: object - type: array - type: object - type: array + type: object + httpPort: + description: The HTTP port for the CloudFront VPC origin endpoint + configuration. + type: number + httpsPort: + description: The HTTPS port for the CloudFront VPC origin + endpoint configuration. + type: number + name: + description: The name of the CloudFront VPC origin endpoint + configuration. + type: string + originProtocolPolicy: + description: The origin protocol policy for the CloudFront + VPC origin endpoint configuration. + type: string + originSslProtocols: + description: A complex type that contains information about + the SSL/TLS protocols that CloudFront can use when establishing + an HTTPS connection with your origin. + properties: + items: + items: + type: string + type: array + x-kubernetes-list-type: set + quantity: + type: number + type: object + type: object type: object managementPolicies: default: @@ -446,45 +438,41 @@ spec: x-kubernetes-map-type: granular vpcOriginEndpointConfig: description: The VPC origin endpoint configuration. - items: - properties: - arn: - description: The ARN of the CloudFront VPC origin endpoint - configuration. - type: string - httpPort: - description: The HTTP port for the CloudFront VPC origin - endpoint configuration. - type: number - httpsPort: - description: The HTTPS port for the CloudFront VPC origin - endpoint configuration. - type: number - name: - description: The name of the CloudFront VPC origin endpoint - configuration. - type: string - originProtocolPolicy: - description: The origin protocol policy for the CloudFront - VPC origin endpoint configuration. - type: string - originSslProtocols: - description: A complex type that contains information about - the SSL/TLS protocols that CloudFront can use when establishing - an HTTPS connection with your origin. + properties: + arn: + description: The ARN of the CloudFront VPC origin endpoint + configuration. + type: string + httpPort: + description: The HTTP port for the CloudFront VPC origin endpoint + configuration. + type: number + httpsPort: + description: The HTTPS port for the CloudFront VPC origin + endpoint configuration. + type: number + name: + description: The name of the CloudFront VPC origin endpoint + configuration. + type: string + originProtocolPolicy: + description: The origin protocol policy for the CloudFront + VPC origin endpoint configuration. + type: string + originSslProtocols: + description: A complex type that contains information about + the SSL/TLS protocols that CloudFront can use when establishing + an HTTPS connection with your origin. + properties: items: - properties: - items: - items: - type: string - type: array - x-kubernetes-list-type: set - quantity: - type: number - type: object - type: array - type: object - type: array + items: + type: string + type: array + x-kubernetes-list-type: set + quantity: + type: number + type: object + type: object type: object conditions: description: Conditions of the resource. From f9c78eca852ab7af4779c554c50ce41a66897c3c Mon Sep 17 00:00:00 2001 From: Erhan Cagirici Date: Fri, 13 Mar 2026 00:58:20 +0300 Subject: [PATCH 5/8] examples: VPCOrigin.cloudfront singleton list converted Signed-off-by: Erhan Cagirici --- .../cloudfront/cluster/v1beta1/vpcorigin.yaml | 15 ++++++++---- .../namespaced/v1beta1/vpcorigin.yaml | 24 +++++++++++++++---- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/examples/cloudfront/cluster/v1beta1/vpcorigin.yaml b/examples/cloudfront/cluster/v1beta1/vpcorigin.yaml index 2e15b05f67..6b2adefab8 100644 --- a/examples/cloudfront/cluster/v1beta1/vpcorigin.yaml +++ b/examples/cloudfront/cluster/v1beta1/vpcorigin.yaml @@ -12,10 +12,17 @@ metadata: name: example-with-selector spec: forProvider: - arnSelector: - matchLabels: - testing.upbound.io/example-name: example-alb - region: us-west-2 + vpcOriginEndpointConfig: + name: example-vpc-origin-xp + arnSelector: + matchLabels: + testing.upbound.io/example-name: example-alb + httpPort: 8080 + httpsPort: 8443 + originProtocolPolicy: "https-only" + originSslProtocols: + items: ["TLSv1.2"] + quantity: 1 --- apiVersion: ec2.aws.upbound.io/v1beta1 kind: VPC diff --git a/examples/cloudfront/namespaced/v1beta1/vpcorigin.yaml b/examples/cloudfront/namespaced/v1beta1/vpcorigin.yaml index 9fd413a2b1..9fd0d74491 100644 --- a/examples/cloudfront/namespaced/v1beta1/vpcorigin.yaml +++ b/examples/cloudfront/namespaced/v1beta1/vpcorigin.yaml @@ -8,14 +8,22 @@ metadata: annotations: meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin labels: - testing.upbound.io/example-name: example-with-selector + testing.upbound.io/example-name: example-vpcorigin name: example-with-selector + namespace: upbound-system spec: forProvider: - arnSelector: - matchLabels: - testing.upbound.io/example-name: example-alb - region: us-west-2 + vpcOriginEndpointConfig: + name: example-vpc-origin-xp + arnSelector: + matchLabels: + testing.upbound.io/example-name: example-alb + httpPort: 8080 + httpsPort: 8443 + originProtocolPolicy: "https-only" + originSslProtocols: + items: [ "TLSv1.2" ] + quantity: 1 --- apiVersion: ec2.aws.m.upbound.io/v1beta1 kind: VPC @@ -25,6 +33,7 @@ metadata: labels: testing.upbound.io/example-name: example-vpc name: example-vpc + namespace: upbound-system spec: forProvider: cidrBlock: 172.16.0.0/16 @@ -40,6 +49,7 @@ metadata: labels: testing.upbound.io/example-name: example-subnet-a name: example-subnet-a + namespace: upbound-system spec: forProvider: availabilityZone: us-west-2a @@ -57,6 +67,7 @@ metadata: labels: testing.upbound.io/example-name: example-subnet-b name: example-subnet-b + namespace: upbound-system spec: forProvider: availabilityZone: us-west-2b @@ -74,6 +85,7 @@ metadata: labels: testing.upbound.io/example-name: example-sg name: example-sg + namespace: upbound-system spec: forProvider: description: Security group for ALB @@ -90,6 +102,7 @@ metadata: labels: testing.upbound.io/example-name: example-sg-ingress name: example-sg-ingress + namespace: upbound-system spec: forProvider: type: ingress @@ -111,6 +124,7 @@ metadata: labels: testing.upbound.io/example-name: example-alb name: example-alb + namespace: upbound-system spec: forProvider: region: us-west-2 From 8eb97186921ab21400d299b7df0059975e751c37 Mon Sep 17 00:00:00 2001 From: Erhan Cagirici Date: Fri, 13 Mar 2026 01:05:18 +0300 Subject: [PATCH 6/8] examples: fix cloudfront broken examples Signed-off-by: Erhan Cagirici --- .../v1beta1/fieldlevelencryptionprofile.yaml | 4 +- .../namespaced/v1beta1/publickey.yaml | 40 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/examples/cloudfront/cluster/v1beta1/fieldlevelencryptionprofile.yaml b/examples/cloudfront/cluster/v1beta1/fieldlevelencryptionprofile.yaml index 1c2eeefcbe..d8e4e0a210 100644 --- a/examples/cloudfront/cluster/v1beta1/fieldlevelencryptionprofile.yaml +++ b/examples/cloudfront/cluster/v1beta1/fieldlevelencryptionprofile.yaml @@ -14,9 +14,9 @@ spec: forProvider: comment: test comment encryptionEntities: - items: + - items: - fieldPatterns: - items: + - items: - DateOfBirth providerId: testprovider publicKeyIdSelector: diff --git a/examples/cloudfront/namespaced/v1beta1/publickey.yaml b/examples/cloudfront/namespaced/v1beta1/publickey.yaml index 1b7edbebfc..665fad39ed 100644 --- a/examples/cloudfront/namespaced/v1beta1/publickey.yaml +++ b/examples/cloudfront/namespaced/v1beta1/publickey.yaml @@ -60,14 +60,14 @@ spec: forProvider: comment: test comment encryptionEntities: - - items: - - fieldPatterns: - - items: - - DateOfBirth - providerId: testprovider - publicKeyIdSelector: - matchLabels: - testing.upbound.io/example-name: publickey + items: + - fieldPatterns: + items: + - DateOfBirth + providerId: testprovider + publicKeyIdSelector: + matchLabels: + testing.upbound.io/example-name: publickey name: ${Rand.RFC1123Subdomain} --- apiVersion: cloudfront.aws.m.upbound.io/v1beta1 @@ -81,16 +81,16 @@ spec: forProvider: comment: test comment contentTypeProfileConfig: - - contentTypeProfiles: - - items: - - contentType: application/x-www-form-urlencoded - format: URLEncoded - forwardWhenContentTypeIsUnknown: true + contentTypeProfiles: + items: + - contentType: application/x-www-form-urlencoded + format: URLEncoded + forwardWhenContentTypeIsUnknown: true queryArgProfileConfig: - - forwardWhenQueryArgProfileIsUnknown: true - queryArgProfiles: - - items: - - profileIdSelector: - matchLabels: - testing.upbound.io/example-name: publickey - queryArg: Arg1 + forwardWhenQueryArgProfileIsUnknown: true + queryArgProfiles: + items: + - profileIdSelector: + matchLabels: + testing.upbound.io/example-name: publickey + queryArg: Arg1 From 11e9ad616f52605ed42cb387a2973eb42fc42b7f Mon Sep 17 00:00:00 2001 From: Erhan Cagirici Date: Fri, 13 Mar 2026 02:06:22 +0300 Subject: [PATCH 7/8] move aws_cloudfront_vpc_origin externalname config into plugin framework configs Signed-off-by: Erhan Cagirici --- config/externalname.go | 7 +++++-- .../cluster/cloudfront/vpcorigin/zz_controller.go | 12 ++++++------ .../namespaced/cloudfront/vpcorigin/zz_controller.go | 12 ++++++------ 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/config/externalname.go b/config/externalname.go index 76bbf04955..c5c2e32b1f 100644 --- a/config/externalname.go +++ b/config/externalname.go @@ -74,6 +74,11 @@ var TerraformPluginFrameworkExternalNameConfigs = map[string]config.ExternalName // us-west-2_abc123/3ho4ek12345678909nh3fmhpko "aws_cognito_user_pool_client": cognitoUserPoolClient(), + // cloudfront + // + // Cloudfront VPC Origin can be imported using the ID + "aws_cloudfront_vpc_origin": identifierFromProviderWithDefaultStub("vo_stub000000000000000000"), + // dsql // // DSQL Cluster can be imported using the identifier @@ -575,8 +580,6 @@ var TerraformPluginSDKExternalNameConfigs = map[string]config.ExternalName{ "aws_cloudfront_realtime_log_config": config.IdentifierFromProvider, // Cloudfront Response Headers Policies can be imported using the id "aws_cloudfront_response_headers_policy": config.IdentifierFromProvider, - // Cloudfront VPC Origin can be imported using the id - "aws_cloudfront_vpc_origin": identifierFromProviderWithDefaultStub("vo_stub000000000000000000"), // cloudsearch // diff --git a/internal/controller/cluster/cloudfront/vpcorigin/zz_controller.go b/internal/controller/cluster/cloudfront/vpcorigin/zz_controller.go index 418a35405b..fcacd0726c 100755 --- a/internal/controller/cluster/cloudfront/vpcorigin/zz_controller.go +++ b/internal/controller/cluster/cloudfront/vpcorigin/zz_controller.go @@ -46,12 +46,12 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VPCOrigin_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( - tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["aws_cloudfront_vpc_origin"], - tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), - tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), - tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VPCOrigin_GroupVersionKind, mgr, o.PollInterval)), - tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + tjcontroller.NewTerraformPluginFrameworkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["aws_cloudfront_vpc_origin"], + tjcontroller.WithTerraformPluginFrameworkAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginFrameworkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginFrameworkAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginFrameworkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VPCOrigin_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginFrameworkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), diff --git a/internal/controller/namespaced/cloudfront/vpcorigin/zz_controller.go b/internal/controller/namespaced/cloudfront/vpcorigin/zz_controller.go index 9fc4845f08..02ccf9f768 100755 --- a/internal/controller/namespaced/cloudfront/vpcorigin/zz_controller.go +++ b/internal/controller/namespaced/cloudfront/vpcorigin/zz_controller.go @@ -46,12 +46,12 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VPCOrigin_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( - tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["aws_cloudfront_vpc_origin"], - tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), - tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), - tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VPCOrigin_GroupVersionKind, mgr, o.PollInterval)), - tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + tjcontroller.NewTerraformPluginFrameworkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["aws_cloudfront_vpc_origin"], + tjcontroller.WithTerraformPluginFrameworkAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginFrameworkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginFrameworkAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginFrameworkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VPCOrigin_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginFrameworkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), From 68d8fcb2f60b3f3d053e8f2ff80e32a26e0898d8 Mon Sep 17 00:00:00 2001 From: Erhan Cagirici Date: Fri, 13 Mar 2026 04:08:28 +0300 Subject: [PATCH 8/8] examples: fix VPCOrigin.cloudfront manifests Signed-off-by: Erhan Cagirici --- .../cloudfront/cluster/v1beta1/vpcorigin.yaml | 94 +++++++++++++++++- .../namespaced/v1beta1/vpcorigin.yaml | 97 ++++++++++++++++++- 2 files changed, 188 insertions(+), 3 deletions(-) diff --git a/examples/cloudfront/cluster/v1beta1/vpcorigin.yaml b/examples/cloudfront/cluster/v1beta1/vpcorigin.yaml index 6b2adefab8..14dc19c033 100644 --- a/examples/cloudfront/cluster/v1beta1/vpcorigin.yaml +++ b/examples/cloudfront/cluster/v1beta1/vpcorigin.yaml @@ -8,7 +8,7 @@ metadata: annotations: meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin labels: - testing.upbound.io/example-name: example-with-selector + testing.upbound.io/example-name: example-vpcorigin name: example-with-selector spec: forProvider: @@ -21,7 +21,8 @@ spec: httpsPort: 8443 originProtocolPolicy: "https-only" originSslProtocols: - items: ["TLSv1.2"] + items: + - "TLSv1.2" quantity: 1 --- apiVersion: ec2.aws.upbound.io/v1beta1 @@ -110,6 +111,95 @@ spec: matchLabels: testing.upbound.io/example-name: example-sg --- +apiVersion: ec2.aws.upbound.io/v1beta1 +kind: InternetGateway +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: example-igw + name: example-igw +spec: + forProvider: + vpcIdSelector: + matchLabels: + testing.upbound.io/example-name: example-vpc + region: us-west-2 + tags: + Name: example-igw +--- +apiVersion: ec2.aws.upbound.io/v1beta2 +kind: Route +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: example-rt + name: example-route +spec: + forProvider: + destinationCidrBlock: "0.0.0.0/0" + routeTableIdSelector: + matchLabels: + testing.upbound.io/example-name: example-rt + gatewayIdSelector: + matchLabels: + testing.upbound.io/example-name: example-igw + region: us-west-2 +--- +apiVersion: ec2.aws.upbound.io/v1beta1 +kind: RouteTable +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: example-rt + name: example-rt +spec: + forProvider: + vpcIdSelector: + matchLabels: + testing.upbound.io/example-name: example-vpc + region: us-west-2 + tags: + Name: example-rt +--- +apiVersion: ec2.aws.upbound.io/v1beta1 +kind: RouteTableAssociation +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: example-rta-a + name: example-rta-a +spec: + forProvider: + subnetIdSelector: + matchLabels: + testing.upbound.io/example-name: example-subnet-a + routeTableIdSelector: + matchLabels: + testing.upbound.io/example-name: example-rt + region: us-west-2 +--- +apiVersion: ec2.aws.upbound.io/v1beta1 +kind: RouteTableAssociation +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: example-rta-b + name: example-rta-b +spec: + forProvider: + subnetIdSelector: + matchLabels: + testing.upbound.io/example-name: example-subnet-b + routeTableIdSelector: + matchLabels: + testing.upbound.io/example-name: example-rt + region: us-west-2 +--- apiVersion: elbv2.aws.upbound.io/v1beta1 kind: LB metadata: diff --git a/examples/cloudfront/namespaced/v1beta1/vpcorigin.yaml b/examples/cloudfront/namespaced/v1beta1/vpcorigin.yaml index 9fd0d74491..31a30aeba7 100644 --- a/examples/cloudfront/namespaced/v1beta1/vpcorigin.yaml +++ b/examples/cloudfront/namespaced/v1beta1/vpcorigin.yaml @@ -22,7 +22,8 @@ spec: httpsPort: 8443 originProtocolPolicy: "https-only" originSslProtocols: - items: [ "TLSv1.2" ] + items: + - "TLSv1.2" quantity: 1 --- apiVersion: ec2.aws.m.upbound.io/v1beta1 @@ -116,6 +117,100 @@ spec: matchLabels: testing.upbound.io/example-name: example-sg --- +apiVersion: ec2.aws.m.upbound.io/v1beta1 +kind: InternetGateway +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: example-igw + name: example-igw + namespace: upbound-system +spec: + forProvider: + vpcIdSelector: + matchLabels: + testing.upbound.io/example-name: example-vpc + region: us-west-2 + tags: + Name: example-igw +--- +apiVersion: ec2.aws.m.upbound.io/v1beta1 +kind: Route +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: example-rt + name: example-route + namespace: upbound-system +spec: + forProvider: + destinationCidrBlock: "0.0.0.0/0" + routeTableIdSelector: + matchLabels: + testing.upbound.io/example-name: example-rt + gatewayIdSelector: + matchLabels: + testing.upbound.io/example-name: example-igw + region: us-west-2 +--- +apiVersion: ec2.aws.m.upbound.io/v1beta1 +kind: RouteTable +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: example-rt + name: example-rt + namespace: upbound-system +spec: + forProvider: + vpcIdSelector: + matchLabels: + testing.upbound.io/example-name: example-vpc + region: us-west-2 + tags: + Name: example-rt +--- +apiVersion: ec2.aws.m.upbound.io/v1beta1 +kind: RouteTableAssociation +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: example-rta-a + name: example-rta-a + namespace: upbound-system +spec: + forProvider: + subnetIdSelector: + matchLabels: + testing.upbound.io/example-name: example-subnet-a + routeTableIdSelector: + matchLabels: + testing.upbound.io/example-name: example-rt + region: us-west-2 +--- +apiVersion: ec2.aws.m.upbound.io/v1beta1 +kind: RouteTableAssociation +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: example-rta-b + name: example-rta-b + namespace: upbound-system +spec: + forProvider: + subnetIdSelector: + matchLabels: + testing.upbound.io/example-name: example-subnet-b + routeTableIdSelector: + matchLabels: + testing.upbound.io/example-name: example-rt + region: us-west-2 +--- apiVersion: elbv2.aws.m.upbound.io/v1beta1 kind: LB metadata: