Skip to content

Improve security group fixture for EC2 #12607

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

Merged
merged 2 commits into from
May 13, 2025
Merged

Conversation

giograno
Copy link
Member

Motivation

While working on snapshotted tests, I wanted to have the possibility to pass to ec2_create_security_group an IP protocol for the ingress permissions.

I also noticed that this fixture is also duplicated in the ELB test (I removed it in the linked PR);

Changes

  • Adding the ip_protocol to the fixture's factory function;
  • Added docstrings;

@giograno giograno added this to the 4.5 milestone May 12, 2025
@giograno giograno requested a review from viren-nadkarni May 12, 2025 16:50
@giograno giograno added the semver: patch Non-breaking changes which can be included in patch releases label May 12, 2025
Copy link

github-actions bot commented May 12, 2025

LocalStack Community integration with Pro

    2 files  ±0      2 suites  ±0   1h 43m 51s ⏱️ + 1m 22s
4 425 tests ±0  4 042 ✅ ±0  383 💤 ±0  0 ❌ ±0 
4 427 runs  ±0  4 042 ✅ ±0  385 💤 ±0  0 ❌ ±0 

Results for commit 307f11a. ± Comparison against base commit b961fee.

♻️ This comment has been updated with latest results.

@giograno giograno marked this pull request as ready for review May 12, 2025 18:46
@giograno giograno requested a review from dominikschubert as a code owner May 12, 2025 18:46
@giograno giograno removed the request for review from dominikschubert May 12, 2025 18:46
Copy link
Member

@viren-nadkarni viren-nadkarni left a comment

Choose a reason for hiding this comment

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

Looks good, just a small request to add a detailed comment.

GroupName=kwargs["GroupName"],
IpPermissions=permissions,
)
if "VpcId" not in kwargs:
Copy link
Member

Choose a reason for hiding this comment

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

Could you elaborate in a comment why the special cases are required?

Copy link
Member Author

Choose a reason for hiding this comment

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

I actually got rid of the condition at all. We can use the GroupId always (but we could use GroupName for the default VPC only)

    Default security group can use GroupName instead of the GroupId, but
    the latter works in all cases
@giograno giograno merged commit edb9628 into master May 13, 2025
32 checks passed
@giograno giograno deleted the codepipeline/blue-green branch May 13, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants