-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
resource/aws_directory_service_directory: Deletion and sweeper refactoring #16653
Conversation
…oring A few changes to handle some API oddities and improve sweeper behavior: - Add `aws_db_instance` to sweeper dependencies since MSSQL databases attached to directories can cause ` ClientException: Cannot delete the directory because it still has authorized applications` errors - Implement multiple error handling in sweeper - Skip `ErrCodeEntityDoesNotExistException` errors on deletion to prevent real world issues with stale plans and since sometimes the `DescribeDirectories` API can return directories that will return this error on deletion Output from acceptance test in AWS Commercial: ``` --- PASS: TestAccAWSDirectoryServiceDirectory_basic (1143.67s) --- PASS: TestAccAWSDirectoryServiceDirectory_connector (1261.53s) --- PASS: TestAccAWSDirectoryServiceDirectory_disappears (620.70s) --- PASS: TestAccAWSDirectoryServiceDirectory_microsoft (1873.90s) --- PASS: TestAccAWSDirectoryServiceDirectory_microsoftStandard (1734.15s) --- PASS: TestAccAWSDirectoryServiceDirectory_tags (1178.94s) --- PASS: TestAccAWSDirectoryServiceDirectory_withAliasAndSso (798.85s) ``` Output from sweeper in AWS Commercial: ``` 2020/12/08 13:51:37 [DEBUG] Running Sweepers for region (us-west-2): 2020/12/08 13:51:37 [DEBUG] Running Sweeper (aws_workspaces_workspace) in region (us-west-2) 2020/12/08 13:51:39 [DEBUG] Running Sweeper (aws_workspaces_directory) in region (us-west-2) 2020/12/08 13:51:39 [DEBUG] Running Sweeper (aws_db_instance) in region (us-west-2) ... 2020/12/08 13:55:50 [DEBUG] Running Sweeper (aws_fsx_windows_file_system) in region (us-west-2) 2020/12/08 13:55:51 [DEBUG] Running Sweeper (aws_directory_service_directory) in region (us-west-2) ... 2020/12/08 17:27:50 Sweeper Tests ran successfully: - aws_workspaces_workspace - aws_workspaces_directory - aws_db_instance - aws_fsx_windows_file_system - aws_directory_service_directory 2020/12/08 17:27:50 [DEBUG] Running Sweepers for region (us-east-1): 2020/12/08 17:27:50 [DEBUG] Running Sweeper (aws_workspaces_workspace) in region (us-east-1) 2020/12/08 17:27:51 [DEBUG] Running Sweeper (aws_db_instance) in region (us-east-1) 2020/12/08 17:27:51 [DEBUG] Running Sweeper (aws_fsx_windows_file_system) in region (us-east-1) 2020/12/08 17:27:51 [DEBUG] Running Sweeper (aws_workspaces_directory) in region (us-east-1) 2020/12/08 17:27:51 [DEBUG] Running Sweeper (aws_directory_service_directory) in region (us-east-1) 2020/12/08 17:27:52 Sweeper Tests ran successfully: - aws_workspaces_workspace - aws_db_instance - aws_fsx_windows_file_system - aws_workspaces_directory - aws_directory_service_directory ok github.com/terraform-providers/terraform-provider-aws/aws 8918.345s ```
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.
LGTM 🚀
This has been released in version 3.22.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Release note for CHANGELOG:
A few changes to handle some API oddities and improve sweeper behavior:
aws_db_instance
to sweeper dependencies since MSSQL databases attached to directories can causeClientException: Cannot delete the directory because it still has authorized applications
errorsErrCodeEntityDoesNotExistException
errors on deletion to prevent real world issues with stale plans and since sometimes theDescribeDirectories
API can return directories that will return this error on deletionOutput from acceptance test in AWS Commercial:
Output from sweeper in AWS Commercial: