Convox Community

Accessing postgres created with `convox resources create ...` through CLI

I created a couple postgres instances in the past with convox resources create postgres (not in my convox.yml) in the past, which are not accessible through convox resources info/proxy ... anymore (getting 400s).

Is there a way to re-link an existing created postgres to a service in the CLI – both of which are already deployed? If I add a postgres resource to the convox.yml to deploy, it’ll create a new one which I don’t want. I tried convox rack resources link postgres-XXXX but that gave me a ERROR: resource type postgres does not have a link strategy

Tangentially, how would I deploy service-independent resources like a postgres instance that I want to connect to via multiple services (also, would that even be good practice vs. tying it to a service)?

We were totally blindsided with this change as well. The docs are super vague on how any of this works. On top of that, I’m a bit worried that this post has been up for almost 3 weeks with no response.

1 Like

To work with rack level resource you now use the convox rack resources ... CLI namespace.

See these for more details:


https://docs.convox.com/gen1/resources

1 Like

It seems like this is sort of blurring the lines between what is “Gen 1” and what is “Gen 2”. We moved to “Gen 2” quite some time ago - or so we thought. I didn’t even consider that we were still using “Gen 1 resources” - in my mind we had moved past Gen 1 entirely at this point, but it seems like things are still being thrown back into the “Gen 1” bucket. It’s extremely difficult to stay on top of what is changing, and what is being deprecated as a “Gen 1” feature.

Plus we’re actually losing functionality. As far as I can tell there is no way to create cross-service resources now? It’s also not clear when resources are created and destroyed. For example, if an RDS instance is removed from the YAML, does that cause it to be destroyed entirely?

I like that I can now subscribe to the “releases” forum - that should help significantly. But there are still a lot of unknowns. We’re using this stuff in production, and it’s becoming increasingly scary for us. So far nothing has broken, but these changes feel very random to us and it doesn’t inspire confidence. Is there a roadmap I should be paying attention to or some other information source around what we can expect to change moving forward?

1 Like

If you really want to use a resource across multiple apps, you can create an “application” that contains only the shared resource(s). You can then copy the connection information from convox resources into environment variables of other applications.

That being said, I generally advise against sharing resources across applications. Coordinating schema changes between codebases can be quite tricky.

Yes, just like any other item you add/remove from the convox.yml it will be created or destroyed when it is added/removed.

All databases are snapshotted before they are deleted.

2 Likes

@ddollar Thanks for the clarification!

I’m also a bit worried that my Gen 1 resources (RDS and ElastiCache) might have problems in the future, because I haven’t added any resources to my convox.yml. (And I just found out about this change.) I’ve turned on termination protection for everything important, and my app connects to them via the configuration in an ENV variable, so it seems like it should be fairly stable.

Is there a migration path where I can move my earlier resources into the convox.yml, so that I can stay on top of the latest changes? E.g. Can I convert a rack resource to an app resource, and then move it into my convox.yml?

I’ve also noticed that convox help is missing any details about the convox rack resources commands. I guess this is because they are deprecated?

I also just saw that S3 is no longer mentioned in the documentation. Is it still possible to create an S3 bucket through Convox (either the CLI, or convox.yml?)

EDIT: I figured out that the command still works if I create a rack resource:

convox rack resources create s3 --name "my-bucket" --wait

It would be really helpful to add this to the documentation and the convox help output.