https://infracost.io logo
Title
f

famous-engineer-27909

10/04/2022, 10:02 AM
Hi <!channel> I need help to setup bitbucket pipeline any reference will help and one more thing my tf state file is stored in S3 bucket so need reference on that regard. Thanks
w

worried-soccer-67640

10/04/2022, 10:04 AM
read the docs
a

adorable-chef-9415

10/04/2022, 10:04 AM
Hi Please give more detail What kind of issues you faced during pipeline setup?
f

famous-engineer-27909

10/04/2022, 10:05 AM
I have gone through doc
I am not able to find references how we can use when you tfstate file in s3
m

mysterious-teacher-68276

10/04/2022, 10:08 AM
hi @famous-engineer-27909, please don’t use “channel” as it notifies all the 664 people in this community, and it might be a bit alarming for other members. In regards to your question - what method of integration are you using Infracost with? Plan JSON or HCL parsing?
f

famous-engineer-27909

10/04/2022, 10:09 AM
My bad, Noted @mysterious-teacher-68276
b

bulky-jackal-21121

10/04/2022, 10:09 AM
Also, learn how to use punctuation - it helps.
m

millions-optician-95381

10/04/2022, 10:16 AM
Hey @famous-engineer-27909 Start with something so simple like:
infracost breakdown --path .
this will not need
state
file or S3 backend access.
If everything is working, then, you can read the state file with Terraform plan:
cd path/to/code

terraform init
terraform plan -out tfplan.binary
terraform show -json tfplan.binary > plan.json

infracost breakdown --path plan.json
Compare the two options, and see if you really need to use the state file for cost breakdown. 🤷
https://www.infracost.io/docs/integrations is missing Bitbucket, CircleCI, and Jenkins, I’m sure the team will work on this soon. • bitbucket pipeline = infracost pipe • CircleCI = infracost orb • Jenkins = infracost Jenkinsfile
but not that hard to write your own
f

famous-engineer-27909

10/04/2022, 10:28 AM
Thanks @millions-optician-95381 will check, and if i have doubt will let you know
m

mysterious-teacher-68276

10/04/2022, 10:28 AM
Thanks, @millions-optician-95381. Yes, we actively encourage folks to use HCL parsing by default because this doesn’t require Terraform state or cloud credentials. If, as Mohammed rightly says, you have price inconsistencies or use rely on multiple data blocks and remote state to build resources, then we recommend the Plan JSON approach. This can be built with Terraform, as Mohammed has shown. We also have an example of a bitbucket pipeline using HCL parsing here: https://bitbucket.org/infracost/infracost-bitbucket-pipeline/src/master/
m

millions-optician-95381

10/04/2022, 10:31 AM
@mysterious-teacher-68276 Thanks for the tips, can we add
bitbucket
pipeline with the upper link to https://www.infracost.io/docs/integrations?
m

mysterious-teacher-68276

10/04/2022, 10:31 AM
yeah we should probably update that