-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Fastly improvements #9629
Fastly improvements #9629
Conversation
f373ead
to
f025527
Compare
f025527
to
f9e4384
Compare
Can I get some love here? The fastly module barely works without these changes. Just rebased to fix the merge conflict. |
It would be lovely to get this merged, as we struggle with exactly those issues |
In the mean time you can build that providers as an external plugin: git clone https://github.com/zimbatm/terraform.git
cd terraform
git checkout fastly-improvements
make plugin-dev PLUGIN=provider-fastly
cat <EOF >> ~/.terraformrc
providers {
fastly = "$(which terraform-provier-fastly)"}
}
EOF something like that |
Fastly will fail if the user sets the port to 443, ssl_check_cert is set to true and the ssl_hostname is not provided.
Because false is the default empty value of bool, omitempty would never send those to fastly. In some cases Fastly then defaults to setting the value to true (eg: ssl_check_cert) which would result in having the resource always being in a dirty state (Faslty returns true, the resource wants false).
f9e4384
to
bf641d0
Compare
Agreed that it would be great to get this merged. I'm in need of some of these fixes as well. |
@zimbatm I'm having issues running the commands you outlined above. It's asking me to set GOPATH. What should that be set to? |
try something like this (EDIT: fixed per next comment):
|
@zimbatm Thanks, I was able to get it to work with that pointing me in the right direction. One clarification, the directory structure should be It would be great to get this merged so it is part of the next release. There are some pretty critical pieces left out of the Fastly provider and this helps push it in the right direction. What do you think @stack72? |
Ping, @stack72. Any chance that you or someone else can take a look at this one? Thank you! |
Will get to this this week! Sorry it has taken so long Paul |
ok, the only thing this is missing is the update to the documentation - I can take care of that though |
Manually merging to include the documentation |
Great, thank you @stack72! When does a change like this typically get tagged and/or rolled into the latest stable? |
This will be part of the 0.8-rc3 release and thus on the 0.8 stable release in the next couple of weeks P. |
Good news. Thanks again for the help! |
@zimbatm I think that there may be a bug with this code. I recently ran into an issue where my backends had a TLS hostname set, but pushing a value to it through Terraform cleared it out. Have you run into this issue? |
I've confirmed that this indeed does not work as intended, whether you are adding or updating a backend. The code allows you to get through to the resource creation (which it didn't do previously), but nothing shows up in the backend's "Certificate hostname" field, which causes 503 errors when Fastly hits your origin server. Is there any way that we could get this fixed in a minor version update? This is pretty much a show-stopper for my HTTPS site, as negotiating with origin will always fail. Let me know if you have any questions. Thanks! |
Can you please paste the code with clearly redacted sections if you have to redact something? |
@zimbatm Sure.
When I do this, the ssl_hostname field does end up showing up in my state file for the port 443 backends. However, when I look in my newly activated version, I see the backends with the "Certificate hostname" field blank. Let me know if you need anything else. Thanks! |
Can you try to set Fastly tend to change or remove values that were set through API calls. They are trying too hard to be helpful which results in these weird cases where a value is set but then appears as null or something different when reading the API back. If I remember correctly, if |
Unfortunately that did not work. If I recall correctly, |
@zimbatm Were you able to confirm if you could reproduce this issue? |
Sorry I don't have the time to work on this at the moment. If you want to
try to debug this try to run terraform with TF_LOG=trace
…On Mon, 2 Jan 2017, 22:04 Jeremy Livingston, ***@***.***> wrote:
@zimbatm <https://github.com/zimbatm> Were you able to confirm if you
could reproduce this issue?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9629 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAMsE6lvUq1kCbKCJJKCz-gEfoPWH_Rks5rOXR0gaJpZM4KhSkw>
.
|
FYI, the part of this "fix" broke imports of backends which have options set to
@zimbatm what was the reasoning for wrapping those booleans in e.g.
|
@zimbatm I read your comment on the commit. If the |
Also, @zimbatm, I was able to do some testing directly with the Fastly API and think I found the issue with the SSL certificate. It appears that when I use the From the docs, it says ssl_cert_hostname:
This is confusing because when I use ssl_hostname, nothing shows up in either the Certificate Hostname or SNI Hostname fields. When I use the individual Let me know if you have any thoughts. My initial reaction is that we should add both |
@msuterski the reason to use @jeremylivingston yes I think adding the other options is a good idea. I'm not using Fastly anymore so I'm not highly motivated to work on this |
@jeremylivingston the If you have problems with it make sure that:
You can verify your SSL Cert by curling your origin over https with the |
@stack72 I was wondering if you'd have any suggestions regarding how to handle the types conversions in the TF's schema parser. The parser clearly expects these values as This actual problem is also causing TF to fail updating the state files while we're running TF's The service creation and updates "work" and set expected states only because we are passing already modified schema object to the resourceServiceV1Read (seems like Read function is meant to override the values from the original schema). My first suggestion would be to remove the type conversion on the functions that pull data from Fastly. I think @zimbatm was correct with the type conversion when we're pushing data to Fastly. I was incorrect before, this is broken for all the boolean values returned by Fastly, not only ones with the |
@msuterski Thanks for the insight. I didn't realize that you had to override the origin hostname when calling the server. I haven't had to do this when I use the Side note, it does seem odd that settings on |
@jeremylivingston yup, Fastly's web console has a couple of bugs like that. I don't think we've ever used |
@msuterski Got it. From their API docs, it looks like:
So judging by what you've described, is overriding the hostname when using the SNI override required? This is surprising, because it would seem that this is precisely the purpose of the For instance, if I my site lived at www.example.com and my origin was at origin.example.com (with an origin.example.com certificate), is the expectation that I have to override the hostname and set it to origin.example.com in order to have TLS work? Maybe a question better suited for Fastly support, but I figured you might know. Thanks! |
@jeremylivingston I asked Fastly support about the Apparently |
@msuterski Thanks for the info! I opened a PR to add these fields at #12578. Hopefully you don't have too many services to update. 😄 |
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Fixes some issues I encountered:
Might solve #8868 as well but I didn't test