-
Notifications
You must be signed in to change notification settings - Fork 398
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
elb_application_lb with empty security groups list behaves inconsistently on create/update #28
Comments
Files identified in the description: If these files are inaccurate, please update the |
@briantist Thank you for reporting this! We have recently this module to our CI so it should be easier to add a test case for this. |
imo you can create ALB resources only in a VPC. the only way to solve this issue is imo to not allow an empty array as an input for |
I believe that "use the default VPC SG" is a desirable option in some/many use cases, so I wouldn't want to see that option disappear. It would be most useful if the module handled that case correctly, even if internally it means it has to retrieve the VPC default in order to verify its state. |
I can work on this @briantist @markuman. Expected behavior is treat empty array as "use the VPCs default security group" ? |
@jatorcasso kind of yes, that's already what happens on first creation; the problem is that running it again will fail. So when the ALB already exists, the module needs to have a way to verify the current state, and that part is not working now. It may require reading the default SG from the VPC in order to verify. It might also be desirable to have "use the default VPC" as a separate option and then disallow the empty SG list, not sure... I might also suggest that no security group option supplied, when the ALB exists, might mean "don't check or change the state of SGs" but that is a behavioral change. |
If that's what happens on first creation, then that's what should happen after first creation as well imo to maintain idempotence. I'll work on that and add some integration tests to validate |
elb_application_lb - treat empty security group as VPC default SUMMARY Fixes idempotency issue when security_groups = [] by treating [] as using the VPC's default security group (like it does on creation). Fixes #28 Used same logic as amazon.aws.ec2_vpc_route_table does for using default igw Added integration tests ISSUE TYPE Bugfix Pull Request COMPONENT NAME elb_application_lb Reviewed-by: Jill R <None> Reviewed-by: Mark Woolley <[email protected]>
…le-collections#971) elb_application_lb - treat empty security group as VPC default SUMMARY Fixes idempotency issue when security_groups = [] by treating [] as using the VPC's default security group (like it does on creation). Fixes ansible-collections#28 Used same logic as amazon.aws.ec2_vpc_route_table does for using default igw Added integration tests ISSUE TYPE Bugfix Pull Request COMPONENT NAME elb_application_lb Reviewed-by: Jill R <None> Reviewed-by: Mark Woolley <[email protected]> (cherry picked from commit 20b726a)
Resubmitted from ansible-collections/amazon.aws#10
SUMMARY
elb_application_lb
requires thesecurity_groups
option whenstate=present
as explained in the docs (although it also says that the default is[]
which seems useless since it won't accept the option being omitted).When creating a new ALB and supplying
security_groups: []
explicitly, the ALB is created successfully with the VPC default SG.Running the same task again will fail with the error that the
security_groups
option is missing,I'm not sure if this is reproducible outside of a VPC since I'm not sure there is such a thing as a default SG in that case.
ISSUE TYPE
COMPONENT NAME
elb_application_lb
ANSIBLE VERSION
2.9.6
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
ALB is created, then second run is
ok
.(an acceptable result might also be that the first run fails with an invalid option value, but that does preclude the possibility of using a "default" SG)
ACTUAL RESULTS
Second run fails.
The text was updated successfully, but these errors were encountered: