From 1f9eda479f1fc2a705f78f68d6505105d2d9c83a Mon Sep 17 00:00:00 2001 From: Charlie Haley Date: Wed, 25 May 2022 10:49:04 +0100 Subject: [PATCH] feat: add VPCPeeringConnectionAccepter Signed-off-by: Charlie Haley --- apis/ec2/v1alpha2/zz_generated.deepcopy.go | 302 ++++++++++++++++++ apis/ec2/v1alpha2/zz_generated.managed.go | 66 ++++ apis/ec2/v1alpha2/zz_generated.managedlist.go | 9 + apis/ec2/v1alpha2/zz_generated_terraformed.go | 74 +++++ .../zz_vpcpeeringconnectionaccepter_types.go | 144 +++++++++ config/ec2/config.go | 5 + config/provider.go | 1 + .../ec2/vpcpeeringconnectionaccepter.yaml | 7 + .../zz_controller.go | 63 ++++ internal/controller/zz_setup.go | 2 + ...lane.io_vpcpeeringconnectionaccepters.yaml | 271 ++++++++++++++++ 11 files changed, 944 insertions(+) create mode 100755 apis/ec2/v1alpha2/zz_vpcpeeringconnectionaccepter_types.go create mode 100644 examples/ec2/vpcpeeringconnectionaccepter.yaml create mode 100755 internal/controller/ec2/vpcpeeringconnectionaccepter/zz_controller.go create mode 100644 package/crds/ec2.aws.jet.crossplane.io_vpcpeeringconnectionaccepters.yaml diff --git a/apis/ec2/v1alpha2/zz_generated.deepcopy.go b/apis/ec2/v1alpha2/zz_generated.deepcopy.go index 9187df3c3..e0c198a81 100644 --- a/apis/ec2/v1alpha2/zz_generated.deepcopy.go +++ b/apis/ec2/v1alpha2/zz_generated.deepcopy.go @@ -7334,6 +7334,308 @@ func (in *VPCPeeringConnection) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCPeeringConnectionAccepter) DeepCopyInto(out *VPCPeeringConnectionAccepter) { + *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 VPCPeeringConnectionAccepter. +func (in *VPCPeeringConnectionAccepter) DeepCopy() *VPCPeeringConnectionAccepter { + if in == nil { + return nil + } + out := new(VPCPeeringConnectionAccepter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VPCPeeringConnectionAccepter) 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 *VPCPeeringConnectionAccepterAccepterObservation) DeepCopyInto(out *VPCPeeringConnectionAccepterAccepterObservation) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCPeeringConnectionAccepterAccepterObservation. +func (in *VPCPeeringConnectionAccepterAccepterObservation) DeepCopy() *VPCPeeringConnectionAccepterAccepterObservation { + if in == nil { + return nil + } + out := new(VPCPeeringConnectionAccepterAccepterObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCPeeringConnectionAccepterAccepterParameters) DeepCopyInto(out *VPCPeeringConnectionAccepterAccepterParameters) { + *out = *in + if in.AllowClassicLinkToRemoteVPC != nil { + in, out := &in.AllowClassicLinkToRemoteVPC, &out.AllowClassicLinkToRemoteVPC + *out = new(bool) + **out = **in + } + if in.AllowRemoteVPCDNSResolution != nil { + in, out := &in.AllowRemoteVPCDNSResolution, &out.AllowRemoteVPCDNSResolution + *out = new(bool) + **out = **in + } + if in.AllowVPCToRemoteClassicLink != nil { + in, out := &in.AllowVPCToRemoteClassicLink, &out.AllowVPCToRemoteClassicLink + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCPeeringConnectionAccepterAccepterParameters. +func (in *VPCPeeringConnectionAccepterAccepterParameters) DeepCopy() *VPCPeeringConnectionAccepterAccepterParameters { + if in == nil { + return nil + } + out := new(VPCPeeringConnectionAccepterAccepterParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCPeeringConnectionAccepterList) DeepCopyInto(out *VPCPeeringConnectionAccepterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]VPCPeeringConnectionAccepter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCPeeringConnectionAccepterList. +func (in *VPCPeeringConnectionAccepterList) DeepCopy() *VPCPeeringConnectionAccepterList { + if in == nil { + return nil + } + out := new(VPCPeeringConnectionAccepterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VPCPeeringConnectionAccepterList) 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 *VPCPeeringConnectionAccepterObservation) DeepCopyInto(out *VPCPeeringConnectionAccepterObservation) { + *out = *in + if in.AcceptStatus != nil { + in, out := &in.AcceptStatus, &out.AcceptStatus + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.PeerOwnerID != nil { + in, out := &in.PeerOwnerID, &out.PeerOwnerID + *out = new(string) + **out = **in + } + if in.PeerRegion != nil { + in, out := &in.PeerRegion, &out.PeerRegion + *out = new(string) + **out = **in + } + if in.PeerVPCID != nil { + in, out := &in.PeerVPCID, &out.PeerVPCID + *out = new(string) + **out = **in + } + if in.TagsAll != nil { + in, out := &in.TagsAll, &out.TagsAll + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.VPCID != nil { + in, out := &in.VPCID, &out.VPCID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCPeeringConnectionAccepterObservation. +func (in *VPCPeeringConnectionAccepterObservation) DeepCopy() *VPCPeeringConnectionAccepterObservation { + if in == nil { + return nil + } + out := new(VPCPeeringConnectionAccepterObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCPeeringConnectionAccepterParameters) DeepCopyInto(out *VPCPeeringConnectionAccepterParameters) { + *out = *in + if in.Accepter != nil { + in, out := &in.Accepter, &out.Accepter + *out = make([]VPCPeeringConnectionAccepterAccepterParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.AutoAccept != nil { + in, out := &in.AutoAccept, &out.AutoAccept + *out = new(bool) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Requester != nil { + in, out := &in.Requester, &out.Requester + *out = make([]VPCPeeringConnectionAccepterRequesterParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.VPCPeeringConnectionID != nil { + in, out := &in.VPCPeeringConnectionID, &out.VPCPeeringConnectionID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCPeeringConnectionAccepterParameters. +func (in *VPCPeeringConnectionAccepterParameters) DeepCopy() *VPCPeeringConnectionAccepterParameters { + if in == nil { + return nil + } + out := new(VPCPeeringConnectionAccepterParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCPeeringConnectionAccepterRequesterObservation) DeepCopyInto(out *VPCPeeringConnectionAccepterRequesterObservation) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCPeeringConnectionAccepterRequesterObservation. +func (in *VPCPeeringConnectionAccepterRequesterObservation) DeepCopy() *VPCPeeringConnectionAccepterRequesterObservation { + if in == nil { + return nil + } + out := new(VPCPeeringConnectionAccepterRequesterObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCPeeringConnectionAccepterRequesterParameters) DeepCopyInto(out *VPCPeeringConnectionAccepterRequesterParameters) { + *out = *in + if in.AllowClassicLinkToRemoteVPC != nil { + in, out := &in.AllowClassicLinkToRemoteVPC, &out.AllowClassicLinkToRemoteVPC + *out = new(bool) + **out = **in + } + if in.AllowRemoteVPCDNSResolution != nil { + in, out := &in.AllowRemoteVPCDNSResolution, &out.AllowRemoteVPCDNSResolution + *out = new(bool) + **out = **in + } + if in.AllowVPCToRemoteClassicLink != nil { + in, out := &in.AllowVPCToRemoteClassicLink, &out.AllowVPCToRemoteClassicLink + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCPeeringConnectionAccepterRequesterParameters. +func (in *VPCPeeringConnectionAccepterRequesterParameters) DeepCopy() *VPCPeeringConnectionAccepterRequesterParameters { + if in == nil { + return nil + } + out := new(VPCPeeringConnectionAccepterRequesterParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCPeeringConnectionAccepterSpec) DeepCopyInto(out *VPCPeeringConnectionAccepterSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCPeeringConnectionAccepterSpec. +func (in *VPCPeeringConnectionAccepterSpec) DeepCopy() *VPCPeeringConnectionAccepterSpec { + if in == nil { + return nil + } + out := new(VPCPeeringConnectionAccepterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCPeeringConnectionAccepterStatus) DeepCopyInto(out *VPCPeeringConnectionAccepterStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCPeeringConnectionAccepterStatus. +func (in *VPCPeeringConnectionAccepterStatus) DeepCopy() *VPCPeeringConnectionAccepterStatus { + if in == nil { + return nil + } + out := new(VPCPeeringConnectionAccepterStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VPCPeeringConnectionList) DeepCopyInto(out *VPCPeeringConnectionList) { *out = *in diff --git a/apis/ec2/v1alpha2/zz_generated.managed.go b/apis/ec2/v1alpha2/zz_generated.managed.go index 8899b76b8..064db3d4d 100644 --- a/apis/ec2/v1alpha2/zz_generated.managed.go +++ b/apis/ec2/v1alpha2/zz_generated.managed.go @@ -1536,3 +1536,69 @@ func (mg *VPCPeeringConnection) SetPublishConnectionDetailsTo(r *xpv1.PublishCon func (mg *VPCPeeringConnection) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } + +// GetCondition of this VPCPeeringConnectionAccepter. +func (mg *VPCPeeringConnectionAccepter) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this VPCPeeringConnectionAccepter. +func (mg *VPCPeeringConnectionAccepter) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetProviderConfigReference of this VPCPeeringConnectionAccepter. +func (mg *VPCPeeringConnectionAccepter) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +/* +GetProviderReference of this VPCPeeringConnectionAccepter. +Deprecated: Use GetProviderConfigReference. +*/ +func (mg *VPCPeeringConnectionAccepter) GetProviderReference() *xpv1.Reference { + return mg.Spec.ProviderReference +} + +// GetPublishConnectionDetailsTo of this VPCPeeringConnectionAccepter. +func (mg *VPCPeeringConnectionAccepter) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this VPCPeeringConnectionAccepter. +func (mg *VPCPeeringConnectionAccepter) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this VPCPeeringConnectionAccepter. +func (mg *VPCPeeringConnectionAccepter) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this VPCPeeringConnectionAccepter. +func (mg *VPCPeeringConnectionAccepter) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetProviderConfigReference of this VPCPeeringConnectionAccepter. +func (mg *VPCPeeringConnectionAccepter) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +/* +SetProviderReference of this VPCPeeringConnectionAccepter. +Deprecated: Use SetProviderConfigReference. +*/ +func (mg *VPCPeeringConnectionAccepter) SetProviderReference(r *xpv1.Reference) { + mg.Spec.ProviderReference = r +} + +// SetPublishConnectionDetailsTo of this VPCPeeringConnectionAccepter. +func (mg *VPCPeeringConnectionAccepter) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this VPCPeeringConnectionAccepter. +func (mg *VPCPeeringConnectionAccepter) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} diff --git a/apis/ec2/v1alpha2/zz_generated.managedlist.go b/apis/ec2/v1alpha2/zz_generated.managedlist.go index 7014bd8e2..b8fb96272 100644 --- a/apis/ec2/v1alpha2/zz_generated.managedlist.go +++ b/apis/ec2/v1alpha2/zz_generated.managedlist.go @@ -217,6 +217,15 @@ func (l *VPCList) GetItems() []resource.Managed { return items } +// GetItems of this VPCPeeringConnectionAccepterList. +func (l *VPCPeeringConnectionAccepterList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} + // GetItems of this VPCPeeringConnectionList. func (l *VPCPeeringConnectionList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) diff --git a/apis/ec2/v1alpha2/zz_generated_terraformed.go b/apis/ec2/v1alpha2/zz_generated_terraformed.go index 081b6ff98..b7b31939a 100755 --- a/apis/ec2/v1alpha2/zz_generated_terraformed.go +++ b/apis/ec2/v1alpha2/zz_generated_terraformed.go @@ -1732,3 +1732,77 @@ func (tr *VPCPeeringConnection) LateInitialize(attrs []byte) (bool, error) { func (tr *VPCPeeringConnection) GetTerraformSchemaVersion() int { return 0 } + +// GetTerraformResourceType returns Terraform resource type for this VPCPeeringConnectionAccepter +func (mg *VPCPeeringConnectionAccepter) GetTerraformResourceType() string { + return "aws_vpc_peering_connection_accepter" +} + +// GetConnectionDetailsMapping for this VPCPeeringConnectionAccepter +func (tr *VPCPeeringConnectionAccepter) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this VPCPeeringConnectionAccepter +func (tr *VPCPeeringConnectionAccepter) GetObservation() (map[string]interface{}, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]interface{}{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this VPCPeeringConnectionAccepter +func (tr *VPCPeeringConnectionAccepter) SetObservation(obs map[string]interface{}) error { + p, err := json.TFParser.Marshal(obs) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) +} + +// GetID returns ID of underlying Terraform resource of this VPCPeeringConnectionAccepter +func (tr *VPCPeeringConnectionAccepter) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this VPCPeeringConnectionAccepter +func (tr *VPCPeeringConnectionAccepter) GetParameters() (map[string]interface{}, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]interface{}{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this VPCPeeringConnectionAccepter +func (tr *VPCPeeringConnectionAccepter) SetParameters(params map[string]interface{}) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// LateInitialize this VPCPeeringConnectionAccepter using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *VPCPeeringConnectionAccepter) LateInitialize(attrs []byte) (bool, error) { + params := &VPCPeeringConnectionAccepterParameters{} + 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 *VPCPeeringConnectionAccepter) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/ec2/v1alpha2/zz_vpcpeeringconnectionaccepter_types.go b/apis/ec2/v1alpha2/zz_vpcpeeringconnectionaccepter_types.go new file mode 100755 index 000000000..456914e38 --- /dev/null +++ b/apis/ec2/v1alpha2/zz_vpcpeeringconnectionaccepter_types.go @@ -0,0 +1,144 @@ +/* +Copyright 2021 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by terrajet. DO NOT EDIT. + +package v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type VPCPeeringConnectionAccepterAccepterObservation struct { +} + +type VPCPeeringConnectionAccepterAccepterParameters struct { + + // +kubebuilder:validation:Optional + AllowClassicLinkToRemoteVPC *bool `json:"allowClassicLinkToRemoteVpc,omitempty" tf:"allow_classic_link_to_remote_vpc,omitempty"` + + // +kubebuilder:validation:Optional + AllowRemoteVPCDNSResolution *bool `json:"allowRemoteVpcDnsResolution,omitempty" tf:"allow_remote_vpc_dns_resolution,omitempty"` + + // +kubebuilder:validation:Optional + AllowVPCToRemoteClassicLink *bool `json:"allowVpcToRemoteClassicLink,omitempty" tf:"allow_vpc_to_remote_classic_link,omitempty"` +} + +type VPCPeeringConnectionAccepterObservation struct { + AcceptStatus *string `json:"acceptStatus,omitempty" tf:"accept_status,omitempty"` + + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + PeerOwnerID *string `json:"peerOwnerId,omitempty" tf:"peer_owner_id,omitempty"` + + PeerRegion *string `json:"peerRegion,omitempty" tf:"peer_region,omitempty"` + + PeerVPCID *string `json:"peerVpcId,omitempty" tf:"peer_vpc_id,omitempty"` + + TagsAll map[string]*string `json:"tagsAll,omitempty" tf:"tags_all,omitempty"` + + VPCID *string `json:"vpcId,omitempty" tf:"vpc_id,omitempty"` +} + +type VPCPeeringConnectionAccepterParameters struct { + + // +kubebuilder:validation:Optional + Accepter []VPCPeeringConnectionAccepterAccepterParameters `json:"accepter,omitempty" tf:"accepter,omitempty"` + + // +kubebuilder:validation:Optional + AutoAccept *bool `json:"autoAccept,omitempty" tf:"auto_accept,omitempty"` + + // Region is the region you'd like your resource to be created in. + // +terrajet:crd:field:TFTag=- + // +kubebuilder:validation:Required + Region *string `json:"region" tf:"-"` + + // +kubebuilder:validation:Optional + Requester []VPCPeeringConnectionAccepterRequesterParameters `json:"requester,omitempty" tf:"requester,omitempty"` + + // +kubebuilder:validation:Optional + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // +kubebuilder:validation:Required + VPCPeeringConnectionID *string `json:"vpcPeeringConnectionId" tf:"vpc_peering_connection_id,omitempty"` +} + +type VPCPeeringConnectionAccepterRequesterObservation struct { +} + +type VPCPeeringConnectionAccepterRequesterParameters struct { + + // +kubebuilder:validation:Optional + AllowClassicLinkToRemoteVPC *bool `json:"allowClassicLinkToRemoteVpc,omitempty" tf:"allow_classic_link_to_remote_vpc,omitempty"` + + // +kubebuilder:validation:Optional + AllowRemoteVPCDNSResolution *bool `json:"allowRemoteVpcDnsResolution,omitempty" tf:"allow_remote_vpc_dns_resolution,omitempty"` + + // +kubebuilder:validation:Optional + AllowVPCToRemoteClassicLink *bool `json:"allowVpcToRemoteClassicLink,omitempty" tf:"allow_vpc_to_remote_classic_link,omitempty"` +} + +// VPCPeeringConnectionAccepterSpec defines the desired state of VPCPeeringConnectionAccepter +type VPCPeeringConnectionAccepterSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider VPCPeeringConnectionAccepterParameters `json:"forProvider"` +} + +// VPCPeeringConnectionAccepterStatus defines the observed state of VPCPeeringConnectionAccepter. +type VPCPeeringConnectionAccepterStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider VPCPeeringConnectionAccepterObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// VPCPeeringConnectionAccepter is the Schema for the VPCPeeringConnectionAccepters API +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,awsjet} +type VPCPeeringConnectionAccepter struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec VPCPeeringConnectionAccepterSpec `json:"spec"` + Status VPCPeeringConnectionAccepterStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// VPCPeeringConnectionAccepterList contains a list of VPCPeeringConnectionAccepters +type VPCPeeringConnectionAccepterList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []VPCPeeringConnectionAccepter `json:"items"` +} + +// Repository type metadata. +var ( + VPCPeeringConnectionAccepter_Kind = "VPCPeeringConnectionAccepter" + VPCPeeringConnectionAccepter_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: VPCPeeringConnectionAccepter_Kind}.String() + VPCPeeringConnectionAccepter_KindAPIVersion = VPCPeeringConnectionAccepter_Kind + "." + CRDGroupVersion.String() + VPCPeeringConnectionAccepter_GroupVersionKind = CRDGroupVersion.WithKind(VPCPeeringConnectionAccepter_Kind) +) + +func init() { + SchemeBuilder.Register(&VPCPeeringConnectionAccepter{}, &VPCPeeringConnectionAccepterList{}) +} diff --git a/config/ec2/config.go b/config/ec2/config.go index c1612d22c..a18ac9010 100644 --- a/config/ec2/config.go +++ b/config/ec2/config.go @@ -260,6 +260,11 @@ func Configure(p *config.Provider) { } }) + p.AddResourceConfigurator("aws_vpc_peering_connection_accepter", func(r *config.Resource) { + r.Version = common.VersionV1Alpha2 + r.ExternalName = config.IdentifierFromProvider + }) + p.AddResourceConfigurator("aws_route", func(r *config.Resource) { r.Version = common.VersionV1Alpha2 r.ExternalName = config.IdentifierFromProvider diff --git a/config/provider.go b/config/provider.go index 2117051f7..95ac234f3 100644 --- a/config/provider.go +++ b/config/provider.go @@ -106,6 +106,7 @@ var IncludedResources = []string{ "aws_vpc_endpoint$", "aws_vpc_ipv4_cidr_block_association$", "aws_vpc_peering_connection$", + "aws_vpc_peering_connection_accepter$", "aws_route_table_association$", "aws_internet_gateway$", diff --git a/examples/ec2/vpcpeeringconnectionaccepter.yaml b/examples/ec2/vpcpeeringconnectionaccepter.yaml new file mode 100644 index 000000000..38fac64dd --- /dev/null +++ b/examples/ec2/vpcpeeringconnectionaccepter.yaml @@ -0,0 +1,7 @@ +apiVersion: ec2.aws.jet.crossplane.io/v1alpha2 +kind: VPCPeeringConnectionAccepter +metadata: + name: sample-vpc +spec: + forProvider: + vpcPeeringConnectionId: pcx-XXXXXXXXXXXXXXXXX diff --git a/internal/controller/ec2/vpcpeeringconnectionaccepter/zz_controller.go b/internal/controller/ec2/vpcpeeringconnectionaccepter/zz_controller.go new file mode 100755 index 000000000..75b5eed8a --- /dev/null +++ b/internal/controller/ec2/vpcpeeringconnectionaccepter/zz_controller.go @@ -0,0 +1,63 @@ +/* +Copyright 2021 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by terrajet. DO NOT EDIT. + +package vpcpeeringconnectionaccepter + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + tjcontroller "github.com/crossplane/terrajet/pkg/controller" + "github.com/crossplane/terrajet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha2 "github.com/crossplane-contrib/provider-jet-aws/apis/ec2/v1alpha2" +) + +// Setup adds a controller that reconciles VPCPeeringConnectionAccepter managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha2.VPCPeeringConnectionAccepter_GroupVersionKind.String()) + var initializers managed.InitializerChain + for _, i := range o.Provider.Resources["aws_vpc_peering_connection_accepter"].InitializerFns { + initializers = append(initializers, i(mgr.GetClient())) + } + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) + } + r := managed.NewReconciler(mgr, + xpresource.ManagedKind(v1alpha2.VPCPeeringConnectionAccepter_GroupVersionKind), + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["aws_vpc_peering_connection_accepter"])), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3*time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + ) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + For(&v1alpha2.VPCPeeringConnectionAccepter{}). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index 1aa1adba6..19d315cec 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -46,6 +46,7 @@ import ( vpcendpoint "github.com/crossplane-contrib/provider-jet-aws/internal/controller/ec2/vpcendpoint" vpcipv4cidrblockassociation "github.com/crossplane-contrib/provider-jet-aws/internal/controller/ec2/vpcipv4cidrblockassociation" vpcpeeringconnection "github.com/crossplane-contrib/provider-jet-aws/internal/controller/ec2/vpcpeeringconnection" + vpcpeeringconnectionaccepter "github.com/crossplane-contrib/provider-jet-aws/internal/controller/ec2/vpcpeeringconnectionaccepter" repository "github.com/crossplane-contrib/provider-jet-aws/internal/controller/ecr/repository" repositoryecrpublic "github.com/crossplane-contrib/provider-jet-aws/internal/controller/ecrpublic/repository" capacityprovider "github.com/crossplane-contrib/provider-jet-aws/internal/controller/ecs/capacityprovider" @@ -145,6 +146,7 @@ func Setup(mgr ctrl.Manager, o controller.Options) error { vpcendpoint.Setup, vpcipv4cidrblockassociation.Setup, vpcpeeringconnection.Setup, + vpcpeeringconnectionaccepter.Setup, repository.Setup, repositoryecrpublic.Setup, capacityprovider.Setup, diff --git a/package/crds/ec2.aws.jet.crossplane.io_vpcpeeringconnectionaccepters.yaml b/package/crds/ec2.aws.jet.crossplane.io_vpcpeeringconnectionaccepters.yaml new file mode 100644 index 000000000..6f9cdee43 --- /dev/null +++ b/package/crds/ec2.aws.jet.crossplane.io_vpcpeeringconnectionaccepters.yaml @@ -0,0 +1,271 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.8.0 + creationTimestamp: null + name: vpcpeeringconnectionaccepters.ec2.aws.jet.crossplane.io +spec: + group: ec2.aws.jet.crossplane.io + names: + categories: + - crossplane + - managed + - awsjet + kind: VPCPeeringConnectionAccepter + listKind: VPCPeeringConnectionAccepterList + plural: vpcpeeringconnectionaccepters + singular: vpcpeeringconnectionaccepter + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha2 + schema: + openAPIV3Schema: + description: VPCPeeringConnectionAccepter is the Schema for the VPCPeeringConnectionAccepters + API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: VPCPeeringConnectionAccepterSpec defines the desired state + of VPCPeeringConnectionAccepter + properties: + deletionPolicy: + default: Delete + description: DeletionPolicy specifies what will happen to the underlying + external when this managed resource is deleted - either "Delete" + or "Orphan" the external resource. + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + accepter: + items: + properties: + allowClassicLinkToRemoteVpc: + type: boolean + allowRemoteVpcDnsResolution: + type: boolean + allowVpcToRemoteClassicLink: + type: boolean + type: object + type: array + autoAccept: + type: boolean + region: + description: Region is the region you'd like your resource to + be created in. + type: string + requester: + items: + properties: + allowClassicLinkToRemoteVpc: + type: boolean + allowRemoteVpcDnsResolution: + type: boolean + allowVpcToRemoteClassicLink: + type: boolean + type: object + type: array + tags: + additionalProperties: + type: string + type: object + vpcPeeringConnectionId: + type: string + required: + - region + - vpcPeeringConnectionId + type: object + providerConfigRef: + default: + name: default + description: ProviderConfigReference specifies how the provider that + will be used to create, observe, update, and delete this managed + resource should be configured. + properties: + name: + description: Name of the referenced object. + type: string + required: + - name + type: object + providerRef: + description: 'ProviderReference specifies the provider that will be + used to create, observe, update, and delete this managed resource. + Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + properties: + name: + description: Name of the referenced object. + type: string + required: + - name + type: object + publishConnectionDetailsTo: + description: PublishConnectionDetailsTo specifies the connection secret + config which contains a name, metadata and a reference to secret + store config to which any connection details for this managed resource + should be written. Connection details frequently include the endpoint, + username, and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: SecretStoreConfigRef specifies which secret store + config should be used for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: Annotations are the annotations to be added to + connection secret. - For Kubernetes secrets, this will be + used as "metadata.annotations". - It is up to Secret Store + implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: Labels are the labels/tags to be added to connection + secret. - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store + types. + type: object + type: + description: Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: WriteConnectionSecretToReference specifies the namespace + and name of a Secret to which any connection details for this managed + resource should be written. Connection details frequently include + the endpoint, username, and password required to connect to the + managed resource. This field is planned to be replaced in a future + release in favor of PublishConnectionDetailsTo. Currently, both + could be set independently and connection details would be published + to both without affecting each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + status: + description: VPCPeeringConnectionAccepterStatus defines the observed state + of VPCPeeringConnectionAccepter. + properties: + atProvider: + properties: + acceptStatus: + type: string + id: + type: string + peerOwnerId: + type: string + peerRegion: + type: string + peerVpcId: + type: string + tagsAll: + additionalProperties: + type: string + type: object + vpcId: + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: LastTransitionTime is the last time this condition + transitioned from one status to another. + format: date-time + type: string + message: + description: A Message containing details about this condition's + last transition from one status to another, if any. + type: string + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: Type of this condition. At most one of each condition + type may apply to a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: []