Skip to content

WIP: feat(vpc): add auto acceptance & rejection of VPC Peering Connection requests #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions apis/v1alpha1/ack-generate-metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
ack_generate_info:
build_date: "2023-09-18T23:03:44Z"
build_hash: 892f29d00a4c4ad21a2fa32919921de18190979d
go_version: go1.20.3
version: v0.27.1
api_directory_checksum: 6e2d850d97f2f72db31c9bef522eca4ab95b3fcd
build_date: "2023-11-29T19:08:13Z"
build_hash: 1cc9b5172d3d1676af578a3411e8672698ec29ce
go_version: go1.21.0
version: 1cc9b51
api_directory_checksum: 71387ea17d55b83d83e29c4195476c8e822ab872
api_version: v1alpha1
aws_sdk_go_version: v1.44.93
generator_config_info:
file_checksum: c474e6cdec9622afad4b4cef415483a7bd0eda41
file_checksum: f79a509548f8e0deca19a9f3cf3cd25fecce9abe
original_file_name: generator.yaml
last_modification:
reason: API generation
12 changes: 12 additions & 0 deletions apis/v1alpha1/generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,18 @@ resources:
print:
path: Status.vpcID
name: ID
# The 2 following fields allow you to specify a list of VPC IDs/Refs from which
# incoming VPC Peering requests will be automatically accepted or rejected
AcceptVpcPeeringRequestsFromVpcIds:
type: "[]*string"
references:
resource: VPC
path: Status.VPCID
RejectVpcPeeringRequestsFromVpcIds:
type: "[]*string"
references:
resource: VPC
path: Status.VPCID
hooks:
delta_pre_compare:
code: compareTags(delta, a, b)
Expand Down
7 changes: 5 additions & 2 deletions apis/v1alpha1/vpc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions apis/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions config/crd/bases/ec2.services.k8s.aws_vpcs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,26 @@ spec:
description: "VpcSpec defines the desired state of Vpc. \n Describes a
VPC."
properties:
acceptVPCPeeringRequestsFromVPCIDs:
items:
type: string
type: array
acceptVPCPeeringRequestsFromVPCRefs:
items:
description: "AWSResourceReferenceWrapper provides a wrapper around
*AWSResourceReference type to provide more user friendly syntax
for references using 'from' field Ex: APIIDRef: \n from: name:
my-api"
properties:
from:
description: AWSResourceReference provides all the values necessary
to reference another k8s resource for finding the identifier(Id/ARN/Name)
properties:
name:
type: string
type: object
type: object
type: array
amazonProvidedIPv6CIDRBlock:
description: Requests an Amazon-provided IPv6 CIDR block with a /56
prefix length for the VPC. You cannot specify the range of IP addresses,
Expand Down Expand Up @@ -111,6 +131,26 @@ spec:
description: The ID of an IPv6 address pool from which to allocate
the IPv6 CIDR block.
type: string
rejectVPCPeeringRequestsFromVPCIDs:
items:
type: string
type: array
rejectVPCPeeringRequestsFromVPCRefs:
items:
description: "AWSResourceReferenceWrapper provides a wrapper around
*AWSResourceReference type to provide more user friendly syntax
for references using 'from' field Ex: APIIDRef: \n from: name:
my-api"
properties:
from:
description: AWSResourceReference provides all the values necessary
to reference another k8s resource for finding the identifier(Id/ARN/Name)
properties:
name:
type: string
type: object
type: object
type: array
tags:
description: The tags. The value parameter is required, but if you
don't want the tag to have a value, specify the parameter with no
Expand Down
12 changes: 12 additions & 0 deletions generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,18 @@ resources:
print:
path: Status.vpcID
name: ID
# The 2 following fields allow you to specify a list of VPC IDs/Refs from which
# incoming VPC Peering requests will be automatically accepted or rejected
AcceptVpcPeeringRequestsFromVpcIds:
type: "[]*string"
references:
resource: VPC
path: Status.VPCID
RejectVpcPeeringRequestsFromVpcIds:
type: "[]*string"
references:
resource: VPC
path: Status.VPCID
hooks:
delta_pre_compare:
code: compareTags(delta, a, b)
Expand Down
40 changes: 40 additions & 0 deletions helm/crds/ec2.services.k8s.aws_vpcs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,26 @@ spec:
description: "VpcSpec defines the desired state of Vpc. \n Describes a
VPC."
properties:
acceptVPCPeeringRequestsFromVPCIDs:
items:
type: string
type: array
acceptVPCPeeringRequestsFromVPCRefs:
items:
description: "AWSResourceReferenceWrapper provides a wrapper around
*AWSResourceReference type to provide more user friendly syntax
for references using 'from' field Ex: APIIDRef: \n from: name:
my-api"
properties:
from:
description: AWSResourceReference provides all the values necessary
to reference another k8s resource for finding the identifier(Id/ARN/Name)
properties:
name:
type: string
type: object
type: object
type: array
amazonProvidedIPv6CIDRBlock:
description: Requests an Amazon-provided IPv6 CIDR block with a /56
prefix length for the VPC. You cannot specify the range of IP addresses,
Expand Down Expand Up @@ -111,6 +131,26 @@ spec:
description: The ID of an IPv6 address pool from which to allocate
the IPv6 CIDR block.
type: string
rejectVPCPeeringRequestsFromVPCIDs:
items:
type: string
type: array
rejectVPCPeeringRequestsFromVPCRefs:
items:
description: "AWSResourceReferenceWrapper provides a wrapper around
*AWSResourceReference type to provide more user friendly syntax
for references using 'from' field Ex: APIIDRef: \n from: name:
my-api"
properties:
from:
description: AWSResourceReference provides all the values necessary
to reference another k8s resource for finding the identifier(Id/ARN/Name)
properties:
name:
type: string
type: object
type: object
type: array
tags:
description: The tags. The value parameter is required, but if you
don't want the tag to have a value, specify the parameter with no
Expand Down
6 changes: 3 additions & 3 deletions helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ spec:
readOnly: true
{{- end }}
{{- if .Values.deployment.extraVolumeMounts -}}
{{ toYaml .Values.deployment.extraVolumeMounts | nindent 12 }}
{{ toYaml .Values.deployment.extraVolumeMounts | nindent 10 }}
{{- end }}
securityContext:
allowPrivilegeEscalation: false
Expand Down Expand Up @@ -151,11 +151,11 @@ spec:
hostNetwork: {{ .Values.deployment.hostNetwork }}
dnsPolicy: {{ .Values.deployment.dnsPolicy }}
volumes:
{{- if .Values.aws.credentials.secretName -}}
{{- if .Values.aws.credentials.secretName }}
- name: {{ .Values.aws.credentials.secretName }}
secret:
secretName: {{ .Values.aws.credentials.secretName }}
{{ end -}}
{{- end }}
{{- if .Values.deployment.extraVolumes }}
{{ toYaml .Values.deployment.extraVolumes | indent 8}}
{{- end }}
12 changes: 12 additions & 0 deletions pkg/resource/vpc/delta.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading