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

tests/service/ec2: Add aws_ec2_client_vpn_network_association sweeper #14116

Closed

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Jul 9, 2020

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #14115

Release note for CHANGELOG:

NONE

Output from sweeper:

$ go test ./aws -v -timeout=10h -sweep-allow-failures -sweep=us-west-2 -sweep-run=aws_ec2_client_vpn_endpoint
2020/07/09 09:18:19 [WARN] Sweeper has dependency (aws_workspaces_workspace), but that sweeper was not found
2020/07/09 09:18:19 [DEBUG] Running Sweepers for region (us-west-2):
2020/07/09 09:18:19 [DEBUG] Running Sweeper (aws_fsx_windows_file_system) in region (us-west-2)
2020/07/09 09:18:19 [INFO] Building AWS auth structure
2020/07/09 09:18:19 [INFO] Setting AWS metadata API timeout to 100ms
2020/07/09 09:18:19 [INFO] Ignoring AWS metadata API endpoint at default location as it doesn't return any instance-id
2020/07/09 09:18:19 [INFO] AWS Auth provider used: "SharedCredentialsProvider"
2020/07/09 09:18:19 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2020/07/09 09:18:19 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2020/07/09 09:18:21 [WARN] Sweeper (aws_workspaces_directory) has dependency (aws_workspaces_workspace), but that sweeper was not found
2020/07/09 09:18:21 [DEBUG] Running Sweeper (aws_workspaces_directory) in region (us-west-2)
2020/07/09 09:18:21 [DEBUG] Running Sweeper (aws_ec2_client_vpn_network_association) in region (us-west-2)
2020/07/09 09:18:23 [INFO] Deleting EC2 Client VPN Target Network: cvpn-assoc-061760dfeca46f8de
2020/07/09 09:18:24 [DEBUG] Waiting for Client VPN endpoint to disassociate with target network: cvpn-assoc-061760dfeca46f8de
2020/07/09 09:18:24 [DEBUG] Waiting for state to become: [disassociated]
2020/07/09 09:23:22 [INFO] Deleting EC2 Client VPN Target Network: cvpn-assoc-0c84136d3bb041419
2020/07/09 09:23:22 [DEBUG] Waiting for Client VPN endpoint to disassociate with target network: cvpn-assoc-0c84136d3bb041419
2020/07/09 09:23:22 [DEBUG] Waiting for state to become: [disassociated]
2020/07/09 09:27:48 [DEBUG] Sweeper (aws_ec2_client_vpn_endpoint) has dependency (aws_directory_service_directory), running..
2020/07/09 09:27:48 [DEBUG] Sweeper (aws_directory_service_directory) has dependency (aws_fsx_windows_file_system), running..
2020/07/09 09:27:48 [DEBUG] Sweeper (aws_fsx_windows_file_system) already ran in region (us-west-2)
2020/07/09 09:27:48 [DEBUG] Sweeper (aws_directory_service_directory) has dependency (aws_workspaces_directory), running..
2020/07/09 09:27:48 [WARN] Sweeper (aws_workspaces_directory) has dependency (aws_workspaces_workspace), but that sweeper was not found
2020/07/09 09:27:48 [DEBUG] Sweeper (aws_workspaces_directory) already ran in region (us-west-2)
2020/07/09 09:27:48 [DEBUG] Running Sweeper (aws_directory_service_directory) in region (us-west-2)
2020/07/09 09:27:49 [DEBUG] Sweeper (aws_ec2_client_vpn_endpoint) has dependency (aws_ec2_client_vpn_network_association), running..
2020/07/09 09:27:49 [DEBUG] Sweeper (aws_ec2_client_vpn_network_association) already ran in region (us-west-2)
2020/07/09 09:27:49 [DEBUG] Running Sweeper (aws_ec2_client_vpn_endpoint) in region (us-west-2)
2020/07/09 09:27:49 [INFO] Deleting EC2 Client VPN Endpoint: cvpn-endpoint-032094b1edaf8d7da
2020/07/09 09:27:50 [DEBUG] Waiting for state to become: []
2020/07/09 09:27:50 [INFO] Deleting EC2 Client VPN Endpoint: cvpn-endpoint-0a777253d4dd52eba
2020/07/09 09:27:51 [DEBUG] Waiting for state to become: []
2020/07/09 09:27:52 [DEBUG] Sweeper (aws_directory_service_directory) has dependency (aws_fsx_windows_file_system), running..
2020/07/09 09:27:52 [DEBUG] Sweeper (aws_fsx_windows_file_system) already ran in region (us-west-2)
2020/07/09 09:27:52 [DEBUG] Sweeper (aws_directory_service_directory) has dependency (aws_workspaces_directory), running..
2020/07/09 09:27:52 [WARN] Sweeper (aws_workspaces_directory) has dependency (aws_workspaces_workspace), but that sweeper was not found
2020/07/09 09:27:52 [DEBUG] Sweeper (aws_workspaces_directory) already ran in region (us-west-2)
2020/07/09 09:27:52 [DEBUG] Sweeper (aws_directory_service_directory) already ran in region (us-west-2)
2020/07/09 09:27:52 Sweeper Tests ran successfully:
  - aws_ec2_client_vpn_endpoint
  - aws_fsx_windows_file_system
  - aws_workspaces_directory
  - aws_ec2_client_vpn_network_association
  - aws_directory_service_directory
