-
Notifications
You must be signed in to change notification settings - Fork 397
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
rds_instance: Add purge_security_groups #500
Conversation
@s-hertel Could you please take a look at this? |
* Sanity fix Signed-off-by: Alina Buzachis <[email protected]>
@alinabuzachis Yes, will review in a day or two. Thanks for fixing this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
I was wondering if there is a way to only show security groups with an active status or however wait until a security group passes from "adding" to "active".
You could add a waiter to return only 'active' security groups by using a pathAll matcher - something like
"DBInstanceActiveSecurityGroups": {
"delay": 20,
"maxAttempts": 60,
"operation": "DescribeDBInstances",
"acceptors": [
{
"state": "success",
"matcher": "pathAll",
"argument": "DBInstances[].VpcSecurityGroups[].Status",
"expected": "active" # check if this is lowercase pre-camel_to_snake_case
},
{
"state": "success",
"matcher": "pathAll",
"argument": "DBInstances[].DBSecurityGroups[].Status",
"expected": "active"
},
}
But I actually like this as it is, so it's your call/others can weigh in if that would be useful.
* Add changelog Signed-off-by: Alina Buzachis <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good. A couple of white-space nit-picks.
I'm currently running the tests locally, assuming they pass I'll get this merged.
tests/integration/targets/rds_instance/tasks/test_vpc_security_groups.yml
Outdated
Show resolved
Hide resolved
tests/integration/targets/rds_instance/tasks/test_vpc_security_groups.yml
Outdated
Show resolved
Hide resolved
tests/integration/targets/rds_instance/tasks/test_vpc_security_groups.yml
Show resolved
Hide resolved
tests/integration/targets/rds_instance/tasks/test_vpc_security_groups.yml
Show resolved
Hide resolved
tests/integration/targets/rds_instance/tasks/test_vpc_security_groups.yml
Outdated
Show resolved
Hide resolved
tests/integration/targets/rds_instance/tasks/test_vpc_security_groups.yml
Outdated
Show resolved
Hide resolved
Tests passed successfully after unrelated fixes. |
* rds_instance: Add purge_security_groups feature for vpc_security_groups_ids. * Fixes: ansible-collections#385
* rds_instance: Add purge_security_groups feature for vpc_security_groups_ids. * Fixes: ansible-collections#385
* rds_instance: Add purge_security_groups feature for vpc_security_groups_ids. * Fixes: ansible-collections#385
Add debugging info to ENI tests SUMMARY We're seeing some flakes, describe the ENIs before we nuke them to try and see where the issue might be. ISSUE TYPE Feature Pull Request COMPONENT NAME ec2_eni ADDITIONAL INFORMATION Example failure: waiter timeout: https://ebf5fd30c6ae7bcc0e77-bb555a5b613b25366f4ba04980cee756.ssl.cf1.rackcdn.com/488/2808477252b5339f2f1af24f1658f756c8b3b931/check/ansible-test-cloud-integration-aws-py36_1/975c9cb/job-output.txt Reviewed-by: None <None>
* rds_instance: Add purge_security_groups feature for vpc_security_groups_ids. * Fixes: ansible-collections#385 This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections@cd32e65
SUMMARY
rds_instance: Add
purge_security_groups
parameter for bothdb_security_groups
andvpc_security_groups_ids
.Should fix: #385
ISSUE TYPE
COMPONENT NAME
rds_instance
ADDITIONAL INFORMATION
According to the boto3 documentation https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/rds.html#RDS.Client.describe_db_instances,
describe_db_instances()
provides this information for the associated security groupsWith this patch the status is reflected accordingly as showed in the following example.
This gives:
And then if we want to set the a new security group
sg-3
(purge_security_groups=True by default).The log produced:
Since some vpc security groups are reported "removing" status, do we want to show them? Others are also with "adding" state. I was wondering if there is a way to only show security groups with an active status or however wait until a security group passes from "adding" to "active".