-
Notifications
You must be signed in to change notification settings - Fork 77
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
Add support for Heroku Private Space CIDR and Data CIDR #167
Conversation
I've been able to test this today using the built provider in |
heroku/resource_heroku_space.go
Outdated
@@ -29,6 +29,20 @@ func resourceHerokuSpace() *schema.Resource { | |||
}, | |||
|
|||
Schema: map[string]*schema.Schema{ | |||
"cidr": { |
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.
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.
yeah, happy to move them.
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.
one note here: I put these in alphabetical order, because it seemed the others were as well. If you prefer me to still move them, let me know.
heroku/resource_heroku_space.go
Outdated
"data_cidr": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
Default: "10.1.0.0/16", |
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'm not seeing a default value set in the docs. May I ask where you're getting "10.1.0.0/16"
from?
EDIT: Ah, I see. That's the default value when I GET
the space. Interesting that it doesn't list in the API docs.
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 believe this is an undocumented default. I've created spaces without specifying the values for cidr
or data_cidr
and the data_cidr
is set to 10.1.0.0./16
I'd actually prefer to leave the defaults out of here, but I couldn't figure out how to get the value to be removed from the JSON POST data (they would always result in empty strings). If you can point me in the direction of solving that way, I would remove the defaults from the terraform code.
heroku/data_source_heroku_space.go
Outdated
@@ -8,6 +8,16 @@ func dataSourceHerokuSpace() *schema.Resource { | |||
return &schema.Resource{ | |||
Read: dataSourceHerokuSpaceRead, | |||
Schema: map[string]*schema.Schema{ | |||
"cidr": { |
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.
You probably want to add the Computed
declaration for cidr
and data_cidr
.
Hey @shawncatz, Thanks for the PR! Two initial questions:
Thanks! |
|
d81014d
to
909e656
Compare
I believe I have addressed the PR comments. Let me know if there's anything else. |
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.
Thank you for this @shawncatz 🙇♂️😄
I agree @davidji99 that the vendored heroku-go client should be a separate PR.
We have other folks wanting the freshest heroku-go client, so now is the time ✨
once #169 is completed / merged I will update this PR |
@shawncatz #169 has been merged. Go ahead at your convenience! |
Thanks @mars! 👍 |
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.
👍
@mars you have any further comments? If not, I'd like to merge this and get this in v1.7.4. EDIT: Actually, we should probably bump to v1.7.5/ |
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.
Yes, looks great 👍
Just a friendly bump. I’d love if we could get this merged. It’s extremely relevant for me as I’m migrating my company’s heroku infrastructure to private spaces this week. |
I'll merge, prep the CHANGELOG, and request a release from Hashicorp 🏁 |
WOOT! Thanks all |
cidr
anddata_cidr
toheroku_space
resourceThis is my first time contributing code to a
terraform
project, so definitely open to feedback on code style and such.I've had a lot of trouble getting the acceptance tests to run, but it appears things are working.