 My name is Rufaida. I'm a platform engineer at Liquid reply One thing one more thing about me is that I like watches traditional watches How many people in this room like watches? Good quite few If you have this watch will you buy it? Just raise your hand Do you like this watch? You Felt in a trap This one is 30 million and took 44 years to be created the creator died even before actually finish it a Real life before you buy something you actually ask how much you check the prices before you buy you don't buy blindly But when it comes to infracost we actually the majority of people doesn't care They just don't care how Do we need this instance? How many instances do we need? How exactly? Memory how much memory do we need actually for the application? It's a lot of details that It's a headache. We just copy paste code and then post it How do you solve this problem? We stay like we still lazy engineers, but we still have a visibility about our infracost Today, I'm here to discuss this with you so the combination between open to foo and infracost and GitHub action give you a cost Visibility in your PR request and you can check it before you apply the plan of your infrastructure So today we're gonna speak about what's open to foo the use case of open to foo and How to migrate from terraform to open to foo? What's infracost how infracost work and how to write how to integrate and write your own action? Little story before we start As you may know like last year hashi carb change their terraform open source last license to business license and This leads to the Perth of open to foo What's open to foo open to foo is an open source terraform fork That's a drop-in replacement for terraform v1.6 and it's fully compatible with all previous versions It's maintained by linux foundation. What does that mean? It means that linux foundation guarantee that open source will Remain truly open source and under and are widely trusted license from the companies community driven so that board requests and and Projects are governed by communities in partials so the values features and fixes are Accepted space on the community based on their values to the communities Lired and modular So that with with a friendly project Structure so anyone can contribute on top which create an ecosystem of tools and integrations and Finally backward compatible which Means that existing codes can drive values years from now The most popular use case of open to foo is that open to foo simplify your multi-cloud deployment This increase your fault tolerance and give you a greater silence and Open to foo Simplify your streamlined your application infrastructure management. It handles entire applications and It lets you manage your infrastructure and orchestration for applications Self host close self service cluster the main The benefit of self serve model and that your project team is not can can manage their own infrastructure So this reduce the centralized This reduce the needs and centralized operation teams This this reduce the dependency on your operation team Policy compliance with open to foo and force policy Compliance and force policy as code so So So So introduce your fork, sorry, I'm a little bit nervous Introduce your bottleneck on ticket-based review processes Sit up for platform as service application like her a co Open to foo can give you configuration for stn dns and Other services without we've interface And the interact of software defined networking This actually open to foo can Open cof to foo can configure your sit up without actually Open to foo actually can interact with your with your network configuration. So this give you an automated deployment And of course open to foo manager cluster resources and Services So as open to foo is a fork of terraform. It has exactly the same workflow so you first write your infrastructure as code You plan it and then you apply it Open to foo a few if later I have time I can show you this in action This is how it looks like when creating s3 bucket with terraform and This how it looks like when creating with open to foo. It looks exactly the same Infra cost what's infra cost? Infra cost is a leading approach source cloud project. It has over three millions resources priced Across different cloud provider. You can access it the through CLI or Cloud pricing API or you can integrate it with your CI CD They have the option of self-hosted or integrated with their cloud subscriptions How it works actually infra cost is can't your Infrastructure as code a generator cost estimation for your infrastructure and then NT It can give you the option to integrate it with CI CD And then you can see the cost as a poor request So like this you can see the previous cost the new cost and the differences Later on we can see also listen action in order to use the infra cost you have to integrate it with your CI CD and our and our In our case is the GitHub action So, how do we do this simple you just go to infra cost Document and then you take the template you say the templates This template basically like install infra cost do the cost Breakdown and then post it here to the to the GitHub But this has one single problem that infra cost this template is limited to one single Terraform repository or infrastructure as code repository How do we actually what if your repository has different? Service Terraform services or open-to-full services What if you review a repository has like a monolithic like your company use mono approach for your terraform or for your Infrastructure as code We write our custom integration. How do we do that? GitHub action give you three type of custom actions the javascript action composite action and Container action How does container action looks like? Container action has three main component. The first component is action Yama second component is container file or docker file and the third component is the entry point which contain actually your business logic and And you can see now we are ready actually to see the code in action But we need a few preparation before we start We have we can actually first install infra cost It's easy if you use Mac OS like you do and prove install infra cost or We need also to install the infra cost key and then what do we do with the key? We store it and get up Secrets because we are going to integrate it with GitHub actions and we store it here So I'm going to show you this live. How do we do it? So can you see it? Is it clear? good This is the action Yama which actually container the Have which actually contain the description and runs on Dock app file. It's basically calling the docker file And look a file as usual contain the installation we hear installing open two full and Here we are installing infra cost GitHub CLI and other required installation and then we give the permission The entry point is simple as infra cost as you see in the previous Picture or screenshot that to use infra cost is using PR. I I can show you also the comment here It's using the ball request. How do we get ball requests here? By getting the PR number it actually get the commit or the ball request so we need the ball request as PR number and And here we are creating a development environment and Here is basically our logic when we have different services. We create a simple loop to go through the services So we basically go directory by directory in our repositories which we fetch it previously in this step and Then we do tofu in it. It's basically like terraform in it and then we do We created a workspace is basically like terraform you created Terraform workspace new and then you do also like with open tofu you do to phone workspace new and In order for the developer to see the plan in the pull request on case something went wrong with the plan the plan doesn't work or something decided to post the plan actually and And this in the PR itself. So we just Do a tofu plan and we post it later on I'm gonna show you all these like when we create a PR and Then finally we do infra cost break down path to see the cost and then we commented the cost Let's Create a poor request Not here So I have prepared something for the poor request Here is the S3 S3 service. Let's assume and there is another service. I just call it service to just for simplifying it And here I'm basically creating a service An S3 bucket and here I created a little bit more than S3 pocket So let's create a branch Need to add everything and let's commit it and create a poor request Okay, now we push it and see how it is When we create the poor request the pipeline will automatically try triggered and then you can see it here that started already and We have actually few steps in the pipeline. It takes a little bit of Time to Run so the first we are building just the looker file and Then we check out the repository. We need the AWS script to see the plan and then we run our action that I just show you While it's running I can show you a few things here also If you are using visual studio code, there is an integration a plug-in that you can integrate With your visual studio code it code impracost. It's called impracost. So this actually show you This show you the cost actually in action before even you Submitted or created poor request. So this is like it gives you 40 dollars if you change it to micro You can see the cost updated here also save of course It's 10 euro because we changed it to micro and you can see also which services has a cost or not Now the pipeline is actually finished. We can see the poor request We have actually plan. It's showing you the plan that's Created an instance and everything. This is the same if you do it to full plan locally is exactly the same and It's kind of take a while until it shows but I can't show you the cost locally Opening the wrong one. So if we do if we go to the service, let's say service to and then we do Infracost dash dash path and then here I want to see the cost here It give you the view of the cost like you can see that you created a new services If we created another services, let me create it. Just go ahead and create another service Like service to Service three and then I will copy the same here If we create another service and then we save it if we apply it here We can see it also CD To feed you Infracost dash dash Breakdown touch touch path and then here Yes, I mean breakdown It's actually give you all the cost and all services One more thing I want to show you actually before we are done here is that the migration for open to full To infracost is really simple If you have your you have to make sure that all your plan are applied And if there is nothing planned and then you do actually, let's say terraform plan terraform in it Atelize first It's taking a while until it and it lives today Should not be a problem. Yeah, maybe anyway, it's Simple actually, but it's kind of I should have prepared before because take a little bit awhile to initialize but It's I can show you here. It's exactly the same, but I couldn't show you an action. So That's all for my side Sorry for the confusing a little and that's it Thank you for presentation I have a question about how do you Estimate the cost of dynamic resources. So for instance, I have an instance group and That can scale from zero to 100 vms. Can you provide Information about I think I think this is like not a cloud cost This is like cooperatives cost and for these is has another tools like cloud Infra cost doesn't help you with this tool, but you maybe can search for like Cluster cost. I think there were a nice tool called your Cluster cost, I think I'm not sure of the name, but I don't think you can measure it here Yeah, thank you very much for presentation. I have a question Is it possible to export this data to the further location? And if so, it's possible to integrate it into the workflow, which state So the info cost gives you output, right? So it's possible to export it to some other location Maybe I don't know database or history bucket or yes. Yes, it is actually you also you have Cloud cost cloud info cost subscription You paid for it and you can have it all in their cloud and you can download a CSV file or you can even like Add like in the documentation you can see how can you import it or export it. It's it has this option. Yes Okay, thank you very much. You're welcome Hey, thanks for the presentation one question on how do you calculate for the spot instances if if If most of my workload is using spot instances and how do how does this calculate? I Think I don't know what spot instances. Can you can you clarify? What is it in AWS? You have Spot instances where you get dynamic Costs based on the availability So you take from a pool of resources where it is unused in the AWS data center. So they give you for 60 to 70 percent lesser cost I'm afraid I can't answer your question because I never played with that. Okay. Thanks Thank you for the presentation In our project, we have a lot of workspaces for some of our telephone projects something like 30 or 40 and We actually looked into Into infocus at some point and it just created a ton of comments In the github pull request is it possible to just summarize the changes into one comment in the github pull request? Yeah, I think they have this hide and new like you have this behavior you can use And I knew like here like I'm gonna show you in the entry point Do you use here like new every time or update you can use also hide a new I will hide all the comment and give you only the new one and then give you also summarizing it. Okay. Yeah We didn't Yeah, they have different behavior you can always like they have new update hide a new and hide an update I think I'm not sure but you can check the documentation Okay, great. Thank you All right, we have time for one more question if there is one Hey, thank you. I actually use it across in a lot of my projects. So I really appreciate the work you guys Do on that anyway? One of the things I noticed is like it doesn't like ABS has egress costs and stuff, right? It doesn't really account for that kind of stuff obviously because it doesn't know about it Do you know if there's any plans to add like Some sort of custom configuration that we're allowed me to specify what I assume might be the egress for the month Just so I could show that to a customer I Don't know I cannot answer you because I don't work with them fracost but Maybe in fracost guy can answer you. I don't know like if there's a plan or not All right, I think there was one more question on this side. All right. Thank you very much. Oh, sorry. No, we do have So I'm actually curious. What are the requirements for the provider to actually work with infracost and And What do you mean with requirements like I have my own provider for X cloud or Some cloud I want to integrate with Infracost I think if your provider like are listed in infracost documentation You can use infracost because they don't support all providers. I'm afraid if you have your own provider You can't use it. I mean Yeah, maybe you can request on fracost, but for now they support few providers and you can check them and you're in their documentations Thank you