Skip to content

Commit 34873e1

Browse files
nnbuNishant Burte
authored and
Nishant Burte
committed
Fix: Add option to delete default SG rule created upon VPC creation (aws-controllers-k8s#212)
Issue #, if available: Description of changes: When a VPC is created, it also creates 'default' security group. The 'default' security group has widely open egress rules. We need to have an option to delete this autocreated rules from 'default' security group. The 'default' security group itself can not be deleted. Discussion: https://kubernetes.slack.com/archives/C0402D8JJS1/p1720560499642019 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent ee56fa9 commit 34873e1

19 files changed

+586
-588
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2024-08-29T20:21:49Z"
2+
build_date: "2024-09-12T18:02:26Z"
33
build_hash: f8f98563404066ac3340db0a049d2e530e5c51cc
4-
go_version: go1.22.5
4+
go_version: go1.22.6
55
version: v0.38.1
6-
api_directory_checksum: 1b53401670898ce50e6d6cc8bfba6b63ea7d5683
6+
api_directory_checksum: 585098fc7c99c27ca523f83e860107d22aaa5a10
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.44.93
99
generator_config_info:
10-
file_checksum: b6cf44fddbe38dd354160538b750818e10bda45c
10+
file_checksum: 976d1b5c435aeb198caa71b29c1449eb3c378c6f
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,12 @@ resources:
725725
print:
726726
path: Status.vpcID
727727
name: ID
728+
DisallowSecurityGroupDefaultRules:
729+
type: bool
730+
is_required: false
731+
SecurityGroupDefaultRulesExist:
732+
type: bool
733+
is_read_only: true
728734
hooks:
729735
sdk_create_post_build_request:
730736
template_path: hooks/vpc/sdk_create_post_build_request.go.tpl

apis/v1alpha1/vpc.go

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/v1alpha1/zz_generated.deepcopy.go

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/ec2.services.k8s.aws_vpcs.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ spec:
6060
items:
6161
type: string
6262
type: array
63+
disallowSecurityGroupDefaultRules:
64+
type: boolean
6365
enableDNSHostnames:
6466
description: The attribute value. The valid values are true or false.
6567
type: boolean
@@ -273,6 +275,8 @@ spec:
273275
description: The ID of the Amazon Web Services account that owns the
274276
VPC.
275277
type: string
278+
securityGroupDefaultRulesExist:
279+
type: boolean
276280
state:
277281
description: The current state of the VPC.
278282
type: string

generator.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,12 @@ resources:
725725
print:
726726
path: Status.vpcID
727727
name: ID
728+
DisallowSecurityGroupDefaultRules:
729+
type: bool
730+
is_required: false
731+
SecurityGroupDefaultRulesExist:
732+
type: bool
733+
is_read_only: true
728734
hooks:
729735
sdk_create_post_build_request:
730736
template_path: hooks/vpc/sdk_create_post_build_request.go.tpl

go.local.mod

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,41 @@
11
module github.com/aws-controllers-k8s/ec2-controller
22

3-
go 1.19
3+
go 1.22.0
4+
5+
toolchain go1.22.5
46

57
replace github.com/aws-controllers-k8s/runtime => ../runtime
68

79
require (
810
github.com/aws-controllers-k8s/runtime v0.0.0
9-
github.com/aws/aws-sdk-go v1.44.93
10-
github.com/go-logr/logr v1.2.3
11+
github.com/aws/aws-sdk-go v1.49.0
12+
github.com/go-logr/logr v1.4.1
1113
github.com/samber/lo v1.37.0
1214
github.com/spf13/pflag v1.0.5
13-
k8s.io/api v0.26.8
14-
k8s.io/apimachinery v0.26.8
15-
k8s.io/client-go v0.26.8
16-
sigs.k8s.io/controller-runtime v0.14.5
15+
k8s.io/api v0.30.1
16+
k8s.io/apimachinery v0.30.1
17+
k8s.io/client-go v0.30.1
18+
sigs.k8s.io/controller-runtime v0.18.4
1719
)
1820

1921
require (
2022
github.com/beorn7/perks v1.0.1 // indirect
21-
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
22-
github.com/cespare/xxhash/v2 v2.1.2 // indirect
23+
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
24+
github.com/cespare/xxhash/v2 v2.2.0 // indirect
2325
github.com/davecgh/go-spew v1.1.1 // indirect
24-
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
25-
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
26-
github.com/fsnotify/fsnotify v1.6.0 // indirect
27-
github.com/go-logr/zapr v1.2.3 // indirect
28-
github.com/go-openapi/jsonpointer v0.19.5 // indirect
29-
github.com/go-openapi/jsonreference v0.20.0 // indirect
30-
github.com/go-openapi/swag v0.19.14 // indirect
26+
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
27+
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
28+
github.com/fsnotify/fsnotify v1.7.0 // indirect
29+
github.com/go-logr/zapr v1.3.0 // indirect
30+
github.com/go-openapi/jsonpointer v0.19.6 // indirect
31+
github.com/go-openapi/jsonreference v0.20.2 // indirect
32+
github.com/go-openapi/swag v0.22.3 // indirect
3133
github.com/gogo/protobuf v1.3.2 // indirect
3234
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
33-
github.com/golang/protobuf v1.5.2 // indirect
34-
github.com/google/gnostic v0.5.7-v3refs // indirect
35-
github.com/google/go-cmp v0.5.9 // indirect
36-
github.com/google/gofuzz v1.1.0 // indirect
35+
github.com/golang/protobuf v1.5.4 // indirect
36+
github.com/google/gnostic-models v0.6.8 // indirect
37+
github.com/google/go-cmp v0.6.0 // indirect
38+
github.com/google/gofuzz v1.2.0 // indirect
3739
github.com/google/uuid v1.3.0 // indirect
3840
github.com/imdario/mergo v0.3.12 // indirect
3941
github.com/itchyny/gojq v0.12.6 // indirect
@@ -42,38 +44,36 @@ require (
4244
github.com/jmespath/go-jmespath v0.4.0 // indirect
4345
github.com/josharian/intern v1.0.0 // indirect
4446
github.com/json-iterator/go v1.1.12 // indirect
45-
github.com/mailru/easyjson v0.7.6 // indirect
46-
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
47+
github.com/mailru/easyjson v0.7.7 // indirect
48+
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
4749
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
4850
github.com/modern-go/reflect2 v1.0.2 // indirect
4951
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
5052
github.com/pkg/errors v0.9.1 // indirect
51-
github.com/prometheus/client_golang v1.14.0 // indirect
52-
github.com/prometheus/client_model v0.3.0 // indirect
53-
github.com/prometheus/common v0.37.0 // indirect
54-
github.com/prometheus/procfs v0.8.0 // indirect
55-
go.uber.org/atomic v1.7.0 // indirect
56-
go.uber.org/multierr v1.6.0 // indirect
57-
go.uber.org/zap v1.24.0 // indirect
58-
golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 // indirect
59-
golang.org/x/net v0.8.0 // indirect
60-
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
61-
golang.org/x/sys v0.6.0 // indirect
62-
golang.org/x/term v0.6.0 // indirect
63-
golang.org/x/text v0.8.0 // indirect
53+
github.com/prometheus/client_golang v1.18.0 // indirect
54+
github.com/prometheus/client_model v0.5.0 // indirect
55+
github.com/prometheus/common v0.45.0 // indirect
56+
github.com/prometheus/procfs v0.12.0 // indirect
57+
go.uber.org/multierr v1.11.0 // indirect
58+
go.uber.org/zap v1.26.0 // indirect
59+
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
60+
golang.org/x/net v0.23.0 // indirect
61+
golang.org/x/oauth2 v0.12.0 // indirect
62+
golang.org/x/sys v0.18.0 // indirect
63+
golang.org/x/term v0.18.0 // indirect
64+
golang.org/x/text v0.14.0 // indirect
6465
golang.org/x/time v0.3.0 // indirect
65-
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
66+
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
6667
google.golang.org/appengine v1.6.7 // indirect
67-
google.golang.org/protobuf v1.28.1 // indirect
68+
google.golang.org/protobuf v1.33.0 // indirect
6869
gopkg.in/inf.v0 v0.9.1 // indirect
6970
gopkg.in/yaml.v2 v2.4.0 // indirect
7071
gopkg.in/yaml.v3 v3.0.1 // indirect
71-
k8s.io/apiextensions-apiserver v0.26.1 // indirect
72-
k8s.io/component-base v0.26.1 // indirect
73-
k8s.io/klog/v2 v2.80.1 // indirect
74-
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
75-
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
76-
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
77-
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
78-
sigs.k8s.io/yaml v1.3.0 // indirect
72+
k8s.io/apiextensions-apiserver v0.30.1 // indirect
73+
k8s.io/klog/v2 v2.120.1 // indirect
74+
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
75+
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
76+
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
77+
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
78+
sigs.k8s.io/yaml v1.4.0 // indirect
7979
)

0 commit comments

Comments
 (0)