Skip to content
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: Adds retry when directory still has authorized applications #22027

Merged
merged 1 commit into from
Dec 3, 2021

Conversation

gdavison
Copy link
Contributor

@gdavison gdavison commented Dec 3, 2021

There is a propagation delay for unregistering applications from the Directory Service directory. This PR adds a retry when aws_directory_service_directory still has authorized applications.

Relates #20556

Before the change

$ make testacc TESTS='TestAccConnectInstance_serial/directory' PKG=connect TEST_COUNT=3

=== RUN   TestAccConnectInstance_serial
=== RUN   TestAccConnectInstance_serial/directory
--- PASS: TestAccConnectInstance_serial (913.19s)
    --- PASS: TestAccConnectInstance_serial/directory (913.19s)
=== RUN   TestAccConnectInstance_serial
=== RUN   TestAccConnectInstance_serial/directory
    testing_new.go:70: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: error deleting Directory Service Directory (d-9267770990): ClientException: Cannot delete the directory because it still has authorized applications. : RequestId: 382f7159-d266-4fc7-9555-40a2fc9fdf14
        {
          RespMetadata: {
            StatusCode: 400,
            RequestID: "382f7159-d266-4fc7-9555-40a2fc9fdf14"
          },
          Message_: "Cannot delete the directory because it still has authorized applications. : RequestId: 382f7159-d266-4fc7-9555-40a2fc9fdf14",
          RequestId: "382f7159-d266-4fc7-9555-40a2fc9fdf14"
        }
        
--- FAIL: TestAccConnectInstance_serial (467.35s)
    --- FAIL: TestAccConnectInstance_serial/directory (467.35s)
=== RUN   TestAccConnectInstance_serial
=== RUN   TestAccConnectInstance_serial/directory
    testing_new.go:70: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: error deleting Directory Service Directory (d-92677709e2): ClientException: Cannot delete the directory because it still has authorized applications. : RequestId: 21f190be-008d-45cc-b08d-d3e0b1e341dc
        {
          RespMetadata: {
            StatusCode: 400,
            RequestID: "21f190be-008d-45cc-b08d-d3e0b1e341dc"
          },
          Message_: "Cannot delete the directory because it still has authorized applications. : RequestId: 21f190be-008d-45cc-b08d-d3e0b1e341dc",
          RequestId: "21f190be-008d-45cc-b08d-d3e0b1e341dc"
        }
        
--- FAIL: TestAccConnectInstance_serial (454.25s)
    --- FAIL: TestAccConnectInstance_serial/directory (454.25s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/connect	1836.891s
FAIL

After change

$ make testacc TESTS=TestAccConnectInstance_serial/directory PKG=connect TEST_COUNT=3

=== RUN   TestAccConnectInstance_serial
=== RUN   TestAccConnectInstance_serial/directory
--- PASS: TestAccConnectInstance_serial (850.52s)
    --- PASS: TestAccConnectInstance_serial/directory (850.51s)
=== RUN   TestAccConnectInstance_serial
=== RUN   TestAccConnectInstance_serial/directory
--- PASS: TestAccConnectInstance_serial (858.79s)
    --- PASS: TestAccConnectInstance_serial/directory (858.79s)
=== RUN   TestAccConnectInstance_serial
=== RUN   TestAccConnectInstance_serial/directory
--- PASS: TestAccConnectInstance_serial (1001.44s)
    --- PASS: TestAccConnectInstance_serial/directory (1001.44s)
PASS

@github-actions github-actions bot added service/directoryservice size/XS Managed by automation to categorize the size of a PR. labels Dec 3, 2021
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

@gdavison gdavison merged commit adb46fe into main Dec 3, 2021
@gdavison gdavison deleted the directory-wait-for-apps branch December 3, 2021 22:16
@github-actions github-actions bot added this to the v3.69.0 milestone Dec 3, 2021
@github-actions
Copy link

This functionality has been released in v3.69.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. Thank you!

@github-actions
Copy link

github-actions bot commented Jun 3, 2022

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants