-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
providers/aws: Add ElastiCache replication group support (fixes #1799) #2945
Conversation
Looks like the tests failed:
Weird. It builds and passes tests on my local machine. |
It might be that you use a different version of the aws sdk than the project, check it out: https://github.com/hashicorp/terraform/blob/master/deps/v0-6-1.json#L42 . Hope this helps. |
@dlsniper Those deps look like they are for the 0.6.1 release. Do you know how I update the deps for the next release? |
Sorry, that's something I can't know, maybe someone else does? I've noticed some problems when running against the latest AWS sdk as well so I'm in the dark as well. |
@saulshanabrook Looking at http://docs.aws.amazon.com/sdk-for-go/api/aws.html I don't see aws.Boolean or aws.Long. It looks like there was a breaking change introduced in the SDK. Take a look at 579ccbe for an example where this was fixed in the other resources. |
@josephholsten That makes sense. OK I am trying to do
|
Seems there's that it has been removed in this commit: googleapis/google-api-go-client@18450f4 (warning, it's a bit big). This looks like the new version: https://godoc.org/google.golang.org/api/compute/v1 |
OK I am trying to rebase off of the Yep it does |
OK updated with new names. |
@saulshanabrook pretty sure you meant @joshgarnett, but I could definitely use this stuff. Thanks! |
@catsby any chance this can get merged soon? |
It works in general. But AZ distribution works weird. It put 2 boxes in same AZ, however when I create cluster witn AWS Console, it put them in different AZ. Please add
Result:
|
@saulshanabrook |
Thanks @blacked, merged. This was his example usage, from his PR:
|
Hey @saulshanabrook thank you for the code contribution! Would you by chance be willing to add documentation for this new resource while I review the code and try it out? Thanks! |
Am I correct in that this (as it stands) is not meant to create a cluster replication group for an existing ElastiCache Redis Cluster? There's no mention or use of |
stateConf := &resource.StateChangeConf{ | ||
Pending: pending, | ||
Target: "available", | ||
Refresh: ReplicationGroupStateRefreshFunc(conn, d.Id(), "available", pending), |
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.
ReplicationGroupStateRefreshFunc
should not be exported, right? replicationGroupStateRefreshFunc
instead.
Also, you send d.Id()
as the id to ReplicationGroupStateRefreshFunc
, before setting it with SetId
, thus sending ""
. This causes the function to return false positives in the event that you already have a replication group defined ""
will return all, and then you grab the first. In my case, I had two defined, so I got a false positive that my newest one was up and available.
Calling SetId
before making the WaitForState()
call should fix this 😄
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.
Good catch, just fixed, thank you!
@catsby Yeah it looks like there are two ways to create a Replication Group and we should support both. from the API docs:
Also I will add a |
7416f1e
to
9bef561
Compare
Hey @saulshanabrook – sorry for the silence, is this ready for another review? Thanks again! |
@catsby Yep |
@catsby Anything else that I should do on my end? |
Any ETA on this? |
Was just about to sit down and whip up a PR to do exactly this, so if there's anything we can do to help move this along to getting merged, let me know. |
@thegedge Awesome, thanks for taking a look at this. PR's against my branch would be really great, so that I can add your changes easier. |
+1. Would like to have this in. |
This would be incredibly useful, please merge. |
+1 would love this |
For various other ElastiCache resources we had issues where the AWS API would accept mixed-case names for various things but then normalize them to lowercase and fail if we try to retrieve them using the original mixed-case names. See for example #3235 and #3120. To make sure a similar bug isn't lurking here it'd be good to make the Separately, I have a terminology question: for several of the other ElastiCache objects the main identifier for the resource is |
@apparentlymart That sounds like a good idea, for the case normalization. I am not working actively on this at the moment, but am happy to accept PR's against my branch. |
Would like to be using this, please merge |
@@ -18,3 +18,4 @@ website/node_modules | |||
*.bak | |||
*~ | |||
.*.swp | |||
config/lang/y.go |
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 should not be in the .gitignore
. There's some oddness with go 1.4 and 1.5 but for now this file should just not be included in any changes, more ignored. Sorry for the hassle
I posted a few notes, but I think this needs some follow up. We need to merge/rebase master, and we need to evaluate what we're sending to the API. I got many "invalid parameter combination" errors when trying to specify all/some of the attributes. |
@catsby I am not actively working on this, at this time. If anyone wants these changes integrated, you are welcome to use this work here and propose a new PR onto this repo or my branch. |
+1. I'd like to use this. |
I am going to close this for now, since I am not going to fix it up. |
Don't forget about tags... We're building from @dpetzold branch, so if possible we'll update it there... |
@catsby this seems like a feature that hashicorp should invest in given the original submitter closed the issue... and there are lots of people running a forked version to get the functionality. |
@catsby Need this also |
+1, need this too |
we could use this as well |
+1 this would be great to have |
Can someone please lock this CLOSED issue so that it doesn't generate anymore +1 e-mails? Thank you! |
@catsby @dlsniper, @dpetzold and I intend to follow up on the work that @saulshanabrook did here. From the inline comments, it doesn't look like there's much left to do. Am I missing something? |
@catsby any update on this? |
I've locked this since the original submitter has said he no longer intends to work on this and so further discussion here isn't productive. If someone would like to build on this and submit a new PR then that would be much appreciated! |
This is based off of @inferiorhumanorgans work in #1799. I fixed some import paths and added a
primary_endpoint
attribute, so it can be used like this: