-
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
[Elasticsearch] Implement specifying availability zone count ... #8144
Conversation
…e awareness enabled.
Removed the WIP marker, as I think this PR is ready for review! It even has tests now! 😄 |
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.
Hi @jtcressy 👋 Thanks for submitting this. This will need a few things adjusted before it can be accepted. Please let us know if you have any questions or do not have time to implement the feedback.
Currently the other acceptance testing is failing:
--- FAIL: TestAccAWSElasticSearchDomain_update (35.17s)
testing.go:538: Step 0 error: Error applying: 1 error occurred:
* aws_elasticsearch_domain.example: 1 error occurred:
* aws_elasticsearch_domain.example: ValidationException: NumberOfAvailabilityZones should be either 2 or 3
status code: 400, request id: d692895f-5748-11e9-9abc-25f5949255f2
--- FAIL: TestAccAWSElasticSearchDomain_update_version (8.20s)
testing.go:538: Step 0 error: Error applying: 1 error occurred:
* aws_elasticsearch_domain.example: 1 error occurred:
* aws_elasticsearch_domain.example: ValidationException: ZoneAwarenessEnabled must be set to True to specify the ZoneAwarenessSettings
status code: 400, request id: db7a06b6-5748-11e9-b707-5f7cde003491
--- FAIL: TestAccAWSElasticSearchDomain_encrypt_at_rest_default_key (54.06s)
testing.go:538: Step 0 error: Error applying: 1 error occurred:
* aws_elasticsearch_domain.example: 1 error occurred:
* aws_elasticsearch_domain.example: ValidationException: ZoneAwarenessEnabled must be set to True to specify the ZoneAwarenessSettings
status code: 400, request id: e19f0e51-5748-11e9-b09e-1de5efe18623
--- FAIL: TestAccAWSElasticSearchDomain_complex (71.68s)
testing.go:538: Step 0 error: Error applying: 1 error occurred:
* aws_elasticsearch_domain.example: 1 error occurred:
* aws_elasticsearch_domain.example: ValidationException: NumberOfAvailabilityZones should be either 2 or 3
status code: 400, request id: ec15bc6d-5748-11e9-b09e-1de5efe18623
--- FAIL: TestAccAWSElasticSearchDomain_encrypt_at_rest_specify_key (82.53s)
testing.go:538: Step 0 error: Error applying: 1 error occurred:
* aws_elasticsearch_domain.example: 1 error occurred:
* aws_elasticsearch_domain.example: ValidationException: ZoneAwarenessEnabled must be set to True to specify the ZoneAwarenessSettings
status code: 400, request id: e62a3b8a-5748-11e9-b15e-f3e3bdb4bca1
--- FAIL: TestAccAWSElasticSearchDomain_vpc_update (87.55s)
testing.go:538: Step 0 error: Error applying: 1 error occurred:
* aws_elasticsearch_domain.example: 1 error occurred:
* aws_elasticsearch_domain.example: ValidationException: NumberOfAvailabilityZones should be either 2 or 3
status code: 400, request id: f35f1f92-5748-11e9-ab97-b33e6d431941
--- FAIL: TestAccAWSElasticSearchDomain_update_volume_type (90.56s)
testing.go:538: Step 0 error: Error applying: 1 error occurred:
* aws_elasticsearch_domain.example: 1 error occurred:
* aws_elasticsearch_domain.example: ValidationException: NumberOfAvailabilityZones should be either 2 or 3
status code: 400, request id: f7536447-5748-11e9-a09a-4f2eaa601f9d
--- FAIL: TestAccAWSElasticSearchDomain_vpc (107.82s)
testing.go:538: Step 0 error: Error applying: 1 error occurred:
* aws_elasticsearch_domain.example: 1 error occurred:
* aws_elasticsearch_domain.example: ValidationException: NumberOfAvailabilityZones should be either 2 or 3
status code: 400, request id: f8369866-5748-11e9-82e4-ab4437639e4f
--- FAIL: TestAccAWSElasticSearchDomain_NodeToNodeEncryption (195.56s)
testing.go:538: Step 0 error: Error applying: 1 error occurred:
* aws_elasticsearch_domain.example: 1 error occurred:
* aws_elasticsearch_domain.example: ValidationException: ZoneAwarenessEnabled must be set to True to specify the ZoneAwarenessSettings
status code: 400, request id: 35fc3149-5749-11e9-997c-35621615dd41
--- FAIL: TestAccAWSElasticSearchDomain_withDedicatedMaster (221.49s)
testing.go:538: Step 0 error: Error applying: 1 error occurred:
* aws_elasticsearch_domain.example: 1 error occurred:
* aws_elasticsearch_domain.example: ValidationException: ZoneAwarenessEnabled must be set to True to specify the ZoneAwarenessSettings
status code: 400, request id: 454d1792-5749-11e9-8cfc-a9b4ddbad0eb
--- FAIL: TestAccAWSElasticSearchDomain_internetToVpcEndpoint (669.04s)
testing.go:538: Step 1 error: Error applying: 1 error occurred:
* aws_elasticsearch_domain.example: 1 error occurred:
* aws_elasticsearch_domain.example: ValidationException: NumberOfAvailabilityZones should be either 2 or 3
status code: 400, request id: 4e0afc85-574a-11e9-a303-6be082a5aae1
@@ -194,6 +194,10 @@ func resourceAwsElasticSearchDomain() *schema.Resource { | |||
Type: schema.TypeBool, | |||
Optional: true, | |||
}, | |||
"zone_awareness_count": { |
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.
Two notes:
- This argument needs documentation added in
website/docs/r/elasticsearch_domain.html.markdown
- Since this argument is not marked
ForceNew: true
, an additionalTestStep
should be added to the acceptance test that attempts to update or remove it
testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), | ||
resource.TestCheckResourceAttr( | ||
"aws_elasticsearch_domain.example", "elasticsearch_version", "1.5"), | ||
resource.TestMatchResourceAttr("aws_elasticsearch_domain.example", "kibana_endpoint", regexp.MustCompile(".*es.amazonaws.com/_plugin/kibana/")), |
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.
Should this be testing the new attribute instead? e.g.
resource.TestMatchResourceAttr("aws_elasticsearch_domain.example", "kibana_endpoint", regexp.MustCompile(".*es.amazonaws.com/_plugin/kibana/")), | |
resource.TestCheckResourceAttr("aws_elasticsearch_domain.example", "cluster_config.0.zone_awareness_count", "3"), |
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.
Ok, i'm taking this recommendation and expanding it to multiple test steps:
- zone awareness disabled and zone awareness count set to 3
- update cluster with zone awareness enabled
- update cluster again with zone awareness disabled
- update cluster with zone awareness enabled and count set to 2
- update cluster zone aware count to 3
@bflad So, when the vpc_update validation exception of I've got some changes in strucutre.go to mimic the control structure of setting the dedicated master parameters, and i'll be committing/pushing it soon. I think it'll fix some of the problems we have right now. |
… cluster each time.
@bflad BTW, |
The string after Sorry I should mention that you can use the OR operator to call out two distinct test cases
|
Unfortunately the limiting factor here is the AWS Elasticsearch service itself where each of the create/update/delete operations can take 5-60 minutes to complete. I have not seen the default 20 parallelism of the acceptance testing be of any particular problem to the service since most of wait time is polling read-only APIs for a status update and not caused by API retries due to throttling. |
@jtcressy, @bflad thanks for |
What needs to be done to get this PR merged? It would be great, if we could create a 3 AZ elasticsearch domain with terraform. |
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.
Hi @jtcressy 👋 Its been awhile since we heard from you and it looks like the acceptance testing is still failing in some places (see below). Do you need any assistance or still have time to work on this? The new argument also needs documentation in website/docs/r/elasticsearch_domain.html.markdown
. Thanks!
--- FAIL: TestAccAWSElasticSearchDomain_ZoneAwareness (2028.78s)
testing.go:568: Step 0 error: Check failed: Check 3/3 error: aws_elasticsearch_domain.example: Attribute 'cluster_config.0.zone_awareness_count' expected "3", got "0"
--- FAIL: TestAccAWSElasticSearchDomain_complex (8.79s)
testing.go:568: Step 0 error: errors during apply:
Error: ValidationException: NumberOfAvailabilityZones should be either 2 or 3
--- FAIL: TestAccAWSElasticSearchDomain_internetToVpcEndpoint (1349.31s)
testing.go:568: Step 1 error: errors during apply:
Error: ValidationException: NumberOfAvailabilityZones should be either 2 or 3
--- FAIL: TestAccAWSElasticSearchDomain_update (9.06s)
testing.go:568: Step 0 error: errors during apply:
Error: ValidationException: NumberOfAvailabilityZones should be either 2 or 3
--- FAIL: TestAccAWSElasticSearchDomain_update_volume_type (62.50s)
testing.go:568: Step 0 error: errors during apply:
Error: ValidationException: NumberOfAvailabilityZones should be either 2 or 3
--- FAIL: TestAccAWSElasticSearchDomain_vpc (63.80s)
testing.go:568: Step 0 error: errors during apply:
Error: ValidationException: NumberOfAvailabilityZones should be either 2 or 3
--- FAIL: TestAccAWSElasticSearchDomain_vpc_update (66.13s)
testing.go:568: Step 0 error: errors during apply:
Error: ValidationException: NumberOfAvailabilityZones should be either 2 or 3
Hi @bflad, please take over if you have the means/time. I've been swamped at work and haven't had the time to make progress on this PR. |
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! |
... when zone awareness is enabled
Community Note
Fixes #7504
Changes proposed in this pull request:
cluster_config
:zone_awareness_count
config.ZoneAwarenessConfig.AvailabilityZoneCount
asint64
TestAccAWSElasticSearchDomain_ZoneAwarenessWith3AZ
Output from acceptance testing:
Implemented my own tests for this. It's based off of
TestAccAWSElasticSearchDomain_basic
and simply usescluster_config
to deploy 3 nodes across 3 AZ's.