From d6c6ff1bbf67ca4255e4e089678d59ebdde8654c Mon Sep 17 00:00:00 2001 From: kdibrov Date: Wed, 7 Dec 2022 11:48:05 +0100 Subject: [PATCH 1/3] added files for aws_default_security_group resource issue 183 --- .../v1beta1/zz_defaultsecuritygroup_types.go | 204 +++++++ apis/ec2/v1beta1/zz_generated.deepcopy.go | 415 ++++++++++++++ apis/ec2/v1beta1/zz_generated.managed.go | 66 +++ apis/ec2/v1beta1/zz_generated.managedlist.go | 9 + apis/ec2/v1beta1/zz_generated.resolvers.go | 26 + apis/ec2/v1beta1/zz_generated_terraformed.go | 74 +++ config/externalname.go | 2 + config/externalnamenottested.go | 2 - .../ec2/defaultsecuritygroup.yaml | 43 ++ examples/ec2/defaultsecuritygroup.yaml | 43 ++ .../ec2/defaultsecuritygroup/zz_controller.go | 54 ++ internal/controller/zz_setup.go | 2 + ....aws.upbound.io_defaultsecuritygroups.yaml | 504 ++++++++++++++++++ 13 files changed, 1442 insertions(+), 2 deletions(-) create mode 100755 apis/ec2/v1beta1/zz_defaultsecuritygroup_types.go create mode 100644 examples-generated/ec2/defaultsecuritygroup.yaml create mode 100644 examples/ec2/defaultsecuritygroup.yaml create mode 100755 internal/controller/ec2/defaultsecuritygroup/zz_controller.go create mode 100644 package/crds/ec2.aws.upbound.io_defaultsecuritygroups.yaml diff --git a/apis/ec2/v1beta1/zz_defaultsecuritygroup_types.go b/apis/ec2/v1beta1/zz_defaultsecuritygroup_types.go new file mode 100755 index 0000000000..48ad3ba88f --- /dev/null +++ b/apis/ec2/v1beta1/zz_defaultsecuritygroup_types.go @@ -0,0 +1,204 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// 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/apis/common/v1" +) + +type DefaultSecurityGroupEgressObservation struct { +} + +type DefaultSecurityGroupEgressParameters struct { + + // List of CIDR blocks. + // +kubebuilder:validation:Optional + CidrBlocks []*string `json:"cidrBlocks,omitempty" tf:"cidr_blocks"` + + // Description of this rule. + // +kubebuilder:validation:Optional + Description *string `json:"description,omitempty" tf:"description"` + + // Start port (or ICMP type number if protocol is icmp) + // +kubebuilder:validation:Optional + FromPort *float64 `json:"fromPort,omitempty" tf:"from_port"` + + // List of IPv6 CIDR blocks. + // +kubebuilder:validation:Optional + IPv6CidrBlocks []*string `json:"ipv6CidrBlocks,omitempty" tf:"ipv6_cidr_blocks"` + + // List of prefix list IDs (for allowing access to VPC endpoints) + // +kubebuilder:validation:Optional + PrefixListIds []*string `json:"prefixListIds,omitempty" tf:"prefix_list_ids"` + + // Protocol. If you select a protocol of "-1" (semantically equivalent to all, which is not a valid value here), you must specify a from_port and to_port equal to 0. If not icmp, tcp, udp, or -1 use the protocol number. + // +kubebuilder:validation:Optional + Protocol *string `json:"protocol,omitempty" tf:"protocol"` + + // List of security group Group Names if using EC2-Classic, or Group IDs if using a VPC. + // +kubebuilder:validation:Optional + SecurityGroups []*string `json:"securityGroups,omitempty" tf:"security_groups"` + + // Whether the security group itself will be added as a source to this egress rule. + // +kubebuilder:validation:Optional + Self *bool `json:"self,omitempty" tf:"self"` + + // End range port (or ICMP code if protocol is icmp). + // +kubebuilder:validation:Optional + ToPort *float64 `json:"toPort,omitempty" tf:"to_port"` +} + +type DefaultSecurityGroupIngressObservation struct { +} + +type DefaultSecurityGroupIngressParameters struct { + + // List of CIDR blocks. + // +kubebuilder:validation:Optional + CidrBlocks []*string `json:"cidrBlocks,omitempty" tf:"cidr_blocks"` + + // Description of this rule. + // +kubebuilder:validation:Optional + Description *string `json:"description,omitempty" tf:"description"` + + // Start port (or ICMP type number if protocol is icmp) + // +kubebuilder:validation:Optional + FromPort *float64 `json:"fromPort,omitempty" tf:"from_port"` + + // List of IPv6 CIDR blocks. + // +kubebuilder:validation:Optional + IPv6CidrBlocks []*string `json:"ipv6CidrBlocks,omitempty" tf:"ipv6_cidr_blocks"` + + // List of prefix list IDs (for allowing access to VPC endpoints) + // +kubebuilder:validation:Optional + PrefixListIds []*string `json:"prefixListIds,omitempty" tf:"prefix_list_ids"` + + // Protocol. If you select a protocol of "-1" (semantically equivalent to all, which is not a valid value here), you must specify a from_port and to_port equal to 0. If not icmp, tcp, udp, or -1 use the protocol number. + // +kubebuilder:validation:Optional + Protocol *string `json:"protocol,omitempty" tf:"protocol"` + + // List of security group Group Names if using EC2-Classic, or Group IDs if using a VPC. + // +kubebuilder:validation:Optional + SecurityGroups []*string `json:"securityGroups,omitempty" tf:"security_groups"` + + // Whether the security group itself will be added as a source to this egress rule. + // +kubebuilder:validation:Optional + Self *bool `json:"self,omitempty" tf:"self"` + + // End range port (or ICMP code if protocol is icmp). + // +kubebuilder:validation:Optional + ToPort *float64 `json:"toPort,omitempty" tf:"to_port"` +} + +type DefaultSecurityGroupObservation struct { + + // ARN of the security group. + Arn *string `json:"arn,omitempty" tf:"arn,omitempty"` + + // Description of this rule. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // ID of the security group. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // Name of the security group. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // Owner ID. + OwnerID *string `json:"ownerId,omitempty" tf:"owner_id,omitempty"` + + // A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block. + TagsAll map[string]*string `json:"tagsAll,omitempty" tf:"tags_all,omitempty"` +} + +type DefaultSecurityGroupParameters struct { + + // Configuration block. Detailed below. + // +kubebuilder:validation:Optional + Egress []DefaultSecurityGroupEgressParameters `json:"egress,omitempty" tf:"egress,omitempty"` + + // Configuration block. Detailed below. + // +kubebuilder:validation:Optional + Ingress []DefaultSecurityGroupIngressParameters `json:"ingress,omitempty" tf:"ingress,omitempty"` + + // Region is the region you'd like your resource to be created in. + // +upjet:crd:field:TFTag=- + // +kubebuilder:validation:Required + Region *string `json:"region" tf:"-"` + + // +kubebuilder:validation:Optional + RevokeRulesOnDelete *bool `json:"revokeRulesOnDelete,omitempty" tf:"revoke_rules_on_delete,omitempty"` + + // Key-value map of resource tags. + // +kubebuilder:validation:Optional + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // VPC ID. Note that changing the It will be left in its current state. + // +crossplane:generate:reference:type=github.com/upbound/provider-aws/apis/ec2/v1beta1.VPC + // +kubebuilder:validation:Optional + VPCID *string `json:"vpcId,omitempty" tf:"vpc_id,omitempty"` + + // Reference to a VPC in ec2 to populate vpcId. + // +kubebuilder:validation:Optional + VPCIDRef *v1.Reference `json:"vpcIdRef,omitempty" tf:"-"` + + // Selector for a VPC in ec2 to populate vpcId. + // +kubebuilder:validation:Optional + VPCIDSelector *v1.Selector `json:"vpcIdSelector,omitempty" tf:"-"` +} + +// DefaultSecurityGroupSpec defines the desired state of DefaultSecurityGroup +type DefaultSecurityGroupSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider DefaultSecurityGroupParameters `json:"forProvider"` +} + +// DefaultSecurityGroupStatus defines the observed state of DefaultSecurityGroup. +type DefaultSecurityGroupStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider DefaultSecurityGroupObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// DefaultSecurityGroup is the Schema for the DefaultSecurityGroups API. Manage a default security group resource. +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,aws} +type DefaultSecurityGroup struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec DefaultSecurityGroupSpec `json:"spec"` + Status DefaultSecurityGroupStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// DefaultSecurityGroupList contains a list of DefaultSecurityGroups +type DefaultSecurityGroupList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []DefaultSecurityGroup `json:"items"` +} + +// Repository type metadata. +var ( + DefaultSecurityGroup_Kind = "DefaultSecurityGroup" + DefaultSecurityGroup_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: DefaultSecurityGroup_Kind}.String() + DefaultSecurityGroup_KindAPIVersion = DefaultSecurityGroup_Kind + "." + CRDGroupVersion.String() + DefaultSecurityGroup_GroupVersionKind = CRDGroupVersion.WithKind(DefaultSecurityGroup_Kind) +) + +func init() { + SchemeBuilder.Register(&DefaultSecurityGroup{}, &DefaultSecurityGroupList{}) +} diff --git a/apis/ec2/v1beta1/zz_generated.deepcopy.go b/apis/ec2/v1beta1/zz_generated.deepcopy.go index 9107fdd933..084df0be09 100644 --- a/apis/ec2/v1beta1/zz_generated.deepcopy.go +++ b/apis/ec2/v1beta1/zz_generated.deepcopy.go @@ -2713,6 +2713,421 @@ func (in *DefaultRouteTableStatus) DeepCopy() *DefaultRouteTableStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DefaultSecurityGroup) DeepCopyInto(out *DefaultSecurityGroup) { + *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 DefaultSecurityGroup. +func (in *DefaultSecurityGroup) DeepCopy() *DefaultSecurityGroup { + if in == nil { + return nil + } + out := new(DefaultSecurityGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DefaultSecurityGroup) 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 *DefaultSecurityGroupEgressObservation) DeepCopyInto(out *DefaultSecurityGroupEgressObservation) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefaultSecurityGroupEgressObservation. +func (in *DefaultSecurityGroupEgressObservation) DeepCopy() *DefaultSecurityGroupEgressObservation { + if in == nil { + return nil + } + out := new(DefaultSecurityGroupEgressObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DefaultSecurityGroupEgressParameters) DeepCopyInto(out *DefaultSecurityGroupEgressParameters) { + *out = *in + if in.CidrBlocks != nil { + in, out := &in.CidrBlocks, &out.CidrBlocks + *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.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.FromPort != nil { + in, out := &in.FromPort, &out.FromPort + *out = new(float64) + **out = **in + } + if in.IPv6CidrBlocks != nil { + in, out := &in.IPv6CidrBlocks, &out.IPv6CidrBlocks + *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.PrefixListIds != nil { + in, out := &in.PrefixListIds, &out.PrefixListIds + *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.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.SecurityGroups != nil { + in, out := &in.SecurityGroups, &out.SecurityGroups + *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.Self != nil { + in, out := &in.Self, &out.Self + *out = new(bool) + **out = **in + } + if in.ToPort != nil { + in, out := &in.ToPort, &out.ToPort + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefaultSecurityGroupEgressParameters. +func (in *DefaultSecurityGroupEgressParameters) DeepCopy() *DefaultSecurityGroupEgressParameters { + if in == nil { + return nil + } + out := new(DefaultSecurityGroupEgressParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DefaultSecurityGroupIngressObservation) DeepCopyInto(out *DefaultSecurityGroupIngressObservation) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefaultSecurityGroupIngressObservation. +func (in *DefaultSecurityGroupIngressObservation) DeepCopy() *DefaultSecurityGroupIngressObservation { + if in == nil { + return nil + } + out := new(DefaultSecurityGroupIngressObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DefaultSecurityGroupIngressParameters) DeepCopyInto(out *DefaultSecurityGroupIngressParameters) { + *out = *in + if in.CidrBlocks != nil { + in, out := &in.CidrBlocks, &out.CidrBlocks + *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.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.FromPort != nil { + in, out := &in.FromPort, &out.FromPort + *out = new(float64) + **out = **in + } + if in.IPv6CidrBlocks != nil { + in, out := &in.IPv6CidrBlocks, &out.IPv6CidrBlocks + *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.PrefixListIds != nil { + in, out := &in.PrefixListIds, &out.PrefixListIds + *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.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.SecurityGroups != nil { + in, out := &in.SecurityGroups, &out.SecurityGroups + *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.Self != nil { + in, out := &in.Self, &out.Self + *out = new(bool) + **out = **in + } + if in.ToPort != nil { + in, out := &in.ToPort, &out.ToPort + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefaultSecurityGroupIngressParameters. +func (in *DefaultSecurityGroupIngressParameters) DeepCopy() *DefaultSecurityGroupIngressParameters { + if in == nil { + return nil + } + out := new(DefaultSecurityGroupIngressParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DefaultSecurityGroupList) DeepCopyInto(out *DefaultSecurityGroupList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DefaultSecurityGroup, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefaultSecurityGroupList. +func (in *DefaultSecurityGroupList) DeepCopy() *DefaultSecurityGroupList { + if in == nil { + return nil + } + out := new(DefaultSecurityGroupList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DefaultSecurityGroupList) 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 *DefaultSecurityGroupObservation) DeepCopyInto(out *DefaultSecurityGroupObservation) { + *out = *in + if in.Arn != nil { + in, out := &in.Arn, &out.Arn + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.OwnerID != nil { + in, out := &in.OwnerID, &out.OwnerID + *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 + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefaultSecurityGroupObservation. +func (in *DefaultSecurityGroupObservation) DeepCopy() *DefaultSecurityGroupObservation { + if in == nil { + return nil + } + out := new(DefaultSecurityGroupObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DefaultSecurityGroupParameters) DeepCopyInto(out *DefaultSecurityGroupParameters) { + *out = *in + if in.Egress != nil { + in, out := &in.Egress, &out.Egress + *out = make([]DefaultSecurityGroupEgressParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Ingress != nil { + in, out := &in.Ingress, &out.Ingress + *out = make([]DefaultSecurityGroupIngressParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.RevokeRulesOnDelete != nil { + in, out := &in.RevokeRulesOnDelete, &out.RevokeRulesOnDelete + *out = new(bool) + **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 { + 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 + } + if in.VPCIDRef != nil { + in, out := &in.VPCIDRef, &out.VPCIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.VPCIDSelector != nil { + in, out := &in.VPCIDSelector, &out.VPCIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefaultSecurityGroupParameters. +func (in *DefaultSecurityGroupParameters) DeepCopy() *DefaultSecurityGroupParameters { + if in == nil { + return nil + } + out := new(DefaultSecurityGroupParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DefaultSecurityGroupSpec) DeepCopyInto(out *DefaultSecurityGroupSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefaultSecurityGroupSpec. +func (in *DefaultSecurityGroupSpec) DeepCopy() *DefaultSecurityGroupSpec { + if in == nil { + return nil + } + out := new(DefaultSecurityGroupSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DefaultSecurityGroupStatus) DeepCopyInto(out *DefaultSecurityGroupStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefaultSecurityGroupStatus. +func (in *DefaultSecurityGroupStatus) DeepCopy() *DefaultSecurityGroupStatus { + if in == nil { + return nil + } + out := new(DefaultSecurityGroupStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DefaultSubnet) DeepCopyInto(out *DefaultSubnet) { *out = *in diff --git a/apis/ec2/v1beta1/zz_generated.managed.go b/apis/ec2/v1beta1/zz_generated.managed.go index cce5b54b9e..2d981c74c5 100644 --- a/apis/ec2/v1beta1/zz_generated.managed.go +++ b/apis/ec2/v1beta1/zz_generated.managed.go @@ -601,6 +601,72 @@ func (mg *DefaultRouteTable) SetWriteConnectionSecretToReference(r *xpv1.SecretR mg.Spec.WriteConnectionSecretToReference = r } +// GetCondition of this DefaultSecurityGroup. +func (mg *DefaultSecurityGroup) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this DefaultSecurityGroup. +func (mg *DefaultSecurityGroup) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetProviderConfigReference of this DefaultSecurityGroup. +func (mg *DefaultSecurityGroup) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +/* +GetProviderReference of this DefaultSecurityGroup. +Deprecated: Use GetProviderConfigReference. +*/ +func (mg *DefaultSecurityGroup) GetProviderReference() *xpv1.Reference { + return mg.Spec.ProviderReference +} + +// GetPublishConnectionDetailsTo of this DefaultSecurityGroup. +func (mg *DefaultSecurityGroup) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this DefaultSecurityGroup. +func (mg *DefaultSecurityGroup) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this DefaultSecurityGroup. +func (mg *DefaultSecurityGroup) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this DefaultSecurityGroup. +func (mg *DefaultSecurityGroup) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetProviderConfigReference of this DefaultSecurityGroup. +func (mg *DefaultSecurityGroup) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +/* +SetProviderReference of this DefaultSecurityGroup. +Deprecated: Use SetProviderConfigReference. +*/ +func (mg *DefaultSecurityGroup) SetProviderReference(r *xpv1.Reference) { + mg.Spec.ProviderReference = r +} + +// SetPublishConnectionDetailsTo of this DefaultSecurityGroup. +func (mg *DefaultSecurityGroup) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this DefaultSecurityGroup. +func (mg *DefaultSecurityGroup) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + // GetCondition of this DefaultSubnet. func (mg *DefaultSubnet) GetCondition(ct xpv1.ConditionType) xpv1.Condition { return mg.Status.GetCondition(ct) diff --git a/apis/ec2/v1beta1/zz_generated.managedlist.go b/apis/ec2/v1beta1/zz_generated.managedlist.go index b65601e4f5..3e59928e64 100644 --- a/apis/ec2/v1beta1/zz_generated.managedlist.go +++ b/apis/ec2/v1beta1/zz_generated.managedlist.go @@ -88,6 +88,15 @@ func (l *DefaultRouteTableList) GetItems() []resource.Managed { return items } +// GetItems of this DefaultSecurityGroupList. +func (l *DefaultSecurityGroupList) 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 DefaultSubnetList. func (l *DefaultSubnetList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) diff --git a/apis/ec2/v1beta1/zz_generated.resolvers.go b/apis/ec2/v1beta1/zz_generated.resolvers.go index 4a452d25e5..682962ee2f 100644 --- a/apis/ec2/v1beta1/zz_generated.resolvers.go +++ b/apis/ec2/v1beta1/zz_generated.resolvers.go @@ -265,6 +265,32 @@ func (mg *DefaultRouteTable) ResolveReferences(ctx context.Context, c client.Rea return nil } +// ResolveReferences of this DefaultSecurityGroup. +func (mg *DefaultSecurityGroup) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.VPCID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.VPCIDRef, + Selector: mg.Spec.ForProvider.VPCIDSelector, + To: reference.To{ + List: &VPCList{}, + Managed: &VPC{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.VPCID") + } + mg.Spec.ForProvider.VPCID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.VPCIDRef = rsp.ResolvedReference + + return nil +} + // ResolveReferences of this EBSDefaultKMSKey. func (mg *EBSDefaultKMSKey) ResolveReferences(ctx context.Context, c client.Reader) error { r := reference.NewAPIResolver(c, mg) diff --git a/apis/ec2/v1beta1/zz_generated_terraformed.go b/apis/ec2/v1beta1/zz_generated_terraformed.go index c9bb577328..bf0be919d3 100755 --- a/apis/ec2/v1beta1/zz_generated_terraformed.go +++ b/apis/ec2/v1beta1/zz_generated_terraformed.go @@ -457,6 +457,80 @@ func (tr *DefaultRouteTable) GetTerraformSchemaVersion() int { return 0 } +// GetTerraformResourceType returns Terraform resource type for this DefaultSecurityGroup +func (mg *DefaultSecurityGroup) GetTerraformResourceType() string { + return "aws_default_security_group" +} + +// GetConnectionDetailsMapping for this DefaultSecurityGroup +func (tr *DefaultSecurityGroup) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this DefaultSecurityGroup +func (tr *DefaultSecurityGroup) 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 DefaultSecurityGroup +func (tr *DefaultSecurityGroup) 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 DefaultSecurityGroup +func (tr *DefaultSecurityGroup) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this DefaultSecurityGroup +func (tr *DefaultSecurityGroup) 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 DefaultSecurityGroup +func (tr *DefaultSecurityGroup) 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) +} + +// LateInitialize this DefaultSecurityGroup using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *DefaultSecurityGroup) LateInitialize(attrs []byte) (bool, error) { + params := &DefaultSecurityGroupParameters{} + 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 *DefaultSecurityGroup) GetTerraformSchemaVersion() int { + return 1 +} + // GetTerraformResourceType returns Terraform resource type for this DefaultSubnet func (mg *DefaultSubnet) GetTerraformResourceType() string { return "aws_default_subnet" diff --git a/config/externalname.go b/config/externalname.go index 0e8ed2b43d..b7a5b8a5ae 100644 --- a/config/externalname.go +++ b/config/externalname.go @@ -317,6 +317,8 @@ var ExternalNameConfigs = map[string]config.ExternalName{ "aws_vpn_gateway_attachment": config.IdentifierFromProvider, // No import "aws_vpn_gateway_route_propagation": config.IdentifierFromProvider, + // Security Groups can be imported using the security group id + "aws_default_security_group": config.IdentifierFromProvider, // ecr // diff --git a/config/externalnamenottested.go b/config/externalnamenottested.go index 92fe7c48ef..022070c96d 100644 --- a/config/externalnamenottested.go +++ b/config/externalnamenottested.go @@ -228,8 +228,6 @@ var ExternalNameNotTestedConfigs = map[string]config.ExternalName{ // // No import "aws_ami_from_instance": config.IdentifierFromProvider, - // Security Groups can be imported using the security group id - "aws_default_security_group": config.IdentifierFromProvider, // "aws_ec2_client_vpn_authorization_rule": config.IdentifierFromProvider, // AWS Client VPN endpoints can be imported using the id value found via aws ec2 describe-client-vpn-endpoints diff --git a/examples-generated/ec2/defaultsecuritygroup.yaml b/examples-generated/ec2/defaultsecuritygroup.yaml new file mode 100644 index 0000000000..a4c2f18515 --- /dev/null +++ b/examples-generated/ec2/defaultsecuritygroup.yaml @@ -0,0 +1,43 @@ +apiVersion: ec2.aws.upbound.io/v1beta1 +kind: DefaultSecurityGroup +metadata: + annotations: + meta.upbound.io/example-id: ec2/v1beta1/defaultsecuritygroup + labels: + testing.upbound.io/example-name: default + name: default +spec: + forProvider: + egress: + - cidrBlocks: + - 0.0.0.0/0 + fromPort: 0 + protocol: "-1" + toPort: 0 + ingress: + - fromPort: 0 + protocol: -1 + self: true + toPort: 0 + region: us-west-1 + vpcIdSelector: + matchLabels: + testing.upbound.io/example-name: mainvpc + +--- + +apiVersion: ec2.aws.upbound.io/v1beta1 +kind: VPC +metadata: + annotations: + meta.upbound.io/example-id: ec2/v1beta1/defaultsecuritygroup + labels: + testing.upbound.io/example-name: mainvpc + name: mainvpc +spec: + forProvider: + cidrBlock: 10.1.0.0/16 + region: us-west-1 + +--- + diff --git a/examples/ec2/defaultsecuritygroup.yaml b/examples/ec2/defaultsecuritygroup.yaml new file mode 100644 index 0000000000..c5f1d24c17 --- /dev/null +++ b/examples/ec2/defaultsecuritygroup.yaml @@ -0,0 +1,43 @@ +apiVersion: ec2.aws.upbound.io/v1beta1 +kind: DefaultSecurityGroup +metadata: + annotations: + meta.upbound.io/example-id: ec2/v1beta1/defaultsecuritygroup + labels: + testing.upbound.io/example-name: default + name: default +spec: + forProvider: + egress: + - cidrBlocks: + - 0.0.0.0/0 + fromPort: 0 + protocol: "-1" + toPort: 0 + ingress: + - fromPort: 0 + protocol: "-1" + self: true + toPort: 0 + region: us-west-1 + vpcIdSelector: + matchLabels: + testing.upbound.io/example-name: mainvpc + +--- + +apiVersion: ec2.aws.upbound.io/v1beta1 +kind: VPC +metadata: + annotations: + meta.upbound.io/example-id: ec2/v1beta1/defaultsecuritygroup + labels: + testing.upbound.io/example-name: mainvpc + name: mainvpc +spec: + forProvider: + cidrBlock: 10.1.0.0/16 + region: us-west-1 + +--- + diff --git a/internal/controller/ec2/defaultsecuritygroup/zz_controller.go b/internal/controller/ec2/defaultsecuritygroup/zz_controller.go new file mode 100755 index 0000000000..d5d73eb68b --- /dev/null +++ b/internal/controller/ec2/defaultsecuritygroup/zz_controller.go @@ -0,0 +1,54 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package defaultsecuritygroup + +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/upbound/upjet/pkg/controller" + "github.com/upbound/upjet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1beta1 "github.com/upbound/provider-aws/apis/ec2/v1beta1" +) + +// Setup adds a controller that reconciles DefaultSecurityGroup managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1beta1.DefaultSecurityGroup_GroupVersionKind.String()) + var initializers managed.InitializerChain + for _, i := range o.Provider.Resources["aws_default_security_group"].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(v1beta1.DefaultSecurityGroup_GroupVersionKind), + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["aws_default_security_group"], + tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DefaultSecurityGroup_GroupVersionKind))), + )), + 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...), + managed.WithPollInterval(o.PollInterval), + ) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + For(&v1beta1.DefaultSecurityGroup{}). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index f8e732f14d..50b3b1ed62 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -233,6 +233,7 @@ import ( customergateway "github.com/upbound/provider-aws/internal/controller/ec2/customergateway" defaultnetworkacl "github.com/upbound/provider-aws/internal/controller/ec2/defaultnetworkacl" defaultroutetable "github.com/upbound/provider-aws/internal/controller/ec2/defaultroutetable" + defaultsecuritygroup "github.com/upbound/provider-aws/internal/controller/ec2/defaultsecuritygroup" defaultsubnet "github.com/upbound/provider-aws/internal/controller/ec2/defaultsubnet" defaultvpc "github.com/upbound/provider-aws/internal/controller/ec2/defaultvpc" defaultvpcdhcpoptions "github.com/upbound/provider-aws/internal/controller/ec2/defaultvpcdhcpoptions" @@ -761,6 +762,7 @@ func Setup(mgr ctrl.Manager, o controller.Options) error { customergateway.Setup, defaultnetworkacl.Setup, defaultroutetable.Setup, + defaultsecuritygroup.Setup, defaultsubnet.Setup, defaultvpc.Setup, defaultvpcdhcpoptions.Setup, diff --git a/package/crds/ec2.aws.upbound.io_defaultsecuritygroups.yaml b/package/crds/ec2.aws.upbound.io_defaultsecuritygroups.yaml new file mode 100644 index 0000000000..57abb4354a --- /dev/null +++ b/package/crds/ec2.aws.upbound.io_defaultsecuritygroups.yaml @@ -0,0 +1,504 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.8.0 + creationTimestamp: null + name: defaultsecuritygroups.ec2.aws.upbound.io +spec: + group: ec2.aws.upbound.io + names: + categories: + - crossplane + - managed + - aws + kind: DefaultSecurityGroup + listKind: DefaultSecurityGroupList + plural: defaultsecuritygroups + singular: defaultsecuritygroup + 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: v1beta1 + schema: + openAPIV3Schema: + description: DefaultSecurityGroup is the Schema for the DefaultSecurityGroups + API. Manage a default security group resource. + 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: DefaultSecurityGroupSpec defines the desired state of DefaultSecurityGroup + 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: + egress: + description: Configuration block. Detailed below. + items: + properties: + cidrBlocks: + description: List of CIDR blocks. + items: + type: string + type: array + description: + description: Description of this rule. + type: string + fromPort: + description: Start port (or ICMP type number if protocol + is icmp) + type: number + ipv6CidrBlocks: + description: List of IPv6 CIDR blocks. + items: + type: string + type: array + prefixListIds: + description: List of prefix list IDs (for allowing access + to VPC endpoints) + items: + type: string + type: array + protocol: + description: Protocol. If you select a protocol of "-1" + (semantically equivalent to all, which is not a valid + value here), you must specify a from_port and to_port + equal to 0. If not icmp, tcp, udp, or -1 use the protocol + number. + type: string + securityGroups: + description: List of security group Group Names if using + EC2-Classic, or Group IDs if using a VPC. + items: + type: string + type: array + self: + description: Whether the security group itself will be added + as a source to this egress rule. + type: boolean + toPort: + description: End range port (or ICMP code if protocol is + icmp). + type: number + type: object + type: array + ingress: + description: Configuration block. Detailed below. + items: + properties: + cidrBlocks: + description: List of CIDR blocks. + items: + type: string + type: array + description: + description: Description of this rule. + type: string + fromPort: + description: Start port (or ICMP type number if protocol + is icmp) + type: number + ipv6CidrBlocks: + description: List of IPv6 CIDR blocks. + items: + type: string + type: array + prefixListIds: + description: List of prefix list IDs (for allowing access + to VPC endpoints) + items: + type: string + type: array + protocol: + description: Protocol. If you select a protocol of "-1" + (semantically equivalent to all, which is not a valid + value here), you must specify a from_port and to_port + equal to 0. If not icmp, tcp, udp, or -1 use the protocol + number. + type: string + securityGroups: + description: List of security group Group Names if using + EC2-Classic, or Group IDs if using a VPC. + items: + type: string + type: array + self: + description: Whether the security group itself will be added + as a source to this egress rule. + type: boolean + toPort: + description: End range port (or ICMP code if protocol is + icmp). + type: number + type: object + type: array + region: + description: Region is the region you'd like your resource to + be created in. + type: string + revokeRulesOnDelete: + type: boolean + tags: + additionalProperties: + type: string + description: Key-value map of resource tags. + type: object + vpcId: + description: VPC ID. Note that changing the It will be left in + its current state. + type: string + vpcIdRef: + description: Reference to a VPC in ec2 to populate vpcId. + 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 + vpcIdSelector: + description: Selector for a VPC in ec2 to populate vpcId. + 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 + required: + - region + 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 + 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 + 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 + 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 + 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 + 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 + 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: DefaultSecurityGroupStatus defines the observed state of + DefaultSecurityGroup. + properties: + atProvider: + properties: + arn: + description: ARN of the security group. + type: string + description: + description: Description of this rule. + type: string + id: + description: ID of the security group. + type: string + name: + description: Name of the security group. + type: string + ownerId: + description: Owner ID. + type: string + 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 + 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: [] From 306d636e56c0f4978558f4306b53d8a9d1ece5d2 Mon Sep 17 00:00:00 2001 From: kdibrov Date: Wed, 7 Dec 2022 12:16:50 +0100 Subject: [PATCH 2/3] fixing whitepace in yaml file --- examples/ec2/defaultsecuritygroup.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/ec2/defaultsecuritygroup.yaml b/examples/ec2/defaultsecuritygroup.yaml index c5f1d24c17..b52934bcd5 100644 --- a/examples/ec2/defaultsecuritygroup.yaml +++ b/examples/ec2/defaultsecuritygroup.yaml @@ -39,5 +39,4 @@ spec: cidrBlock: 10.1.0.0/16 region: us-west-1 ---- - +--- \ No newline at end of file From 9d6d752cec532f61c2f63ed33f15bfbed853c139 Mon Sep 17 00:00:00 2001 From: kdibrov Date: Wed, 7 Dec 2022 12:28:42 +0100 Subject: [PATCH 3/3] fixing whitepace in yaml file again2 --- examples/ec2/defaultsecuritygroup.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/ec2/defaultsecuritygroup.yaml b/examples/ec2/defaultsecuritygroup.yaml index b52934bcd5..b8c6b5303f 100644 --- a/examples/ec2/defaultsecuritygroup.yaml +++ b/examples/ec2/defaultsecuritygroup.yaml @@ -37,6 +37,4 @@ metadata: spec: forProvider: cidrBlock: 10.1.0.0/16 - region: us-west-1 - ---- \ No newline at end of file + region: us-west-1 \ No newline at end of file