ok    github.com/terraform-providers/terraform-provider-aws/aws 575.715s

Reference: #14115

Output from sweeper:

```console
$ go test ./aws -v -timeout=10h -sweep-allow-failures -sweep=us-west-2 -sweep-run=aws_ec2_client_vpn_endpoint
2020/07/09 09:18:19 [WARN] Sweeper has dependency (aws_workspaces_workspace), but that sweeper was not found
2020/07/09 09:18:19 [DEBUG] Running Sweepers for region (us-west-2):
2020/07/09 09:18:19 [DEBUG] Running Sweeper (aws_fsx_windows_file_system) in region (us-west-2)
2020/07/09 09:18:19 [INFO] Building AWS auth structure
2020/07/09 09:18:19 [INFO] Setting AWS metadata API timeout to 100ms
2020/07/09 09:18:19 [INFO] Ignoring AWS metadata API endpoint at default location as it doesn't return any instance-id
2020/07/09 09:18:19 [INFO] AWS Auth provider used: "SharedCredentialsProvider"
2020/07/09 09:18:19 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2020/07/09 09:18:19 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2020/07/09 09:18:21 [WARN] Sweeper (aws_workspaces_directory) has dependency (aws_workspaces_workspace), but that sweeper was not found
2020/07/09 09:18:21 [DEBUG] Running Sweeper (aws_workspaces_directory) in region (us-west-2)
2020/07/09 09:18:21 [DEBUG] Running Sweeper (aws_ec2_client_vpn_network_association) in region (us-west-2)
2020/07/09 09:18:23 [INFO] Deleting EC2 Client VPN Target Network: cvpn-assoc-061760dfeca46f8de
2020/07/09 09:18:24 [DEBUG] Waiting for Client VPN endpoint to disassociate with target network: cvpn-assoc-061760dfeca46f8de
2020/07/09 09:18:24 [DEBUG] Waiting for state to become: [disassociated]
2020/07/09 09:23:22 [INFO] Deleting EC2 Client VPN Target Network: cvpn-assoc-0c84136d3bb041419
2020/07/09 09:23:22 [DEBUG] Waiting for Client VPN endpoint to disassociate with target network: cvpn-assoc-0c84136d3bb041419
2020/07/09 09:23:22 [DEBUG] Waiting for state to become: [disassociated]
2020/07/09 09:27:48 [DEBUG] Sweeper (aws_ec2_client_vpn_endpoint) has dependency (aws_directory_service_directory), running..
2020/07/09 09:27:48 [DEBUG] Sweeper (aws_directory_service_directory) has dependency (aws_fsx_windows_file_system), running..
2020/07/09 09:27:48 [DEBUG] Sweeper (aws_fsx_windows_file_system) already ran in region (us-west-2)
2020/07/09 09:27:48 [DEBUG] Sweeper (aws_directory_service_directory) has dependency (aws_workspaces_directory), running..
2020/07/09 09:27:48 [WARN] Sweeper (aws_workspaces_directory) has dependency (aws_workspaces_workspace), but that sweeper was not found
2020/07/09 09:27:48 [DEBUG] Sweeper (aws_workspaces_directory) already ran in region (us-west-2)
2020/07/09 09:27:48 [DEBUG] Running Sweeper (aws_directory_service_directory) in region (us-west-2)
2020/07/09 09:27:49 [DEBUG] Sweeper (aws_ec2_client_vpn_endpoint) has dependency (aws_ec2_client_vpn_network_association), running..
2020/07/09 09:27:49 [DEBUG] Sweeper (aws_ec2_client_vpn_network_association) already ran in region (us-west-2)
2020/07/09 09:27:49 [DEBUG] Running Sweeper (aws_ec2_client_vpn_endpoint) in region (us-west-2)
2020/07/09 09:27:49 [INFO] Deleting EC2 Client VPN Endpoint: cvpn-endpoint-032094b1edaf8d7da
2020/07/09 09:27:50 [DEBUG] Waiting for state to become: []
2020/07/09 09:27:50 [INFO] Deleting EC2 Client VPN Endpoint: cvpn-endpoint-0a777253d4dd52eba
2020/07/09 09:27:51 [DEBUG] Waiting for state to become: []
2020/07/09 09:27:52 [DEBUG] Sweeper (aws_directory_service_directory) has dependency (aws_fsx_windows_file_system), running..
2020/07/09 09:27:52 [DEBUG] Sweeper (aws_fsx_windows_file_system) already ran in region (us-west-2)
2020/07/09 09:27:52 [DEBUG] Sweeper (aws_directory_service_directory) has dependency (aws_workspaces_directory), running..
2020/07/09 09:27:52 [WARN] Sweeper (aws_workspaces_directory) has dependency (aws_workspaces_workspace), but that sweeper was not found
2020/07/09 09:27:52 [DEBUG] Sweeper (aws_workspaces_directory) already ran in region (us-west-2)
2020/07/09 09:27:52 [DEBUG] Sweeper (aws_directory_service_directory) already ran in region (us-west-2)
2020/07/09 09:27:52 Sweeper Tests ran successfully:
  - aws_ec2_client_vpn_endpoint
  - aws_fsx_windows_file_system
  - aws_workspaces_directory
  - aws_ec2_client_vpn_network_association
  - aws_directory_service_directory
ok    github.com/terraform-providers/terraform-provider-aws/aws 575.715s
```
@bflad bflad requested a review from a team July 9, 2020 13:37
@ghost ghost added size/M Managed by automation to categorize the size of a PR. service/ec2 Issues and PRs that pertain to the ec2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jul 9, 2020
Copy link
Contributor

@anGie44 anGie44 left a comment

Choose a reason for hiding this comment

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

LGTM -- just a comment re: error messaging

Comment on lines +58 to +62
r := resourceAwsEc2ClientVpnNetworkAssociation()
d := r.Data(nil)
d.SetId(associationID)
d.Set("client_vpn_endpoint_id", endpointID)
err := r.Delete(d, client)
Copy link
Contributor

Choose a reason for hiding this comment

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

interesting use of resource !

})

if testSweepSkipSweepError(err) {
log.Printf("[WARN] Skipping Client VPN Endpoint sweep for %s: %s", region, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

small change here to reflect the resource being sweeped: Network Association or Target Network instead of Endpoint

@bflad
Copy link
Contributor Author

bflad commented Aug 18, 2020

Replaced by #14146

@bflad bflad closed this Aug 18, 2020
@bflad bflad deleted the t-aws_ec2_client_vpn_network_association-sweeper branch August 18, 2020 16:40
@ghost
Copy link

ghost commented Sep 17, 2020

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!

@ghost ghost locked and limited conversation to collaborators Sep 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/ec2 Issues and PRs that pertain to the ec2 service. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tests/resource/aws_ec2_client_vpn_endpoint: Sweeper failing due to associations
2 participants