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

Fix ES domain creation when transient errors occur #11663

Merged
merged 3 commits into from
Jan 28, 2020

Conversation

obourdon
Copy link
Contributor

@obourdon obourdon commented Jan 19, 2020

Fix for issue #7725

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 #7725

Release note for CHANGELOG:

BUG FIXES:
* aws_elasticsearch_domain failed with ValidationException: Authentication error status code: 400

Output from acceptance testing:

$ $ AWS_DEFAULT_REGION=eu-west-1 AWS_PROFILE=scratch gmake testacc TEST=./aws TESTARGS='-run=TestAccAWSElasticSearchDomain'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSElasticSearchDomain -timeout 120m
=== RUN   TestAccAWSElasticSearchDomainPolicy_basic
=== PAUSE TestAccAWSElasticSearchDomainPolicy_basic
=== RUN   TestAccAWSElasticSearchDomain_basic
=== PAUSE TestAccAWSElasticSearchDomain_basic
=== RUN   TestAccAWSElasticSearchDomain_ClusterConfig_ZoneAwarenessConfig
=== PAUSE TestAccAWSElasticSearchDomain_ClusterConfig_ZoneAwarenessConfig
=== RUN   TestAccAWSElasticSearchDomain_withDedicatedMaster
=== PAUSE TestAccAWSElasticSearchDomain_withDedicatedMaster
=== RUN   TestAccAWSElasticSearchDomain_duplicate
=== PAUSE TestAccAWSElasticSearchDomain_duplicate
=== RUN   TestAccAWSElasticSearchDomain_v23
=== PAUSE TestAccAWSElasticSearchDomain_v23
=== RUN   TestAccAWSElasticSearchDomain_complex
=== PAUSE TestAccAWSElasticSearchDomain_complex
=== RUN   TestAccAWSElasticSearchDomain_vpc
=== PAUSE TestAccAWSElasticSearchDomain_vpc
=== RUN   TestAccAWSElasticSearchDomain_vpc_update
=== PAUSE TestAccAWSElasticSearchDomain_vpc_update
=== RUN   TestAccAWSElasticSearchDomain_internetToVpcEndpoint
=== PAUSE TestAccAWSElasticSearchDomain_internetToVpcEndpoint
=== RUN   TestAccAWSElasticSearchDomain_LogPublishingOptions
=== PAUSE TestAccAWSElasticSearchDomain_LogPublishingOptions
=== RUN   TestAccAWSElasticSearchDomain_CognitoOptionsCreateAndRemove
=== PAUSE TestAccAWSElasticSearchDomain_CognitoOptionsCreateAndRemove
=== RUN   TestAccAWSElasticSearchDomain_CognitoOptionsUpdate
=== PAUSE TestAccAWSElasticSearchDomain_CognitoOptionsUpdate
=== RUN   TestAccAWSElasticSearchDomain_policy
=== PAUSE TestAccAWSElasticSearchDomain_policy
=== RUN   TestAccAWSElasticSearchDomain_encrypt_at_rest_default_key
=== PAUSE TestAccAWSElasticSearchDomain_encrypt_at_rest_default_key
=== RUN   TestAccAWSElasticSearchDomain_encrypt_at_rest_specify_key
=== PAUSE TestAccAWSElasticSearchDomain_encrypt_at_rest_specify_key
=== RUN   TestAccAWSElasticSearchDomain_NodeToNodeEncryption
=== PAUSE TestAccAWSElasticSearchDomain_NodeToNodeEncryption
=== RUN   TestAccAWSElasticSearchDomain_tags
=== PAUSE TestAccAWSElasticSearchDomain_tags
=== RUN   TestAccAWSElasticSearchDomain_update
=== PAUSE TestAccAWSElasticSearchDomain_update
=== RUN   TestAccAWSElasticSearchDomain_update_volume_type
=== PAUSE TestAccAWSElasticSearchDomain_update_volume_type
=== RUN   TestAccAWSElasticSearchDomain_update_version
=== PAUSE TestAccAWSElasticSearchDomain_update_version
=== CONT  TestAccAWSElasticSearchDomainPolicy_basic
=== CONT  TestAccAWSElasticSearchDomain_CognitoOptionsCreateAndRemove
=== CONT  TestAccAWSElasticSearchDomain_LogPublishingOptions
=== CONT  TestAccAWSElasticSearchDomain_policy
=== CONT  TestAccAWSElasticSearchDomain_v23
=== CONT  TestAccAWSElasticSearchDomain_withDedicatedMaster
=== CONT  TestAccAWSElasticSearchDomain_CognitoOptionsUpdate
=== CONT  TestAccAWSElasticSearchDomain_update_version
=== CONT  TestAccAWSElasticSearchDomain_complex
=== CONT  TestAccAWSElasticSearchDomain_update
=== CONT  TestAccAWSElasticSearchDomain_vpc_update
=== CONT  TestAccAWSElasticSearchDomain_internetToVpcEndpoint
=== CONT  TestAccAWSElasticSearchDomain_vpc
=== CONT  TestAccAWSElasticSearchDomain_encrypt_at_rest_default_key
=== CONT  TestAccAWSElasticSearchDomain_NodeToNodeEncryption
=== CONT  TestAccAWSElasticSearchDomain_encrypt_at_rest_specify_key
=== CONT  TestAccAWSElasticSearchDomain_duplicate
=== CONT  TestAccAWSElasticSearchDomain_ClusterConfig_ZoneAwarenessConfig
=== CONT  TestAccAWSElasticSearchDomain_tags
=== CONT  TestAccAWSElasticSearchDomain_update_volume_type
--- PASS: TestAccAWSElasticSearchDomain_duplicate (500.07s)
=== CONT  TestAccAWSElasticSearchDomain_basic
--- PASS: TestAccAWSElasticSearchDomain_tags (819.89s)
--- PASS: TestAccAWSElasticSearchDomain_encrypt_at_rest_default_key (839.54s)
--- PASS: TestAccAWSElasticSearchDomain_policy (1075.47s)
--- PASS: TestAccAWSElasticSearchDomain_complex (1098.33s)
--- PASS: TestAccAWSElasticSearchDomain_v23 (1104.13s)
--- PASS: TestAccAWSElasticSearchDomain_LogPublishingOptions (1185.27s)
--- PASS: TestAccAWSElasticSearchDomain_encrypt_at_rest_specify_key (1257.04s)
--- PASS: TestAccAWSElasticSearchDomain_basic (884.73s)
--- PASS: TestAccAWSElasticSearchDomainPolicy_basic (1414.86s)
--- PASS: TestAccAWSElasticSearchDomain_NodeToNodeEncryption (1446.40s)
--- PASS: TestAccAWSElasticSearchDomain_vpc (1650.59s)
--- PASS: TestAccAWSElasticSearchDomain_CognitoOptionsUpdate (1812.42s)
--- PASS: TestAccAWSElasticSearchDomain_internetToVpcEndpoint (2266.66s)
--- PASS: TestAccAWSElasticSearchDomain_CognitoOptionsCreateAndRemove (2341.65s)
--- PASS: TestAccAWSElasticSearchDomain_update (2789.07s)
--- PASS: TestAccAWSElasticSearchDomain_vpc_update (2904.30s)
--- PASS: TestAccAWSElasticSearchDomain_withDedicatedMaster (3019.82s)
--- PASS: TestAccAWSElasticSearchDomain_update_version (3148.25s)
--- PASS: TestAccAWSElasticSearchDomain_update_volume_type (3173.39s)
--- PASS: TestAccAWSElasticSearchDomain_ClusterConfig_ZoneAwarenessConfig (4686.86s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	4686.955s
$

@obourdon obourdon requested a review from a team January 19, 2020 13:03
@ghost ghost added size/XS Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. service/elasticsearch Issues and PRs that pertain to the elasticsearch service. labels Jan 19, 2020
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Hi @obourdon 👋 Thank you for submitting this. A few small things and this should be good to get in. Please let us know if you have any questions or do not have time to implement the feedback items.

@bflad bflad added bug Addresses a defect in current functionality. waiting-response Maintainers are waiting on response from community or contributor. and removed needs-triage Waiting for first response or review from a maintainer. labels Jan 24, 2020
@bflad bflad self-assigned this Jan 24, 2020
@obourdon obourdon requested a review from bflad January 24, 2020 17:50
@bflad bflad removed the waiting-response Maintainers are waiting on response from community or contributor. label Jan 24, 2020
@bflad bflad added this to the v2.47.0 milestone Jan 24, 2020
@obourdon
Copy link
Contributor Author

Strangely I got this error running acceptance tests on eu-west-1 zone:

--- FAIL: TestAccAWSElasticSearchDomain_update_version (1461.03s)
    testing.go:640: Step 2 error: Check failed: Check 3/3 error: aws_elasticsearch_domain.test: Attribute 'elasticsearch_version' expected "5.6", got "5.5"

@bflad
Copy link
Contributor

bflad commented Jan 24, 2020

@obourdon that one has occasionally shown up in our daily acceptance testing from us-west-2 as well -- we should probably create a GitHub issue to capture it for eventual fixing.

@obourdon
Copy link
Contributor Author

Oops, I now know that this error sometimes occurs (see comment above) but it seems like
version numbers are not that predictible :-(

--- FAIL: TestAccAWSElasticSearchDomain_update_version (3614.61s)
    testing.go:640: Step 3 error: Check failed: Check 3/3 error: aws_elasticsearch_domain.test: Attribute 'elasticsearch_version' expected "6.3", got "5.6"

1 similar comment
@obourdon
Copy link
Contributor Author

Oops, I now know that this error sometimes occurs (see comment above) but it seems like
version numbers are not that predictible :-(

--- FAIL: TestAccAWSElasticSearchDomain_update_version (3614.61s)
    testing.go:640: Step 3 error: Check failed: Check 3/3 error: aws_elasticsearch_domain.test: Attribute 'elasticsearch_version' expected "6.3", got "5.6"

@obourdon
Copy link
Contributor Author

Horray!!!!

$ AWS_DEFAULT_REGION=eu-west-1 AWS_PROFILE=dev gmake testacc TEST=./aws TESTARGS='-run=TestAccAWSElasticSearchDomain'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSElasticSearchDomain -timeout 120m
=== RUN   TestAccAWSElasticSearchDomainPolicy_basic
=== PAUSE TestAccAWSElasticSearchDomainPolicy_basic
=== RUN   TestAccAWSElasticSearchDomain_basic
=== PAUSE TestAccAWSElasticSearchDomain_basic
=== RUN   TestAccAWSElasticSearchDomain_ClusterConfig_ZoneAwarenessConfig
=== PAUSE TestAccAWSElasticSearchDomain_ClusterConfig_ZoneAwarenessConfig
=== RUN   TestAccAWSElasticSearchDomain_withDedicatedMaster
=== PAUSE TestAccAWSElasticSearchDomain_withDedicatedMaster
=== RUN   TestAccAWSElasticSearchDomain_duplicate
=== PAUSE TestAccAWSElasticSearchDomain_duplicate
=== RUN   TestAccAWSElasticSearchDomain_v23
=== PAUSE TestAccAWSElasticSearchDomain_v23
=== RUN   TestAccAWSElasticSearchDomain_complex
=== PAUSE TestAccAWSElasticSearchDomain_complex
=== RUN   TestAccAWSElasticSearchDomain_vpc
=== PAUSE TestAccAWSElasticSearchDomain_vpc
=== RUN   TestAccAWSElasticSearchDomain_vpc_update
=== PAUSE TestAccAWSElasticSearchDomain_vpc_update
=== RUN   TestAccAWSElasticSearchDomain_internetToVpcEndpoint
=== PAUSE TestAccAWSElasticSearchDomain_internetToVpcEndpoint
=== RUN   TestAccAWSElasticSearchDomain_LogPublishingOptions
=== PAUSE TestAccAWSElasticSearchDomain_LogPublishingOptions
=== RUN   TestAccAWSElasticSearchDomain_CognitoOptionsCreateAndRemove
=== PAUSE TestAccAWSElasticSearchDomain_CognitoOptionsCreateAndRemove
=== RUN   TestAccAWSElasticSearchDomain_CognitoOptionsUpdate
=== PAUSE TestAccAWSElasticSearchDomain_CognitoOptionsUpdate
=== RUN   TestAccAWSElasticSearchDomain_policy
=== PAUSE TestAccAWSElasticSearchDomain_policy
=== RUN   TestAccAWSElasticSearchDomain_encrypt_at_rest_default_key
=== PAUSE TestAccAWSElasticSearchDomain_encrypt_at_rest_default_key
=== RUN   TestAccAWSElasticSearchDomain_encrypt_at_rest_specify_key
=== PAUSE TestAccAWSElasticSearchDomain_encrypt_at_rest_specify_key
=== RUN   TestAccAWSElasticSearchDomain_NodeToNodeEncryption
=== PAUSE TestAccAWSElasticSearchDomain_NodeToNodeEncryption
=== RUN   TestAccAWSElasticSearchDomain_tags
=== PAUSE TestAccAWSElasticSearchDomain_tags
=== RUN   TestAccAWSElasticSearchDomain_update
=== PAUSE TestAccAWSElasticSearchDomain_update
=== RUN   TestAccAWSElasticSearchDomain_update_volume_type
=== PAUSE TestAccAWSElasticSearchDomain_update_volume_type
=== RUN   TestAccAWSElasticSearchDomain_update_version
=== PAUSE TestAccAWSElasticSearchDomain_update_version
=== CONT  TestAccAWSElasticSearchDomainPolicy_basic
=== CONT  TestAccAWSElasticSearchDomain_update_volume_type
=== CONT  TestAccAWSElasticSearchDomain_encrypt_at_rest_specify_key
=== CONT  TestAccAWSElasticSearchDomain_encrypt_at_rest_default_key
=== CONT  TestAccAWSElasticSearchDomain_update
=== CONT  TestAccAWSElasticSearchDomain_tags
=== CONT  TestAccAWSElasticSearchDomain_NodeToNodeEncryption
=== CONT  TestAccAWSElasticSearchDomain_v23
=== CONT  TestAccAWSElasticSearchDomain_ClusterConfig_ZoneAwarenessConfig
=== CONT  TestAccAWSElasticSearchDomain_vpc_update
=== CONT  TestAccAWSElasticSearchDomain_vpc
=== CONT  TestAccAWSElasticSearchDomain_complex
=== CONT  TestAccAWSElasticSearchDomain_CognitoOptionsCreateAndRemove
=== CONT  TestAccAWSElasticSearchDomain_update_version
=== CONT  TestAccAWSElasticSearchDomain_LogPublishingOptions
=== CONT  TestAccAWSElasticSearchDomain_internetToVpcEndpoint
=== CONT  TestAccAWSElasticSearchDomain_duplicate
=== CONT  TestAccAWSElasticSearchDomain_policy
=== CONT  TestAccAWSElasticSearchDomain_withDedicatedMaster
=== CONT  TestAccAWSElasticSearchDomain_CognitoOptionsUpdate
--- PASS: TestAccAWSElasticSearchDomain_duplicate (493.34s)
=== CONT  TestAccAWSElasticSearchDomain_basic
--- PASS: TestAccAWSElasticSearchDomain_v23 (732.88s)
--- PASS: TestAccAWSElasticSearchDomain_LogPublishingOptions (818.37s)
--- PASS: TestAccAWSElasticSearchDomain_NodeToNodeEncryption (885.62s)
--- PASS: TestAccAWSElasticSearchDomain_complex (1060.34s)
--- PASS: TestAccAWSElasticSearchDomain_encrypt_at_rest_specify_key (1172.39s)
--- PASS: TestAccAWSElasticSearchDomain_tags (1186.26s)
--- PASS: TestAccAWSElasticSearchDomain_encrypt_at_rest_default_key (1203.41s)
--- PASS: TestAccAWSElasticSearchDomain_vpc (1316.60s)
--- PASS: TestAccAWSElasticSearchDomainPolicy_basic (1579.99s)
--- PASS: TestAccAWSElasticSearchDomain_basic (1225.71s)
--- PASS: TestAccAWSElasticSearchDomain_internetToVpcEndpoint (1860.72s)
--- PASS: TestAccAWSElasticSearchDomain_policy (1897.85s)
--- PASS: TestAccAWSElasticSearchDomain_update (2099.56s)
--- PASS: TestAccAWSElasticSearchDomain_CognitoOptionsCreateAndRemove (2730.13s)
--- PASS: TestAccAWSElasticSearchDomain_CognitoOptionsUpdate (2916.41s)
--- PASS: TestAccAWSElasticSearchDomain_update_volume_type (3118.60s)
--- PASS: TestAccAWSElasticSearchDomain_vpc_update (3160.84s)
--- PASS: TestAccAWSElasticSearchDomain_withDedicatedMaster (3217.15s)
--- PASS: TestAccAWSElasticSearchDomain_update_version (3525.03s)
--- PASS: TestAccAWSElasticSearchDomain_ClusterConfig_ZoneAwarenessConfig (5415.92s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	5416.012s

Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @obourdon 🚀

--- PASS: TestAccAWSElasticSearchDomain_basic (579.31s)
--- PASS: TestAccAWSElasticSearchDomain_v23 (669.14s)
--- PASS: TestAccAWSElasticSearchDomain_NodeToNodeEncryption (701.33s)
--- PASS: TestAccAWSElasticSearchDomain_encrypt_at_rest_default_key (932.47s)
--- PASS: TestAccAWSElasticSearchDomain_policy (940.40s)
--- PASS: TestAccAWSElasticSearchDomain_tags (950.35s)
--- PASS: TestAccAWSElasticSearchDomain_LogPublishingOptions (1091.94s)
--- PASS: TestAccAWSElasticSearchDomain_vpc (1095.74s)
--- PASS: TestAccAWSElasticSearchDomain_complex (1244.80s)
--- PASS: TestAccAWSElasticSearchDomain_duplicate (1605.50s)
--- PASS: TestAccAWSElasticSearchDomainPolicy_basic (1677.87s)
--- PASS: TestAccAWSElasticSearchDomain_CognitoOptionsUpdate (2106.02s)
--- PASS: TestAccAWSElasticSearchDomain_encrypt_at_rest_specify_key (2164.41s)
--- PASS: TestAccAWSElasticSearchDomain_CognitoOptionsCreateAndRemove (2317.78s)
--- PASS: TestAccAWSElasticSearchDomain_vpc_update (2333.84s)
--- PASS: TestAccAWSElasticSearchDomain_internetToVpcEndpoint (2334.14s)
--- PASS: TestAccAWSElasticSearchDomain_update (2357.92s)
--- PASS: TestAccAWSElasticSearchDomain_withDedicatedMaster (3018.87s)
--- PASS: TestAccAWSElasticSearchDomain_update_version (2838.61s)
--- PASS: TestAccAWSElasticSearchDomain_update_volume_type (3488.42s)
--- PASS: TestAccAWSElasticSearchDomain_ClusterConfig_ZoneAwarenessConfig (5392.78s)

@bflad bflad merged commit 5c88d2d into hashicorp:master Jan 28, 2020
bflad added a commit that referenced this pull request Jan 28, 2020
@obourdon
Copy link
Contributor Author

@bflad many thanks for integrating this

@ghost
Copy link

ghost commented Jan 30, 2020

This has been released in version 2.47.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!

@obourdon obourdon deleted the es-fix-transient-errors branch February 3, 2020 08:32
@ghost
Copy link

ghost commented Mar 27, 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 Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/elasticsearch Issues and PRs that pertain to the elasticsearch service. 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.

aws_elasticsearch_domain failed with ValidationException: Authentication error status code: 400
2 participants