Skip to content

Conversation

@rushmash91
Copy link
Member

fixes aws-controllers-k8s/community#2561

Description of changes:
Controller assumes a security group does not exist if the Status.ID is empty. During adoption, users might want to adopt the resource by its name, as the ID is not trivial to guess (the security group ID is generated by AWS).

These changes are adding one API call only when the Status.ID is empty. Here we would make a single DescribeSecurityGroups call filtering by name and VPC ID, and populate the resource ID, to be used in subsequent API calls.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Comment on lines +753 to +754
sdk_read_many_pre_build_request:
template_path: hooks/security_group/sdk_read_many_pre_build_request.go.tpl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep probably a future improvement for all the CRDs using this technique.

Copy link
Member

@a-hilaly a-hilaly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rushmash91 !
/lgtm

@ack-prow ack-prow bot added the lgtm Indicates that a PR is ready to be merged. label Sep 12, 2025
@ack-prow
Copy link

ack-prow bot commented Sep 12, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: a-hilaly, rushmash91

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [a-hilaly,rushmash91]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-prow ack-prow bot merged commit e16d479 into aws-controllers-k8s:main Sep 12, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[EC2][Security Groups] Allow adopt-or-create annotation to use SecurityGroup Name

3 participants