-
Notifications
You must be signed in to change notification settings - Fork 37
Fork #257
Comments
Shared ipv4 address (enabled on app) is working now AFAICT |
More fixes for ip addresses, certs, etc. I renamed a bunch of fields to make them more consistent (no units, underscores between words etc). I think I had probably already made breaking changes merging/updating all of the above, and better to break things now than later. The fixes to the state file should be straightforward, but let me know if you have issues. |
@andrewbaxter Having some issues with the shared IP while creating a
Possibly an OpenTofu issue? |
That sounds like a normal error... I assume this is a new resource? Let me see if I missed reading that from an api response somewhere - when you create a new resource all the fields are "unknown" I think, and you need to read them from the api response. Maybe opentofu is more strict in this regard. The other possibility is if it's an existing resource maybe the old value is |
andrewbaxter@b5e59ca should do it I think? Tagged as 0.1.9, build will take maybe 10 minutes. |
Solves the shared IP issue but now I'm getting a 400 Bad Request on volume creation: terraform {
required_providers {
fly = {
source = "registry.terraform.io/andrewbaxter/fly"
version = "0.1.9"
}
}
}
provider "fly" {}
resource "fly_app" "redacted" {
name = "redacted"
org = "..."
assign_shared_ip_address = false
}
resource "fly_volume" "redacted-volume" {
name = "redacted-volume"
app = fly_app.redacted.name
size = 10
region = "yyz"
}
|
Great! And not great. Uhh, I'm not sure. That looks like the right endpoint and I didn't touch the volume create part of the code, and it's working for me (just for the record).
If there's an issue with the request it should be apparent as some difference between the requests. |
After attempting to create the volume manually, the issue appears to be the volume name. Also, while I was renaming the resources and re-applying the changes, I ran into another issue with volume deletion:
Seems like the API call has a couple fields swapped around? (volume name/app name) Edit: found another issue; providing an empty list of resource "fly_machine" "server" {
...
services = [
{
ports = []
internal_port = 9000
protocol = "tcp"
}
]
}
Thank you for all your work on this fork @andrewbaxter, I was working on updating https://github.com/dirien/pulumi-fly and was worried I'd have to give up before I found this issue. |
Fast! I'll reply to the ports thing in a second. Hmm strange, #213 says the api itself doesn't accept underscores if I read it correctly. I'll remove the local validation, I think that's the best way to do it (at worst it just delays the error slightly, right?) And you're right, it looks like the arguments were swapped. Fixed (or, will be in a second). |
Oh no, I'm glad you're trying it out and helping me debug issues too! I can't test everything myself and I'm not sure if it'd have been worth it if I was the only one using it. I'll take a look, the ports thing seems simple enough to fix. |
Fantastic, thank you. Any idea on how difficult it would be to add the |
I don't think you'd have a hard time of it, it should be pretty straight forward. The hard parts are looking up how that works in the api and testing it (I don't use those so I can't easily help with the latter). If you want to try it that would be awesome! |
Let me just dump about the services thing quick. I think the simple issue is
This puts a normal go array in the terraform data, instead of a But I think overall this should be changed to using the terraform wrappers everywhere... maybe? I haven't touched the machines code much so far, and there's a couple other things I've been trying to replace, like instead of doing wholesale replacement of the data when getting api responses just merging just the computed (upstream modifiable) values. There's places where you send the fly api a value and the api returns an empty string or whatever, and when it's replaced terraform freaks out. Writing this out, I'll try the simple fix for now and maybe next time I have to touch the code I'll try doing a larger fix. I imagine there are probably other bugs with the machine code due to the above that will come out at some point.... |
Okay I pushed Also I'd be happy to try adding those fields, if you don't mind doing some back and forth testing/bug fixing like we're doing now. But of course, if you want to make an PR that would be totally awesome. (Edit: I'm off now) |
Oh, I just looked at he pulimi provider! Does that import this then? Let me know if I can change something to make it more adaptable/importable or whatever. |
I made a fork to merge a bunch of fixes and make other quality of life changes: https://github.com/andrewbaxter/terraform-provider-fly
I've re-published it here: https://registry.terraform.io/providers/andrewbaxter/fly
Note that there may be bugs (and skipped version numbers as I get the build working). I'm happy to review, merge, and release, but I can't test all the features. I don't think this is such a dynamic target that stability will be lacking.
As for what's included atm:
I tweaked the code a bit unnecessarily and fixed a few issues I saw locally, deleted stuff I didn't want to maintain for now (makefiles, dockerfiles, examples, etc)
I cherry-picked/merged:
force_https
on handlers #240auto_destroy
on machines #239Affected issues:
fly_volume
name validation is invalid #213fly_machine.mounts.volume
should only acceptfly_volume.id
, notfly_volume.name
#168 (per above prs)services
property onfly_machine
#169 (per above prs)The text was updated successfully, but these errors were encountered: