Hi Team, I have some questions now, we are using M...
# help
g
Hi Team, I have some questions now, we are using MongoDB to store infracast price details. If I want to move to postgres. What are the challenges and drawback we may face?
l
@green-needle-5953 is this for the cloud pricing API?
g
Yeah, right
l
Okay, it uses PostgreSQL by default. It used MongoDB a long time ago, so I’m not sure what the current state of that would be. But for it to work nowadays I would definitely recommend the PostgreSQL version.
g
Yeah Ok, For setup the postgres in our environment do I need to change the entire infracost setup or change the postgres only enough
Also could please give me some example of postgres setup if it available
l
@green-needle-5953 the PostgreSQL-based self-hosting cloud pricing API is in our enterprise package, so to get that set up you’ll need to email hello@infracost.io to get started.
g
@white-airport-8778 @little-author-61621 In our previous setup we ran mongodb as a statefullset right now we're planing to move the paas (postgres) Here I've one question. if i change the connection string to postgres is it will work ?
l
Hi @green-needle-5953, that won’t work. The old version is no longer supported.
g
@little-author-61621 So is there any other way to use that postgres ? If it's there could you please give me the process and steps
@little-author-61621 Also I noticed that "Infracost team has their pricing API code available and made it ready in this repo" but unfortunately this repo wont available
can you please access this repo from your side
Hi @little-author-61621 any suggestion on above points ?
l
Hi @green-needle-5953, the current supported cloud pricing API is either available as our hosted option, or self-hosted in our enterprise package.
g
Hi @little-author-61621 Could you please explain what's hosted option ?
l
Infracost provides a hosted the Cloud Pricing API. It’s part of the free CI/CD (https://www.infracost.io/pricing/) plan.
g
Hi @little-author-61621 Thanks, but we are not going to buy any product from infracost, we just want to use free edition. And In our previous setup for store the pricing details we run mongodb as a statefullset right now we're planning to move the paas (postgres). Here I've one question for moving to postgres do I need follow any procedure or need to face any dependency issue
l
Ok, the free edition only works with the hosted one. So the only thing you should need to do is unset the
INFRACOST_PRICING_API_ENDPOINT
environment when running the infracost CLI.
g
If I don't set our cloud pricing API endpoint in our cluster. Is it will switching from MongoDB to Postgres DB?
l
It will switch to the hosted one which uses Postgres
g
Oh right now hosted one is pointing to the postgres ?
If i unset it'll automatically point to postgres right ?
l
It will automatically point to the default hosted one which uses Postgres
g
Yeah, Thanks Alistair
I'll try it
Hi @little-author-61621 the default hosted Postgres means yours right? But in our case we have own self hosted and it's not on your hosted postgres
If I unset I cant use our pricing api
l
Correct
g
So what is best practice to switch postgres?
l
There’s 2 options: 1. Use our hosted version which is part of the free Infracost CI/CD plan (https://www.infracost.io/pricing/) 2. Buy Infracost Enterprise so you can use the self-hosted version
g
Hi @little-author-61621 2 steps here: The generated keys should be sent to github admin properly and then get proper authorization ? right
l
@green-needle-5953 yes, that’s correct
g
And as you mentioned here If i create the repo secrets for that api key it's should be fine right ?
l
Yes
g
Hi @little-author-61621 I've one quires like in our case Cloud Pricing API uses MongoDB to store the products and prices. The Cloud Pricing API has scripts for updating the prices from the cloud vendors using their APIs. So when a new resource is added from the Azure side, the cost details information of the new resource should also be captured. The price details of our earlier resources must be up-to-date
For this do we need to update's any things ?
Because here for the security reason they didn't allow to use the postgres db
l
Updates to the prices are only supported on the free hosted version or the Enterprise self-hosted version.
g
You mean we need to updates our mongo db right ?
l
The old MongoDB pricing API is no longer supported. Pricing updates are only supported on the free hosted version or the Enterprise self-hosted version.
g
Hi @little-author-61621 ok then we're using the selfhosted setup only. So could please gave me the suggestion to updating new pricing details
@little-author-61621 we're using the selfhosted free setup only so is there any way to getting new pricing details ?
l
@green-needle-5953 there is no free self-hosted setup. So there is no way of getting new pricing details.
g
@little-author-61621 I mean we're using free hosted setup only like using " We build a docker image with dependencies that are needed for infracost and deployed it in our cluster"
@little-author-61621 any suggestion alistair ?