-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Support VPC Options for Elasticsearch #2013
Conversation
In my environment, testacc finished with timeout error...
|
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.
Thanks for the work here :)
I allowed myself to make a review of this work to better help you.
Also, if you encounter create issues, you can still increase the Creation/Update timeout :)
Is this work still in progress? it looks ok at first sight :)
@@ -143,6 +144,26 @@ func resourceAwsElasticSearchDomain() *schema.Resource { | |||
Default: "1.5", | |||
ForceNew: true, | |||
}, | |||
"vpc_options": { | |||
Type: schema.TypeList, | |||
Optional: true, |
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.
This implementation implies that we can have more than a single vpc_options section.
What do you think of adding a MaxItems
option set to 1, so that we can only define a single VPC configuration?
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.
I agree with all reviews:bow:
And after increasing timeout, I'll run testacc and report the result. Of course, I won't add the timeout change.
|
||
if len(options) > 1 { | ||
return fmt.Errorf("Only a single vpc_options block is expected") | ||
} else if len(options) == 1 { |
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.
The else is not needed since the first if returns, meaning we can simplify this to:
if len(options) > 1 {
return fmt.Errorf("Only a single vpc_options block is expected")
}
if len(options) == 1 {
...
}
However, I do think we can simplify this a lot.
Since only a single vpc_options
section should be configurable as far as I understand the API, checking more than 2 is unnecessary, hence the MaxItems
option.
Then, we can also add this line 256:
option, ok := options[0].(map[string]interface{})
if !ok {
return errors.New("vpc_options is <nil>")
}
if option != nil {
//...
}
The same kind of logic applied to the update section would then be required. What do you think? 😄
@@ -85,6 +86,10 @@ The following arguments are supported: | |||
* `automated_snapshot_start_hour` - (Required) Hour during which the service takes an automated daily | |||
snapshot of the indices in the domain. | |||
|
|||
**vpc_options** supports the following attribute: |
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.
Nitpick: missing s to attribute
ebs_enabled = true | ||
volume_size = 10 | ||
} | ||
vpc_options { |
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.
Could you fix the indentation here so that it matches the rest of the test configuration?
} | ||
|
||
resource "aws_security_group" "foo" { | ||
name = "terraform_acceptance_test_example" |
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.
Can you add randomization to this name also? it will help avoiding conflicts when running acceptance tests on our side 😄
@atsushi-ishibashi I'm seing that there was another work for VPC options opened earlier: #1958 Perhaps you could help & contribute on that? :) |
@Ninir Oh, I missed it... Sure👍 |
#1958 was just merged and will be part of the next release. Thanks for the spending the time & investing the effort into this PR though. |
Any idea when this will go live? |
@darrenhaken |
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! |
#2010