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 d3ef281a4f..9ea4944dd6 100644 --- a/apis/cluster/cloudfront/v1beta1/zz_generated.deepcopy.go +++ b/apis/cluster/cloudfront/v1beta1/zz_generated.deepcopy.go @@ -8071,6 +8071,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 @@ -10494,6 +10587,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 @@ -10599,6 +10719,367 @@ 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 = new(OriginSSLProtocolsInitParameters) + (*in).DeepCopyInto(*out) + } +} + +// 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 = new(OriginSSLProtocolsObservation) + (*in).DeepCopyInto(*out) + } +} + +// 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 = new(OriginSSLProtocolsParameters) + (*in).DeepCopyInto(*out) + } +} + +// 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 = new(VPCOriginEndpointConfigInitParameters) + (*in).DeepCopyInto(*out) + } +} + +// 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 = new(VPCOriginEndpointConfigObservation) + (*in).DeepCopyInto(*out) + } +} + +// 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 = new(VPCOriginEndpointConfigParameters) + (*in).DeepCopyInto(*out) + } +} + +// 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..54961dd12d 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 + + 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.Arn), + Extract: resource.ExtractParamPath("arn", true), + Namespace: mg.GetNamespace(), + 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.Arn") + } + mg.Spec.ForProvider.VPCOriginEndpointConfig.Arn = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.VPCOriginEndpointConfig.ArnRef = rsp.ResolvedReference + + } + 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.Arn), + Extract: resource.ExtractParamPath("arn", true), + Namespace: mg.GetNamespace(), + 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.Arn") + } + mg.Spec.InitProvider.VPCOriginEndpointConfig.Arn = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.VPCOriginEndpointConfig.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..c74535af06 --- /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 dd92bcd5d7..4e96f5ad56 100644 --- a/apis/namespaced/cloudfront/v1beta1/zz_generated.deepcopy.go +++ b/apis/namespaced/cloudfront/v1beta1/zz_generated.deepcopy.go @@ -7843,6 +7843,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 @@ -10158,6 +10251,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 @@ -10263,6 +10383,367 @@ 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 = new(OriginSSLProtocolsInitParameters) + (*in).DeepCopyInto(*out) + } +} + +// 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 = new(OriginSSLProtocolsObservation) + (*in).DeepCopyInto(*out) + } +} + +// 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 = new(OriginSSLProtocolsParameters) + (*in).DeepCopyInto(*out) + } +} + +// 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 = new(VPCOriginEndpointConfigInitParameters) + (*in).DeepCopyInto(*out) + } +} + +// 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 = new(VPCOriginEndpointConfigObservation) + (*in).DeepCopyInto(*out) + } +} + +// 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 = new(VPCOriginEndpointConfigParameters) + (*in).DeepCopyInto(*out) + } +} + +// 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..7c18ac44a7 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 + + 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.Arn), + Extract: resource.ExtractParamPath("arn", true), + Namespace: mg.GetNamespace(), + 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.Arn") + } + mg.Spec.ForProvider.VPCOriginEndpointConfig.Arn = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.VPCOriginEndpointConfig.ArnRef = rsp.ResolvedReference + + } + 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.Arn), + Extract: resource.ExtractParamPath("arn", true), + Namespace: mg.GetNamespace(), + 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.Arn") + } + mg.Spec.InitProvider.VPCOriginEndpointConfig.Arn = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.VPCOriginEndpointConfig.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..b434375749 --- /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/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/externalname.go b/config/externalname.go index 8443af1f9a..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 diff --git a/config/generated.lst b/config/generated.lst index a526a8dd8a..a09b7d935f 100644 --- a/config/generated.lst +++ b/config/generated.lst @@ -162,6 +162,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/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") + }) } diff --git a/examples-generated/cluster/cloudfront/v1beta1/vpcorigin.yaml b/examples-generated/cluster/cloudfront/v1beta1/vpcorigin.yaml new file mode 100644 index 0000000000..bff73850a3 --- /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..bd14f78e8d --- /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/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/cluster/v1beta1/vpcorigin.yaml b/examples/cloudfront/cluster/v1beta1/vpcorigin.yaml new file mode 100644 index 0000000000..14dc19c033 --- /dev/null +++ b/examples/cloudfront/cluster/v1beta1/vpcorigin.yaml @@ -0,0 +1,224 @@ +# 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-vpcorigin + name: example-with-selector +spec: + forProvider: + 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 +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: 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: + 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/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 diff --git a/examples/cloudfront/namespaced/v1beta1/vpcorigin.yaml b/examples/cloudfront/namespaced/v1beta1/vpcorigin.yaml new file mode 100644 index 0000000000..31a30aeba7 --- /dev/null +++ b/examples/cloudfront/namespaced/v1beta1/vpcorigin.yaml @@ -0,0 +1,236 @@ +# 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-vpcorigin + name: example-with-selector + namespace: upbound-system +spec: + forProvider: + 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 +metadata: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: example-vpc + name: example-vpc + namespace: upbound-system +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 + namespace: upbound-system +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 + namespace: upbound-system +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 + namespace: upbound-system +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 + namespace: upbound-system +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: 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: + annotations: + meta.upbound.io/example-id: cloudfront/v1beta1/vpcorigin + labels: + testing.upbound.io/example-name: example-alb + name: example-alb + namespace: upbound-system +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..fcacd0726c --- /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.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))), + 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 4ca7273cba..29fc7e5232 100755 --- a/internal/controller/cluster/zz_monolith_setup.go +++ b/internal/controller/cluster/zz_monolith_setup.go @@ -173,6 +173,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" @@ -1178,6 +1179,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, @@ -2189,6 +2191,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..02ccf9f768 --- /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.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))), + 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 d5d9ee3f5d..4fd905016a 100755 --- a/internal/controller/namespaced/zz_monolith_setup.go +++ b/internal/controller/namespaced/zz_monolith_setup.go @@ -173,6 +173,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" @@ -1178,6 +1179,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, @@ -2189,6 +2191,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..c10736b2e1 --- /dev/null +++ b/package/crds/cloudfront.aws.m.upbound.io_vpcorigins.yaml @@ -0,0 +1,507 @@ +--- +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. + 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. + properties: + items: + items: + type: string + type: array + x-kubernetes-list-type: set + quantity: + type: number + type: object + type: object + 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. + 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. + properties: + items: + items: + type: string + type: array + x-kubernetes-list-type: set + quantity: + type: number + type: object + type: object + 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. + 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: + 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. + 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..4e38998080 --- /dev/null +++ b/package/crds/cloudfront.aws.upbound.io_vpcorigins.yaml @@ -0,0 +1,537 @@ +--- +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. + 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. + properties: + items: + items: + type: string + type: array + x-kubernetes-list-type: set + quantity: + type: number + type: object + type: object + 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. + 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. + properties: + items: + items: + type: string + type: array + x-kubernetes-list-type: set + quantity: + type: number + type: object + type: object + 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. + 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: + 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. + 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: {}